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

Update F1 keywords to disambiguateclass#48506

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

@TheSenchTheSench commentedOct 12, 2020
edited
Loading

This PR makes the f1 keywords for theclass keyword be context-specific. If it appears in a generic constraint clause, it will route to thewhere-generic-type-constraint page, otherwise it will continue to go to the class declaration page.

Fixes part ofdotnet/docs#20799

Related docs PR:
dotnet/docs#21037

@TheSenchTheSench requested a review froma team as acode ownerOctober 12, 2020 00:41
@TheSenchTheSench changed the titleFeature/disambiguate f1 help for class keywordUpdate F1 keywords to disambiguateclassOct 12, 2020
Comment on lines 355 to 372
Copy link
Member

@davidwengierdavidwengierOct 12, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
if(token.IsKind(SyntaxKind.ClassKeyword)){
if(token.ParentisClassOrStructConstraintSyntax){
text=Keyword("classconstraint");
returntrue;
}else{
text=Keyword("class");
returntrue;
}
}
if(token.IsKind(SyntaxKind.ClassKeyword)&&token.ParentisClassOrStructConstraintSyntax)
{
text=Keyword("classconstraint");
returntrue;
}

TheSench reacted with thumbs up emoji

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

can we do the same for struct/new as those are also constraints.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@TheSench feel free to include them in this PR, or not. They are called out indotnet/docs#20799 so we're not going to forget.

They would go to the same file as your current docs PR is changing, so there might be some sense in at least doing that side of things.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Seeing as the build failed due to what appears to be a transient issue, I'll add this and kick off another one. Is there a benefit to creating a new f1_keyword versus just using the existingwhereconstraint_CSharpKeyword one for the constraint form of both of these?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm wondering if we want to introduce a switch ontoken.RawKind here now that the number of special cases has grown a bunch. I'll probably be tackling more of these cases in the next week, so that would be something I consider in the next one, but I'd be interested in direction before I get going on it, if possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this code is C# specific. So you don't need RawKind (you can use Kind()). I wouldn't really do a switch here. I think the code is clear when it handles each case specifically. There's no need for brevity/perf as this will execute once only on hte rare case of someone hitting f1.

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.

Thanks for the extra context.

@jinujosephjinujoseph added Area-IDE CommunityThe pull request was submitted by a contributor who is not a Microsoft employee. labelsOct 12, 2020
@TheSench
Copy link
ContributorAuthor

It looks like I missed some styling issues that got caught in the build. I'll look at those later tonight and get them cleaned up.

@davidwengier
Copy link
Member

Thanks for the contribution. I'll wait fordotnet/docs#21037 to be merged before merging this, feel free to ping me here if it happens and I miss the notification.

@TheSenchTheSenchforce-pushed thefeature/disambiguate-f1-help-for-class-keyword branch from6beaafd tobecfcf8CompareOctober 13, 2020 11:05
@TheSench
Copy link
ContributorAuthor

I'm going to need some help figuring out these build failures. I don't see anything helpful in the logs, aside from the possibility that the tests are timing out:

Running 2 test assemblies in 2 partitions   1 running,  1 queued,  0 completedRoslyn Error: test timeout exceeded, dumping remaining processesCopying ServiceHub logs to F:\workspace\_work\1\s\artifacts\log\Release##[error](NETCORE_ENGINEERING_TELEMETRY=Test) Tests failedCommand failed to execute with exit code 1: F:\workspace\_work\1\s\artifacts\bin\RunTests\Release\net472\RunTests.exe "C:\Users\vsagent\.nuget\packages\xunit.runner.console\2.4.1-pre.build.4059\tools\net472" "-out:F:\workspace\_work\1\s\artifacts\TestResults\Release" "-logs:F:\workspace\_work\1\s\artifacts\log\Release" "-secondaryLogs:F:\workspace\_work\1\s\artifacts\log2\Release" -tfm:net472 -testVsi -xml -timeout:110 -procdumppath:F:\workspace\_work\1\s\.tools\ProcDump F:\workspace\_work\1\s\artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests\Release\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.dll F:\workspace\_work\1\s\artifacts\bin\Microsoft.VisualStudio.LanguageServices.IntegrationTests\Release\net472\Microsoft.VisualStudio.LanguageServices.IntegrationTests.dllSystem.Management.Automation.RuntimeException: Command failed to execute with exit code 1: F:\workspace\_work\1\s\artifacts\bin\RunTests\Release\net472\RunTests.exe "C:\Users\vsagent\.nuget\packages\xunit.runner.console\2.4.1-pre.build.4059\tools\net472" "-out:F:\workspace\_work\1\s\artifacts\TestResults\Release" "-logs:F:\workspace\_work\1\s\artifacts\log\Release" "-secondaryLogs:F:\workspace\_work\1\s\artifacts\log2\Release" -tfm:net472 -testVsi -xml -timeout:110 -procdumppath:F:\workspace\_work\1\s\.tools\ProcDump F:\workspace\_work\1\s\artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests\Release\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.dll F:\workspace\_work\1\s\artifacts\bin\Microsoft.VisualStudio.LanguageServices.IntegrationTests\Release\net472\Microsoft.VisualStudio.LanguageServices.IntegrationTests.dllat Exec-CommandCore, F:\workspace\_work\1\s\eng\build-utils.ps1: line 95at Exec-Console, F:\workspace\_work\1\s\eng\build-utils.ps1: line 164at TestUsingOptimizedRunner, F:\workspace\_work\1\s\eng\build.ps1: line 421at <ScriptBlock>, F:\workspace\_work\1\s\eng\build.ps1: line 648at <ScriptBlock>, F:\workspace\_work\_temp\e207cc64-eae2-44fb-a0b9-2d26d42ca06f.ps1: line 3at <ScriptBlock>, <No file>: line 1Killing running build processes...Killing running build processes...##[error]PowerShell exited with code '1'.

@davidwengier
Copy link
Member

I'm sure its unrelated. I've kicked the integration tests again and will monitor.

Thanks for adding in the extrastruct case too :)

TheSench reacted with thumbs up emoji

@TheSench
Copy link
ContributorAuthor

I'm sure its unrelated. I've kicked the integration tests again and will monitor.

Thanks for adding in the extrastruct case too :)

Build passed this time!

@CyrusNajmabadiCyrusNajmabadi merged commit021b82f intodotnet:masterOct 13, 2020
@ghostghost added this to theNext milestoneOct 13, 2020
@CyrusNajmabadi
Copy link
Member

Thanks!

@TheSenchTheSench deleted the feature/disambiguate-f1-help-for-class-keyword branchOctober 14, 2020 11:33
@allisonchouallisonchou modified the milestones:Next,16.9.P2Nov 24, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@CyrusNajmabadiCyrusNajmabadiCyrusNajmabadi left review comments

@davidwengierdavidwengierdavidwengier 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.P2

Development

Successfully merging this pull request may close these issues.

5 participants

@TheSench@davidwengier@CyrusNajmabadi@jinujoseph@allisonchou

[8]ページ先頭

©2009-2025 Movatter.jp