What Should I Do If the LSP Service Is Unavailable?
Symptom
After the local LSP function is enabled and an LSP-related tool is invoked, the agent displays a message indicating that the LSP service is currently unavailable.
Cause Analysis
The LSP server fails to be downloaded.
Solution
If the log contains failed to install, the LSP server of the corresponding language fails to be downloaded or installed. Perform the following steps to locate and manually rectify the fault:
- Go to the log directory %USERPROFILE%/.codeartsdoer/cli-data/log.
- Find the latest log and search for keywords.
- Locate the log file.
In the log directory, find the .log file starting with kernel-codeartsdoer-incognito (usually containing a timestamp or random characters). You are advised to sort the files by modification time and select the latest file.
- Open the log file and search for keyword failed to install.
- If it exists, the corresponding LSP service fails to be downloaded. Go to 3.
- If it does not exist, you can submit a ticket to get help from Huawei Cloud customer service.
- Locate the log file.
- Manually install the LSP service package and specify the startup path.
- Obtain and install the LSP package for the corresponding language.
Download the LSP server package for the programming language you are using (such as Python, Java, or Go) and install it locally.
- Go to the %USERPROFILE%/.codeartsdoer directory and configure the startup path in the codearts_cli.json file.
In the configuration file, add or modify the lsp field to point to the path of the LSP executable file that you manually installed.
{ "$schema": "https://opencode.ai/config.json", "lsp": {} }
Change the lsp field in the configuration file to the key corresponding to the LSP server you are using. Currently, CodeArts Agent supports the LSP service for only four languages: Java, TypeScript, Go, and Python. The keys for these languages are as follows: jdtls for Java, typescript for TypeScript, gopls for Go, and pyright for Python.
The following uses TypeScript as an example:{ "$schema": "https://opencode.ai/config.json", "typescript": { "command": [ "Local-download-path/typescript-language-server", "--stdio" ], "extensions": [ ".ts", ".js" ] } } - Save the file, restart CodeArts Agent CLI, and execute the previous task again. Check whether the fault is rectified.
- If the fault is rectified, no further action is required.
- If the issue persists, submit a service ticket to get help from Huawei Cloud customer service.
- Obtain and install the LSP package for the corresponding language.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot