-
Notifications
You must be signed in to change notification settings - Fork 325
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
Outline and CodeActions don't show up if the LSP response has fields with null values #740
Comments
From a specification point of view The same is true for the command in the code action. |
@dbaeumer thanks for the explanation. Then I see only one issue. the i.e., This JSON still fails. The only null here is on the version field and it should be valid as per spec. {
"title": "Extract expression into function 'func_njmjvxyh'",
"kind": "refactor.extract",
"edit": {
"documentChanges": [
{
"textDocument": {
"uri": "file:///c:/GIT/repro/lsptest/tests/test_math.py",
"version": null
},
"edits": [
{
"range": {
"start": {
"line": 18,
"character": 8
},
"end": {
"line": 18,
"character": 8
}
},
"newText": "func_njmjvxyh(self):\n \r\n return \n\n def "
},
{
"range": {
"start": {
"line": 19,
"character": 12
},
"end": {
"line": 19,
"character": 14
}
},
"newText": " = self.func_njmjvxyh()\n"
}
]
}
]
},
} |
@karthiknadig can you explain what you mean with 'it fails'. The VS Code LSP client ignores that value anyways because VS Code has no support for it. https://github.com/microsoft/vscode-languageserver-node/blob/master/client/src/common/protocolConverter.ts#L954 |
This works as expected in my testbed here: https://github.com/microsoft/vscode-languageserver-node/blob/master/testbed/server/src/server.ts#L416 Do you have more details. A repository I can clone that demos this. |
I will share a VSIX with the repro for this. It may take a day or two. |
@dbaeumer this is working as you have explained. In my repro case I was removing |
OK. Great to hear that you could fix it. |
Issue Type: Bug
A typical DocumentSymbol in response to documentSymbol request currently looks like this:
Notice the
"detail": null
, looks like VS Code does not like that. Outline does not show up in VS Code UI when"detail": null
. Replacing the"detail": null
with"detail": ""
gets the Outline view to show up. That seems to suggest that the client is strict about thenull
field. I am not sure that the spec suggests that optional fields cannot be represented bynull
values. It seems like LS client could be lenient about this.Similar issue occurs with CodeAction:
VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z)
OS version: Windows_NT x64 10.0.19041
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (15)
A/B Experiments
Related: openlawlibrary/pygls#145
The text was updated successfully, but these errors were encountered: