-
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
Send back icons for FAR via LSP #47882
Send back icons for FAR via LSP #47882
Conversation
src/Features/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs
Outdated
Show resolved
Hide resolved
...tudio/Xaml/Impl/Implementation/LanguageServer/Handler/Completion/CompletionResolveHandler.cs
Outdated
Show resolved
Hide resolved
src/Features/LanguageServer/Protocol/Extensions/ProtocolConversions.cs
Outdated
Show resolved
Hide resolved
Retargeting this to 16.8, FYI @jinujoseph |
@dibarbet should this be targeting a different branch? I noticed you mentioned Cyrus' PR should be retargeted, and that one and this one will now have conflicts, but they won't show up until a later merge. |
@davidwengier I think it should target release/dev16.8-vs-deps since we're moving the editor packages to 16.8. Once 16.8 ships we'll merge the 16.8-vs-deps branch back into non-vs-deps |
ef7b160
to
0b60e89
Compare
a9802d5
to
9f10b94
Compare
src/Workspaces/Remote/ServiceHub/Services/LanguageServer/LanguageServer.cs
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Implementation/LanguageClient/InProcLanguageServer.cs
Outdated
Show resolved
Hide resolved
@@ -423,7 +423,7 @@ static DiagnosticData CreateMockDiagnosticDataWithMappedLocation(Document docume | |||
var diagnostic = Diagnostic.Create(descriptor, location); | |||
return new DiagnosticData(diagnostic.Id, | |||
diagnostic.Descriptor.Category, | |||
null, | |||
message: "", |
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.
See earlier question: are we sure we don't have to deal with diagnostics with no message?
src/Features/LanguageServer/ProtocolUnitTests/References/FindAllReferencesHandlerTests.cs
Outdated
Show resolved
Hide resolved
@@ -78,7 +81,7 @@ void M2() | |||
Assert.Equal("M", results[1].ContainingMember); | |||
Assert.Equal("M2", results[3].ContainingMember); | |||
|
|||
AssertValidDefinitionProperties(results, 0); | |||
AssertValidDefinitionProperties(results, 0, Glyph.FieldPublic); |
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.
Do we want some test for something other than FieldPublic?
{ | ||
DisplayText = text, | ||
TextDocument = requestParameters.TextDocument, | ||
Position = requestParameters.Position | ||
}, | ||
}), | ||
Icon = tags != null ? new ImageElement(tags.ToImmutableArray().GetFirstGlyph().GetImageId()) : null, |
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.
Not using tags.ToImmutableArray().GetFirstGlyph().GetImageElement()? You added the extension method... 😄
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.
🤦♂️
I think I need to start this PR again.. its been rebased so many times to different branches I don't even know what is real any more
@@ -51,6 +51,11 @@ internal class CompletionHandler : IRequestHandler<LSP.CompletionParams, LSP.Com | |||
return null; | |||
} | |||
|
|||
if (request.Context?.TriggerCharacter == null) | |||
{ | |||
return null; |
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.
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.
Also, to be clear, Razor translates the LSP platform's requests into spec abiding LSP requests which ends up hitting this call path. If you checked this in it'd stop returning C# identifier completions in Razor scenarios 😢
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.
I think for now we can just match the spec and say invoked if we get null. If we actually get null, this will result in completions coming up unexpectedly (as invoked is generally more aggressive). But VS is currently passing the trigger char 'incorrectly' so we'll only hit this in Razor right now.
Then we can followup with a longterm fix from https://github.com/microsoft/ms-lsp/issues/57#issuecomment-703863301 (probably some kind of new property)
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.
I've updated the PR to what I believe is spec-compliant behaviour, specifically in 0f09454
(#47882). PTAL.
@@ -41,6 +41,12 @@ public async Task<LSP.VSReferenceItem[]> HandleRequestAsync(ReferenceParams refe | |||
return Array.Empty<LSP.VSReferenceItem>(); | |||
} | |||
|
|||
// We only support streaming results back, so no point doing any work if the client doesn't | |||
if (referenceParams.PartialResultToken == null) |
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.
Once pull diagnostics goes in we should switch this to use the progress implementation there.
Filed #48350
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.
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.
Woops, closed mine as dupe!
AssertValidDefinitionProperties(results, 0, Glyph.FieldPublic); | ||
} | ||
|
||
[WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/43063")] |
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.
does this need to be skipped still?
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.
I can't see the build results in the linked issue to see why they failed, but with the handler only supporting streaming I can't see how they ever passed, so was planning on unskipping when adding non-streaming support.
Assert.Equal(definitionId, referenceItems[i].DefinitionId); | ||
Assert.NotEqual(definitionId, referenceItems[i].Id); | ||
} | ||
} | ||
|
||
private sealed class ProgressCollector<T> : IProgress<object> |
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.
Making a note here to switch this as well in #48350
Hello @davidwengier! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
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.
Auto-approval
Fixes AB#1178452
Commit-by-commit makes sense here, as most of the work was in responding to nullability changes in Microsoft.VisualStudio.LangaugeServer.Protocol.
Thanks Sam for the first commit :D