Feature/disambiguate using keyword#48898
Merged
davidwengier merged 7 commits intodotnet:masterfrom Dec 3, 2020
Merged
Conversation
src/VisualStudio/CSharp/Impl/LanguageService/CSharpHelpContextService.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: CyrusNajmabadi <cyrus.najmabadi@gmail.com>
CyrusNajmabadi
approved these changes
Oct 25, 2020
|
|
||
| if (token.IsKind(SyntaxKind.UsingKeyword) && token.Parent is UsingStatementSyntax) | ||
| { | ||
| text = Keyword("using-statement"); |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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
approved these changes
Oct 28, 2020
Member
|
Thanks @TheSench, will wait for the docs PR to be merged, but this looks good to me! |
This was referenced Oct 28, 2020
Member
|
Docs PR was merged! Thanks again for the contribution. |
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Dec 5, 2020
* 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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