最近在doom-emacs中开启了lsp
,发现lsp-mode在鼠标停在关键字上的提示很多时候是空的,然后试了下tide,发现tide是可以的。
以下是同一个位置打印的日志,typescript-language-server的返回结果是null,而tide和vscode都能正常返回:
typescript-language-server
[Trace - 08:55:22 PM] Sending request 'textDocument/signatureHelp - (196)'.
Params: {
"textDocument": {
"uri": "file:///Users/jadestrong/Documents/JadeStrong/ts-react-app/src/components/demo/HelloHOC.tsx"
},
"position": {
"line": 16,
"character": 15
}
}
[Trace - 08:55:22 PM] Received response 'textDocument/signatureHelp - (196)' in 50ms.
Result: null
tide
Info 208 [20:55:22.744] request:
{"command":"quickinfo-full","seq":"53","arguments":{"file":"/Users/jadestrong/Documents/JadeStrong/ts-react-app/src/components/demo/HelloHOC.tsx","line":17,"offset":16}}
Perf 209 [20:55:22.748] 53::quickinfo-full: elapsed time (in milliseconds) 4.1162
Info 210 [20:55:22.748] response:
{"seq":0,"type":"response","command":"quickinfo-full","request_seq":"53","success":true,"body":{"kind":"function","kindModifiers":"","textSpan":{"start":444,"length":8},"displayParts":[{"text":"function","kind":"keyword"},{"text":" ","kind":"space"},{"text":"HelloHOC","kind":"functionName"},{"text":"<","kind":"punctuation"},{"text":"Greeting","kind":"interfaceName"},{"text":">","kind":"punctuation"},{"text":"(","kind":"punctuation"},{"text":"WrappedComponent","kind":"parameterName"},{"text":":","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"React","kind":"aliasName"},{"text":".","kind":"punctuation"},{"text":"ComponentType","kind":"aliasName"},{"text":"<","kind":"punctuation"},{"text":"Greeting","kind":"interfaceName"},{"text":">","kind":"punctuation"},{"text":")","kind":"punctuation"},{"text":":","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"typeof","kind":"keyword"},{"text":" ","kind":"space"},{"text":"(Anonymous class)","kind":"className"}],"documentation":[]}}
vscode
Info 410 [20:56:47.994] request:
{"seq":77,"type":"request","command":"quickinfo","arguments":{"file":"/Users/jadestrong/Documents/JadeStrong/ts-react-app/src/components/demo/HelloHOC.tsx","line":17,"offset":16}}
Perf 411 [20:56:47.997] 77::quickinfo: elapsed time (in milliseconds) 2.1839
Info 412 [20:56:47.997] response:
{"seq":0,"type":"response","command":"quickinfo","request_seq":77,"success":true,"body":{"kind":"function","kindModifiers":"","start":{"line":17,"offset":16},"end":{"line":17,"offset":24},"displayString":"function HelloHOC<Greeting>(WrappedComponent: React.ComponentType<Greeting>): typeof (Anonymous class)","documentation":"","tags":[]}