-
I have many references implemented as 'qualified name scoping'. However, I have a usability issue for the vscode plugin, which can easily be demonstrated in a simple example on the playground: Just change the grammar to use FQNs instead if IDs (introducing dots as part of the name):
Then my problem gets visible. While typing the start of a name, completion works as expected: Also when typing parts of the first name (before the dot) and parts of the second part of the name (after the dot), completion works as expected: But when using parts of the first name and a dot, completion breaks at some point: (1) OK: "Jo.S" --> "John.Simpson", but already "Simpson" is part of the list (w/o first name) (2) not OK: "Jo.Si" --> "Simpson" For large models this yields very confusion completion effects :-( Is there already an issue for that? I did not find one... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @goto40, completion is a pretty complex thing. The current algorithm jumps to the start of the token at the cursor position to identify the position in the grammar. It needs this position to find out which grammar elements can follow the current cursor position. It also has some additional logic in there to deal with assignments and cross reference related elements. The issue with FQN appears when the start of the token isn't actually the start of the cross reference. The completion would actually need to jump a few more characters back to identify that the current element we're looking at isn't some I've created an PR to fix this in the framework #1138. |
Beta Was this translation helpful? Give feedback.
Hey @goto40,
completion is a pretty complex thing. The current algorithm jumps to the start of the token at the cursor position to identify the position in the grammar. It needs this position to find out which grammar elements can follow the current cursor position. It also has some additional logic in there to deal with assignments and cross reference related elements.
The issue with FQN appears when the start of the token isn't actually the start of the cross reference. The completion would actually need to jump a few more characters back to identify that the current element we're looking at isn't some
ID
inside of anFQN
rule, but theperson=[Person:FQN]
assignment of theGreeting
rule.…