-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Implement json serialization/deserialization for LSP json messages. Part 2/N #68990
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
8a5375e
Implement json serialization/deserialization for LSP json messages.
CyrusNajmabadi 99570a1
Merge branch 'main' into lspApis2
CyrusNajmabadi 611c756
Merge remote-tracking branch 'upstream/main' into lspApis2
CyrusNajmabadi 7592fef
lint
CyrusNajmabadi f74a4bc
Lint
CyrusNajmabadi 448194d
Update
CyrusNajmabadi d387fca
Marshalling
CyrusNajmabadi 80ed94e
Marshalling
CyrusNajmabadi 8681f96
Find refs
CyrusNajmabadi e6287b3
Merge remote-tracking branch 'upstream/main' into lspApis2
CyrusNajmabadi c00dde3
Move
CyrusNajmabadi 83226f1
No need for this attribute
CyrusNajmabadi e75a404
Add project ref
CyrusNajmabadi 72de881
editorconfig
CyrusNajmabadi 38f03ff
remove references
CyrusNajmabadi 779f6af
remove unnecessary code
CyrusNajmabadi 0a447ec
Fix tests
CyrusNajmabadi b6d97f2
Rename type
CyrusNajmabadi 31cb874
Add new types in
CyrusNajmabadi aefdc5d
Remove file
CyrusNajmabadi f7d0c33
Merge branch 'lspApis3' into lspApis2
CyrusNajmabadi 2cb528a
Make internal
CyrusNajmabadi 53b4d15
Merge branch 'lspApis3' into lspApis2
CyrusNajmabadi 232ebb1
Merge branch 'main' into lspApis3
CyrusNajmabadi 6215db6
Merge branch 'lspApis3' into lspApis2
CyrusNajmabadi bbc3105
Downstream fallout
CyrusNajmabadi 4ad5db0
Fixes
CyrusNajmabadi fe289fc
Accvessibility
CyrusNajmabadi cb0278c
fixes
CyrusNajmabadi 1ff3c20
fixes
CyrusNajmabadi c22e296
fixes
CyrusNajmabadi 19b6a4e
fixes
CyrusNajmabadi 0c984c0
Fix
CyrusNajmabadi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Linq; | ||
|
||
namespace Microsoft.CodeAnalysis.Extensions; | ||
|
||
internal static class VSEditorLSPExtensions | ||
{ | ||
public static Roslyn.Core.Imaging.ImageId ToLSPImageId(this VisualStudio.Core.Imaging.ImageId imageId) | ||
=> new(imageId.Guid, imageId.Id); | ||
|
||
public static Roslyn.Text.Adornments.ImageElement ToLSPImageElement(this VisualStudio.Text.Adornments.ImageElement imageElement) | ||
=> new(imageElement.ImageId.ToLSPImageId(), imageElement.AutomationName); | ||
|
||
public static Roslyn.Text.Adornments.ClassifiedTextRun ToLSPRun(this VisualStudio.Text.Adornments.ClassifiedTextRun run) | ||
=> new(run.ClassificationTypeName, run.Text, (Roslyn.Text.Adornments.ClassifiedTextRunStyle)run.Style, run.MarkerTagType, run.NavigationAction, run.Tooltip); | ||
|
||
public static Roslyn.Text.Adornments.ClassifiedTextElement ToLSPElement(this VisualStudio.Text.Adornments.ClassifiedTextElement element) | ||
=> new(element.Runs.Select(r => r.ToLSPRun())); | ||
|
||
public static Roslyn.Text.Adornments.ContainerElement ToLSPElement(this VisualStudio.Text.Adornments.ContainerElement element) | ||
=> new((Roslyn.Text.Adornments.ContainerElementStyle)element.Style, element.Elements.Select(ToLSPElement)); | ||
|
||
private static object? ToLSPElement(object? value) | ||
=> value switch | ||
{ | ||
VisualStudio.Core.Imaging.ImageId imageId => ToLSPImageId(imageId), | ||
VisualStudio.Text.Adornments.ImageElement element => ToLSPImageElement(element), | ||
VisualStudio.Text.Adornments.ContainerElement element => ToLSPElement(element), | ||
VisualStudio.Text.Adornments.ClassifiedTextElement element => ToLSPElement(element), | ||
VisualStudio.Text.Adornments.ClassifiedTextRun run => ToLSPRun(run), | ||
_ => value, | ||
}; | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
a lot of fallout from switching from Microsoft.VisualStudio.LanguageServer.Protocol to Roslyn.LanguageServer.Protocol.