-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Highlighting: improve C# queries #49686
Merged
Merged
Conversation
This file contains 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
Previously, the C# highlighting was missing a lot of identifier tokens and many tokens were getting unexpected SCIP `SyntaxKind`. This PR makes a fairly big change to the queries so that C# highlighting works more as expected, and more consistently with other languges like Java/C++.
tjdevries
approved these changes
Mar 20, 2023
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.
LGTM - low risk change since we're just updating the queries.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.0 5.0
# Navigate to the new working tree
cd .worktrees/backport-5.0
# Create a new branch
git switch --create backport-49686-to-5.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5e2c3e74900a2953ce49dbc57a69a73a00039705
# Push it to GitHub
git push --set-upstream origin backport-49686-to-5.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.0 Then, create a pull request where the |
github-actions
bot
added
backports
failed-backport-to-5.0
release-blocker
Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases
labels
Mar 20, 2023
olafurpg
added a commit
that referenced
this pull request
Mar 20, 2023
Previously, the C# highlighting was missing a lot of identifier tokens and many tokens were getting unexpected SCIP `SyntaxKind`. This PR makes a fairly big change to the queries so that C# highlighting works more as expected, and more consistently with other languges like Java/C++. ![CleanShot 2023-03-20 at 14 19 34@2x](https://user-images.githubusercontent.com/1408093/226350969-ae71cb40-ba71-411d-b433-b3201d9c78c0.png) Updated snapshots. A good place to visually confirm that C# highlighting works as expected is the snapshot testing directory from scip-dotnet https://sourcegraph.test:3443/github.com/sourcegraph/scip-dotnet/-/blob/snapshots/input/syntax/Main/Classes.cs <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> (cherry picked from commit 5e2c3e7)
This was referenced Mar 20, 2023
Closed
olafurpg
added a commit
that referenced
this pull request
Mar 20, 2023
Previously, the C# highlighting was missing a lot of identifier tokens and many tokens were getting unexpected SCIP `SyntaxKind`. This PR makes a fairly big change to the queries so that C# highlighting works more as expected, and more consistently with other languges like Java/C++. ![CleanShot 2023-03-20 at 14 19 34@2x](https://user-images.githubusercontent.com/1408093/226350969-ae71cb40-ba71-411d-b433-b3201d9c78c0.png) Updated snapshots. A good place to visually confirm that C# highlighting works as expected is the snapshot testing directory from scip-dotnet https://sourcegraph.test:3443/github.com/sourcegraph/scip-dotnet/-/blob/snapshots/input/syntax/Main/Classes.cs <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> (cherry picked from commit 5e2c3e7)
olafurpg
added a commit
that referenced
this pull request
Mar 20, 2023
This PR is a manual backport of https://github.com/sourcegraph/sourcegraph/pull/49686 The reason it's a manual backport is because we have landed a non-backport PR that made minor changes to the snapshot testing format. This PR is safe to backport because it only changes C# highlighting queries, not any actual code. We decided it was worth backporting because the C# highlighting improvements are significant and we expect many customers are going to be trying out scip-dotnet, our new C# indexer, over the next quarter. ## Test plan See updated snapshot tests. <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
camdencheek
added
backported-to-5.0
and removed
release-blocker
Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases
failed-backport-to-5.0
labels
May 16, 2023
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.
Previously, the C# highlighting was missing a lot of identifier tokens and many tokens were getting unexpected SCIP
SyntaxKind
. This PR makes a fairly big change to the queries so that C# highlighting works more as expected, and more consistently with other languges like Java/C++.Test plan
Updated snapshots.
A good place to visually confirm that C# highlighting works as expected is the snapshot testing directory from scip-dotnet https://sourcegraph.test:3443/github.com/sourcegraph/scip-dotnet/-/blob/snapshots/input/syntax/Main/Classes.cs