Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

@TheSench
Copy link
Contributor

This PR adds a separatef1_keyword for the using-statement semantics of theusing keyword. 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-static to 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

Co-authored-by: CyrusNajmabadi <cyrus.najmabadi@gmail.com>

if(token.IsKind(SyntaxKind.UsingKeyword)&&token.ParentisUsingStatementSyntax)
{
text=Keyword("using-statement");
Copy link
Member

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.

TheSench reacted with thumbs up emoji
Copy link
ContributorAuthor

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.

@jinujosephjinujoseph added the CommunityThe pull request was submitted by a contributor who is not a Microsoft employee. labelOct 26, 2020
@davidwengier
Copy link
Member

Thanks@TheSench, will wait for the docs PR to be merged, but this looks good to me!

@davidwengier
Copy link
Member

Docs PR was merged! Thanks again for the contribution.

@davidwengierdavidwengier merged commit85aa538 intodotnet:masterDec 3, 2020
@ghostghost added this to theNext milestoneDec 3, 2020
333fred added a commit to 333fred/roslyn that referenced this pull requestDec 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  ...
@TheSenchTheSench deleted the feature/disambiguate-using-keyword branchDecember 6, 2020 16:37
@dibarbetdibarbet modified the milestones:Next,16.9.P3Dec 19, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@davidwengierdavidwengierdavidwengier approved these changes

@CyrusNajmabadiCyrusNajmabadiCyrusNajmabadi approved these changes

Assignees

@davidwengierdavidwengier

Labels

Area-IDECommunityThe pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Milestone

16.9.P3

Development

Successfully merging this pull request may close these issues.

6 participants

@TheSench@davidwengier@CyrusNajmabadi@dibarbet@jinujoseph@Dotnet-GitSync-Bot

[8]ページ先頭

©2009-2025 Movatter.jp