Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend preprocessing symbols that have already been typed out in the document #76469

Open
Rekkonnect opened this issue Dec 17, 2024 · 5 comments
Labels
Area-IDE Feature Request untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@Rekkonnect
Copy link
Contributor

Right now, typing out a preprocessing directive does not recommend any symbols aside from the standard .NET SDK ones. So if I have already typed #if SYMBOL in the document, I should be getting it recommended in expressions inside #define, #undef, #if, #elif.

The restriction for symbols within the document is only to avoid performance pitfalls, if there is no index capturing all the preprocessing symbol identifiers used in the compilation. Otherwise, it would be nice to extend this globally across the entire assembly or compilation.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 17, 2024
@CyrusNajmabadi
Copy link
Member

This seems exceptionally niche. We didn't offer this sort of behavior elsewhere with intellisense. You need to define the symbols everywhere else before they show up. I don't see why pp directives should be different

@Rekkonnect
Copy link
Contributor Author

They are not ever "defined" in the sense other symbols are defined. Preprocessing symbols are always available to type out, and the intend is to determine if they are defined with a specific value at that point in the source. If the symbol is not defined in the project configuration, but I use it to check if it should include some code, then it should always be available to use.

I do agree that it's niche. Would love to pick it up myself since I've got some involvement with conditional compilation. It would save a lot of headaches down the line because you'd be avoiding typos that would not be caught by any compilation errors.

@CyrusNajmabadi
Copy link
Member

But the symbol always comes as an option to the compilation in some config, or is created with a #define.

@Rekkonnect
Copy link
Contributor Author

Rekkonnect commented Dec 17, 2024

Even #defined symbols do not appear right now. And to avoid checking if a symbol is defined or not at a given place, I settled for simply checking if the same symbol name has been typed out again, to recommend those in addition to the already provided recommendations.

@CyrusNajmabadi
Copy link
Member

Even #defined symbols do not appear right now.

I would be ok with a PR fixing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants