You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When hovering over a @macroname, either nothing is displayed, or any matches for macroname (without @) are shown instead, even if they have nothing to do with the invoked macro (e.g. some function with that same name). Similarly, autocomplete cannot find macro names beginning with @.
This problem can be traced back to the snippet below in SourceCode.getWordIndexLimits in server/pkg/document/sourcecode/sourcecode.go (and possibly similar for Document.getWordIndexLimits in document_reader.go). When the user clicks on an identifier, we only go back as far as there are letters or numbers, but @s are not included in the identifier.
// First invalid character found, that means previous iteration contained first character of symbol
symbolStart=i+1
break
}
}
One potential solution would be to allow @ as part of symbol names, but I guess this could potentially lead to some problems with @attributes, if those ever get their own form of autocomplete.
Alternatively, we could add a property to Word - or a function - which indicates whether or not there is an @ right before the word, and if so we can include that in the search.
To Reproduce
Steps to reproduce the behavior:
Define a macro with @body, which requires an @ prefix, e.g. macro @name(; @body) { @body(); }
Branch search_on_astB totally circumvents bugs related to string manipulation like one as I can traverse the code through the AST instead of trying to be smart by manipulating strings.
Let's keep this issue open to remember testing this in the new version, but I would not try to fix it in main branch.
Describe the bug
When hovering over a
@macroname
, either nothing is displayed, or any matches formacroname
(without@
) are shown instead, even if they have nothing to do with the invoked macro (e.g. some function with that same name). Similarly, autocomplete cannot find macro names beginning with@
.This problem can be traced back to the snippet below in
SourceCode.getWordIndexLimits
inserver/pkg/document/sourcecode/sourcecode.go
(and possibly similar forDocument.getWordIndexLimits
indocument_reader.go
). When the user clicks on an identifier, we only go back as far as there are letters or numbers, but@
s are not included in the identifier.c3-lsp/server/pkg/document/sourcecode/sourcecode.go
Lines 176 to 184 in 116f5fb
One potential solution would be to allow
@
as part of symbol names, but I guess this could potentially lead to some problems with@attributes
, if those ever get their own form of autocomplete.Alternatively, we could add a property to
Word
- or a function - which indicates whether or not there is an@
right before the word, and if so we can include that in the search.To Reproduce
Steps to reproduce the behavior:
@body
, which requires an@
prefix, e.g.macro @name(; @body) { @body(); }
name
Expected behavior
Macro hover info should appear
Screenshots
Desktop (please complete the following information):
Additional context
There is some related discussion at #103
The text was updated successfully, but these errors were encountered: