- Notifications
You must be signed in to change notification settings - Fork4.2k
Feature/disambiguate using keyword#48898
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Feature/disambiguate using keyword#48898
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/VisualStudio/CSharp/Impl/LanguageService/CSharpHelpContextService.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: CyrusNajmabadi <cyrus.najmabadi@gmail.com>
| if(token.IsKind(SyntaxKind.UsingKeyword)&&token.ParentisUsingStatementSyntax) | ||
| { | ||
| text=Keyword("using-statement"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The docs page this leads to also covers using declarations (using var x = Foo();) so it would be good to get a test and support for that at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I updated the PR to now include using declarations. I only have a simple test for it right now, and it looks like these are disallowed inside places like the expression of an if-statement. Let me know if I should add additional tests beyond simply testing a local declaration.
davidwengier commentedOct 28, 2020
Thanks@TheSench, will wait for the docs PR to be merged, but this looks good to me! |
davidwengier commentedDec 3, 2020
Docs PR was merged! Thanks again for the contribution. |
* upstream/master: (143 commits) Use Unicode for OutputEncoding (dotnet#49721) Fix tests Remove unnecessary parens when converting switch statement ot expression. Fix flaky test Simplify implementation of IsOrInGenericType helper and reduce code duplication. (dotnet#49763) Increase CoreCLR dump information NRT Be resilient to a null-document in the code-folding service. Change cache implementation from dictionary to list Fix APIs for retrieving solution snapshot from Razor, UT (dotnet#49591) Handles optional parameters Feature/disambiguate using keyword (dotnet#48898) Check all overloads when inferring first argument in an invocation with nothing typed Remove optional parameter lint Clean up option handling Remove double blank line Add + update tests Ensure completion and completion resolve handler always pass the same options Change name of telemetry ...
This PR adds a separate
f1_keywordfor the using-statement semantics of theusingkeyword. This allows the F1 help to route to the appropriate page based on the context, rather than having to route to a generic using page. It also updates the logic detecting ausing-staticto also catch the normal using directive, since it already knows at that point and doesn't need to waste time doing other checks before falling through to the using keyword.Fixes part of#48392
Related docs PR:
dotnet/docs#21209