Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes several bugs related to macros, including:
macro fn void thisisinvalid()
);macro
keyword, that ismacro int aaa(...)
instead offn int aaa(...)
(fixes a regression from Slightly improve function hover #102);macro Abc.name(params)
is now parsed and considered for completion, which is invoked asabc.name(...)
for anAbc abc
variable);@body
params are now properly parsed, even when they have arguments (e.g.macro name(; @body(int a, float b))
@body
variable (would be nice to have a separate field onVariable
orType
or something instead), but the current way works as follows: I set@body
's type tofn void(int a, float b)
as that's how it's used in practice, and later parse the type to retrieve(int a, float b)
when displaying it in the signature. Let me know if you'd like any specific change in this regard.Future work
@
. This is because@
is not considered a valid character in a symbol name during search. While I have made some attempts to work around this and had some success, the changes would be larger than I'd like to include in this PR (and I guess this stuff is being reworked anyway in your other PR), so I left them out for now. I wouldn't consider this a blocker for a release. (Opened an issue for this: Hover and autocomplete can't find macros prefixed with@
#104)@body(...)
variable will probably need some special-casing to make the code less arbitrary.Screenshots