------------------------ reported by customer --------------------------
Dear All,
With new version of ADS (actually starting from version 11.0.5, x64) I found incorrect behaviour of the autocomplete function if object has “$” in the name.
E.g.
Table name: LEG$TABLE_NAME
If I write select, and start writing name of the table: “LEG$” and then use autocomplete (choose name of the table from “hint” list) then system, instead of “LEG$TABLE_NAME” writes “LEG$LEG$TABLE_NAME”. The problem appears only when in “start text” character “$” is included.
If I write only “LEG” (without “$”) then autocomplete is correct.
------------------------ reported by customer --------------------------
34 KB
This bug is caused by the fix in SVN 27845 made by me, and suggested by Emilian :
<aquadatastudio:#645> SQL Editor : Added "@", "#" and "_" characters are word acceptors for double clicking and word selection.
com.aquafold.aquaeditor.sql.completion.Query
uses Utilities.getIdentifierBefore
to determine the 'skip
' amount (caretOffset - anchorOffset
) in the document and it builds the UI elements SQLCompletionItem
using that value.SQLAcceptor
) and completion doesn't replace the text before '$' (see SQLCompletionItem.defaultAction
which will call substituteText
using _skip =0
).com.aquafold.aquaeditor.sql.SQLStdCompletionQuery.queryType
and .queryCompletionOnType
use AFScriptParser
and custom code to create a CompletionType
and return a list base on CompletionType._txtAfterSpace
. And this time _txtAfterSpace
*does* contain '$'.Query
and compute anchorOffset
(and then, implicitly, 'skip
') while also taking into account CompletionType
(cType._txtAfterSpace
) and not using Utilities.getIdentifierBefore
at all.SQLAcceptor
as it is missing (but I assume there might be a reason you didn't add it there). This is a worse fix since we keep having two different formulas for anchorOffsets
when we should have only one.
com.aquafold.aquaeditor.sql.completion.Query
uses Utilities.getIdentifierBefore
to determine the 'skip
' amount (caretOffset - anchorOffset
) in the document and it builds the UI elements SQLCompletionItem
using that value.SQLAcceptor
) and completion doesn't replace the text before '$' (see SQLCompletionItem.defaultAction
which will call substituteText
using _skip =0
).com.aquafold.aquaeditor.sql.SQLStdCompletionQuery.queryType
and .queryCompletionOnType
use AFScriptParser
and custom code to create a CompletionType
and return a list base on CompletionType._txtAfterSpace
. And this time _txtAfterSpace
*does* contain '$'.Query
and compute anchorOffset
(and then, implicitly, 'skip
') while also taking into account CompletionType
(cType._txtAfterSpace
) and not using Utilities.getIdentifierBefore
at all.SQLAcceptor
as it is missing (but I assume there might be a reason you didn't add it there). This is a worse fix since we keep having two different formulas for anchorOffsets
when we should have only one.
Also note that the previous acceptor was AcceptorFactory.JAVA_IDENTIFIER
(which is basically Character.isJavaIdentifierPart
) and does include $ by default.
The new SQLAcceptor
does not include $ by default since it uses AcceptorFactory.LETTER_DIGIT
(which is basically Character.isLetterOrDigit
).
Note: This actually explains why the commit introduced this regression.
Also note that the previous acceptor was AcceptorFactory.JAVA_IDENTIFIER
(which is basically Character.isJavaIdentifierPart
) and does include $ by default.
The new SQLAcceptor
does not include $ by default since it uses AcceptorFactory.LETTER_DIGIT
(which is basically Character.isLetterOrDigit
).
Note: This actually explains why the commit introduced this regression.
Verified in build 12.0.16-1. I tested against PostgreSQL 9.2, 8.4 and MySQL 5.1
Verified in build 12.0.16-1. I tested against PostgreSQL 9.2, 8.4 and MySQL 5.1
Issue #8282 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 12.0.16-1 |
No time estimate |
2 issue links |
is a duplicate of #7789
Issue #7789Auto-completion doesn't replace full word when a $ character is in the name |
relates to #645
Issue #645Have option to define AcceptorIdentifiers in the editor. |
This bug is caused by the fix in SVN 27845 made by me, and suggested by Emilian :
<aquadatastudio:#645> SQL Editor : Added "@", "#" and "_" characters are word acceptors for double clicking and word selection.