Comments (5)
No problem, I added some logging at the top of the onStdout
function...
function onStdout(filetype)
return function (text)
micro.Log("In onStdout.function, text=<<<" .. text .. ">>>")
My test.js
file is:
unction f() {
}
(Deliberately broken so I can quickly see if the language server reports an error)
My settings.json
is:
{
"lsp.ignoreTriggerCharacters": "completion,signature",
"lsp.server": "cn=clangd,python=pyls,typescript=typescript-language-server --stdio,javascript=typescript-language-server --stdio",
"lsp.tabcompletion": true,
"tabstospaces": true
}
When I run micro -debug test.js
, log.txt
is:
2024/04/30 22:49:55 Micro started
2024/04/30 22:49:55 ONBUFFEROPEN unknown
2024/04/30 22:49:55 ONBUFFEROPEN unknown
2024/04/30 22:49:55 ONBUFFEROPEN javascript
2024/04/30 22:49:55 Server Options map[1:cn=clangd 2:python=pyls 3:typescript=typescript-language-server --stdio 4:javascript=typescript-language-server --stdio 5:python=pylsp 6:go=gopls 7:typescript=deno lsp 8:javascript=deno lsp 9:markdown=deno lsp 10:json=deno lsp 11:jsonc=deno lsp 12:rust=rust-analyzer 13:lua=lua-lsp 14:c++=clangd]
2024/04/30 22:49:55 Starting server javascript
2024/04/30 22:49:55 javascript>>> initialize
2024/04/30 22:49:55 exec: "micro-clip": executable file not found in $PATH;Wayland display not found;exec: "xclip": executable file not found in $PATH;exec: "xsel": executable file not found in $PATH;exec: "powershell.exe": executable file not found in $PATH;exec: "termux-clipboard-get": executable file not found in $PATH; or change 'clipboard' option
2024/04/30 22:49:56 In onStdout.function, text=<<<Content-Length: 212
>>>
2024/04/30 22:49:56 In onStdout.function, text=<<<{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Using Typescript version (bundled) 5.4.5 from path \"/usr/local/#######################/lib/node_modules/typescript/lib/tsserver.js\""}}Content-Length: 1554
{"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"triggerCharacters":[".","\"","'","/","@","<"],"resolveProvider":true},"codeActionProvider":true,"codeLensProvider":{"resolveProvider":true},"definitionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["_typescript.applyWorkspaceEdit","_typescript.applyCodeAction","_typescript.applyRefactoring","_typescript.configurePlugin","_typescript.organizeImports","_typescript.applyRenameFile","_typescript.goToSourceDefinition"]},"hoverProvider":true,"inlayHintProvider":true,"linkedEditingRangeProvider":false,"renameProvider":true,"referencesProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",",","<"],"retriggerCharacters":[")"]},"workspaceSymbolProvider":true,"implementationProvider":true,"typeDefinitionProvider":true,"foldingRangeProvider":true,"semanticTokensProvider":{"documentSelector":null,"legend":{"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"]},"full":true,"range":true},"workspace":{"fileOperations":{"willRename":{"filters":[{"scheme":"file","pattern":{"glob":"**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}","matches":"file"}},{"scheme":"file","pattern":{"glob":"**","matches":"folder"}}]}}}}}}>>>
2024/04/30 22:49:56 javascript <<< window/logMessage
2024/04/30 22:49:56 Using Typescript version (bundled) 5.4.5 from path "/usr/local/#######################/lib/node_modules/typescript/lib/tsserver.js"
As you can see, the text
value that starts with {"jsonrpc":"2.0","method":"window/logMessage"
contains a message body plus the content-length and body of the next message.
$ micro -version
Version: 2.0.13
Commit hash: 68d88b57
Compiled on October 21, 2023
I'm running the micro-plugin-lsp
that I git-cloned earlier today.
The OS is Debian Bookworm.
I hope this helps, please let me know if you'd like me to try anything else.
from micro-plugin-lsp.
Can you provide more detail on this? What's the first message and what is the second one? I tried to reproduce it but so far haven't come across this problem.
from micro-plugin-lsp.
Thank you! This helps a lot! I see where the issue comes from: essentially the onStdout function is assuming that the command is either incomplete or ends with a }
. Here neither is really true.
I think I can work with this.
Thanks again!
from micro-plugin-lsp.
I pushed a quick change for this on master, can you check if it works for you?
from micro-plugin-lsp.
My pleasure!
Thanks for the super-fast fix, it works for me!
from micro-plugin-lsp.
Related Issues (20)
- `rust-analyser` appears to work fine HOT 1
- Doesn't initialize when opening file from filemanager HOT 3
- Keyboard shortcuts not working on Mac HOT 2
- How to set up julia language server HOT 8
- PHP support is working HOT 2
- format on save should be false by default HOT 2
- Auto completion is strange HOT 1
- How to do clean uninstall? HOT 1
- Proper set-up for the plugin HOT 1
- Using zk lsp, go to definition fails if there are spaces in filename HOT 2
- How to use micro-plugin-lsp for Java HOT 3
- Key Bindings not working on Mac HOT 2
- doesn't work with dart HOT 1
- Big file is freeze the micro for a while HOT 1
- Trying csharp-ls
- Exception in onStdout()
- How i can check if there is errors?
- Support C with clangd
- feature request: support LSP standard workspace/configuration for server configurations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro-plugin-lsp.