Skip to content

Enable completion of indented hash directives#1371

Merged
baronfel merged 1 commit intoionide:mainfrom
Martin521:indented-hash-directive
Apr 6, 2025
Merged

Enable completion of indented hash directives#1371
baronfel merged 1 commit intoionide:mainfrom
Martin521:indented-hash-directive

Conversation

@Martin521
Copy link
Copy Markdown
Contributor

The compiler allows preceding whitespace for all hash directives.
FSAC, however, auto-completes hash directives only at the beginning of a line.
This PR enables completion also for indented hash directives.

@baronfel
Copy link
Copy Markdown
Contributor

baronfel commented Apr 6, 2025

Thanks @Martin521! This seems reasonable. I do wonder how much value we get out of this special case instead of just going through the 'normal' "check the parse tree for completion context" stuff we do for all other completions though. That's not a comment on your fix - more the overall reasoning behind why we ever did this split.

@Martin521
Copy link
Copy Markdown
Contributor Author

I guess the reason is that the conditional compilation directives (#if/#else/#endif) (and soon probably also #nowarn/#warnon) are not in the parse tree.
(Completion of these short directives has limited value, but since I was looking for places that need to be changed for #warnon, I ended up doing this.)

@baronfel baronfel merged commit 431eb9e into ionide:main Apr 6, 2025
14 checks passed
@Martin521 Martin521 deleted the indented-hash-directive branch September 21, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants