-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add granular inlay hint suppression options for better noise reduction #81858
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
base: main
Are you sure you want to change the base?
Conversation
|
Remember that all options are things we have to effectively maintain forever. Let's just make sure that anything we're adding is something we feel is very sensible and has reasonable semantics and clarity that is sufficient for the ecosystem. I'm generally ok with more in this area. I just want to avoid us getting into option-explosion land. |
- Improve SuppressForParametersThatMatchArgumentName to be case-insensitive and ignore underscores - Fix SuppressForParametersThatDifferOnlyBySuffix to work bidirectionally - Add SuppressForParametersThatMatchMemberName option for member access matching - Add SuppressForTargetTypedNew and SuppressForTargetTypedCollectionExpressions options - Add comprehensive tests for all new functionality Co-authored-by: akhera99 <40616383+akhera99@users.noreply.github.com>
- Add necessary imports to test files for InlineHints types - Duplicate helper methods in test classes to handle internal type visibility - Successfully build all modified code and test projects Co-authored-by: akhera99 <40616383+akhera99@users.noreply.github.com>
- Fix comment in NormalizeIdentifier to accurately describe functionality - Use built-in char.IsUpper/char.IsDigit methods instead of manual range checks - Keep both suffix checking methods as they serve different purposes: - ParametersDifferOnlyBySuffix: checks if ALL parameters differ by suffix (e.g., objA, objB) - ParameterDiffersOnlyBySuffix: checks if a single argument/parameter pair differs (e.g., fooBar vs fooBar_) Co-authored-by: akhera99 <40616383+akhera99@users.noreply.github.com>
- Simplify IsUpperAlpha to just use char.IsUpper - Update comment in NormalizeIdentifier to be more specific about which prefixes are handled - Improve comments in IsTargetTyped to clarify intent of target-typing checks - Keep Ordinal string comparison in prefix checks as case sensitivity is intentional there Co-authored-by: akhera99 <40616383+akhera99@users.noreply.github.com>
@CyrusNajmabadi How about a |
|
I like that. It definitely gives us flexibility to adjust things in the future |
|
/pr-val |
|
This PR is from an external author. You must specify a commit hash to trigger this workflow. Please use the format |
|
Failed to trigger the pipeline. Please check the workflow logs for details. |
Inlay hints currently show everywhere with limited options to suppress them when context makes them redundant. This adds four new suppression capabilities to reduce visual noise while preserving hints for ambiguous cases.
Changes
Parameter hints - flexible name matching
SuppressForParametersThatMatchArgumentNamenow ignores case and underscoresfooBarparameter now matches_fooBar,FooBar,FOO_BARargumentsParameter hints - bidirectional suffix matching
SuppressForParametersThatDifferOnlyBySuffixnow works both directionsfooBar↔fooBar_andfooBarX↔fooBarParameter hints - member access matching
SuppressForParametersThatMatchMemberNameType hints - target-typed suppression
SuppressForTargetTypedNew,SuppressForTargetTypedCollectionExpressionsAll new options default to enabled to reduce clutter out-of-the-box.
Implementation notes
NormalizeIdentifier()strips leading_/@and all underscores, then uses case-insensitive comparisonParameterDiffersOnlyBySuffix()handles individual argument/parameter pairs, distinct from existingParametersDifferOnlyBySuffix()which checks if all parameters in a call share the same prefix patternIsTargetTyped()detects variable declarations, assignments, and return statements where type flows from contextWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
kijvsblobprodcus387.vsblob.vsassets.io/usr/share/dotnet/dotnet dotnet build src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj -v minimal(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.