LanguageServer.NET icon indicating copy to clipboard operation
LanguageServer.NET copied to clipboard

completion 不能及时触发

Open bluedoom opened this issue 5 years ago • 3 comments

问题出现在 输入"."之后,没有反应,然后键盘输入 crtl + space 无限loading,之后键盘输入esc关闭loading框 再输入crtl + space 正常弹出提示。 更换为VS Code官方TypeScript实现的LanguageServer无此问题。

bluedoom avatar Jan 12 '21 10:01 bluedoom

请问你可以提供复现代码吗?或者可以试试存储库里的DemoLanguageService有没有类似问题。

CXuesong avatar Jan 12 '21 10:01 CXuesong

就是用的库里面的DemoLanguageService

bluedoom avatar Jan 12 '21 12:01 bluedoom

看了一下JSON RPC消息(\DemoLanguageServer\bin\Debug\netcoreapp3.1\messages-*.log),textDocument/completion请求的响应是正常返回的,但LSP客户端在收到响应后不知为何立即取消了请求

2021-01-16 18:17:08.884 > {"id":10,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///.../_private/test.demo"},"position":{"line":0,"character":3},"context":{"triggerKind":1}},"jsonrpc":"2.0"}
2021-01-16 18:17:08.885 < {"id":10,"result":{"isIncomplete":false,"items":[{"label":".NET","kind":14,"detail":"Keyword1","documentation":{"kind":"markdown","value":"Short for **.NET Framework**, a software framework by Microsoft (possibly its subsets) or later open source .NET Core."},"sortText":null,"filterText":null,"insertText":null,"insertTextFormat":1,"textEdit":null,"additionalTextEdits":null,"commitCharacters":null,"command":null,"data":null},{"label":".NET Standard","kind":14,"detail":"Keyword2","documentation":{"kind":"plaintext","value":"The .NET Standard is a formal specification of .NET APIs that are intended to be available on all .NET runtimes."},"sortText":null,"filterText":null,"insertText":null,"insertTextFormat":1,"textEdit":null,"additionalTextEdits":null,"commitCharacters":null,"command":null,"data":null},{"label":".NET Framework","kind":14,"detail":"Keyword3","documentation":{"kind":"plaintext","value":".NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows."},"sortText":null,"filterText":null,"insertText":null,"insertTextFormat":1,"textEdit":null,"additionalTextEdits":null,"commitCharacters":null,"command":null,"data":null}]},"jsonrpc":"2.0"}
2021-01-16 18:17:08.886 > {"method":"$/cancelRequest","params":{"id":10},"jsonrpc":"2.0"}

虽然不确定根本原因,但升级vscode-languageclient到7.0.0之后就没有这个问题了。我已经把修改推送上来了,请你在本地试一下。别忘了在Client\VsCode文件夹下面重新安装一遍依赖项(yarn)。

CXuesong avatar Jan 16 '21 10:01 CXuesong