[eglot] Server reports (type=1): Inlay Hints request failed. File not opened in the editor.
启动后编辑时得到 eglot 提示
[server-reply] (id:73) ERROR Mon Nov 13 17:00:53 2023:
(:jsonrpc "2.0" :id 73 :error
(:code -32603 :message "Request textDocument/documentHighlight failed with message: The document should be opened first: file:///home/xueshumeng/Workspace/javascript/sample/index.js"))
[internal] (id:73) ERROR Mon Nov 13 17:00:53 2023:
(:message "error ignored, status set (Request textDocument/documentHighlight failed with message: The document should be opened first: file:///home/xueshumeng/Workspace/javascript/sample/index.js)" :id 73 :error -32603)
lsp server 安装在 ~/.npm/typescript-language-server/ 下面
➜ cd ~/.npm/typescript-language-server
➜ npm install typescript-language-server typescript
之后把 typescript-language-server 的 BIN 目录导出到 PATH 变量里
NODE_PACKAGE_HOME=$HOME/.npm
for NODE_PACKAGE in $NODE_PACKAGE_HOME/*; do
NODE_PACKAGE_BIN=$NODE_PACKAGE/node_modules/.bin
if [[ -d $NODE_PACKAGE_BIN ]]
then
PATH=$PATH:$NODE_PACKAGE_BIN
fi
done