manateelazycat / lsp-bridge

A blazingly fast LSP client for Emacs
GNU General Public License v3.0
1.35k stars 197 forks source link

When I open the vue project, ts doesn't recognize my directory #955

Closed CnsMaple closed 1 month ago

CnsMaple commented 1 month ago

This is the log. Also there are no complements. I use Windows

Recv message (error): { "jsonrpc": "2.0", "id": 34626, "error": { "code": -32603, "message": "Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in \"%USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib\"" } } Eval in Emacs: (message '"[LSP-Bridge] Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in \"%USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib\"") ERROR:epc:ReturnError([Symbol('error'), 'Not enough arguments for format string']

CnsMaple commented 1 month ago

Should it be looking for node_modules\typescript\lib in my root directory?

manateelazycat commented 1 month ago

https://github.com/manateelazycat/lsp-bridge/blob/2f59043c21c3f1a560e30352dd964549fadf6797/langserver/volar_windows.json#L8

lsp-bridge looking for typescript's tsdk at %USERPROFILE%\AppData\Roaming\npm\node_modules\typescript\lib

You need set env USERPROFILE first, make sure lsp-bridge can found it, if not, you need fork volar_windows.json and setup your own config

CnsMaple commented 1 month ago

Sorry, I already have USERPROFILE but it still does this, how is volar_windows.json configured, I didn't find any documentation about it? Is it directly in the root directory of the project?

manateelazycat commented 1 month ago

Sorry, I already have USERPROFILE but it still does this, how is volar_windows.json configured, I didn't find any documentation about it? Is it directly in the root directory of the project?

https://github.com/manateelazycat/lsp-bridge?tab=readme-ov-file#customize-language-server-configuration-file

CnsMaple commented 1 month ago

It worked. Thanks.