Open arisudesu opened 3 months ago
Furthermore, the schema selection is tripled.
Duplicate of https://github.com/tamasfe/taplo/issues/395
Additionally, when I change the file extension to .toml, it shows "no schema selected"
This is currently broken, use external LSP in settings. https://github.com/tamasfe/taplo/issues/624#issuecomment-2270463328
Thanks, I subbed to these issues. It is a bit hard to discover them, since their titles are vague.
However, the external LSP doesn't work for me too. Logs from the extension are:
[Info - 19:12:14] Connection to server got closed. Server will restart.
[Error - 19:12:14] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Even Better TOML LSP client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 19:12:14] Connection to server got closed. Server will restart.
[Error - 19:12:14] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Even Better TOML LSP client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 19:12:14] Connection to server got closed. Server will restart.
[Error - 19:12:14] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Even Better TOML LSP client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 19:12:14] Connection to server got closed. Server will restart.
[Error - 19:12:14] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Even Better TOML LSP client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] The Even Better TOML LSP server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 19:12:14] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Even Better TOML LSP client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:12:14] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
I tried taplo-cli latest and taplo-cli@0.8.1.
Did you configure both evenBetterToml.taplo.bundled
and evenBetterToml.taplo.path
(it has to be full path)?
Sure. My settings are:
"evenBetterToml.taplo.bundled": false,
"evenBetterToml.taplo.path": "D:\\RUST\\cargo\\bin\\taplo.exe",
"evenBetterToml.taplo.extraArgs": []
and my taplo is here
> where taplo.exe
D:\RUST\cargo\bin\taplo.exe
> taplo.exe
taplo 0.9.3
USAGE:
taplo [OPTIONS] <SUBCOMMAND>
OPTIONS:
--colors <COLORS> [default: auto] [possible values: auto, always, never]
-h, --help Print help information
--log-spans Enable logging spans
-V, --version Print version information
--verbose Enable a verbose logging format
SUBCOMMANDS:
config Operations with the Taplo config file [aliases: cfg]
format Format TOML documents [aliases: fmt]
get Extract a value from the given TOML document
help Print this message or the help of the given subcommand(s)
lint Lint TOML documents [aliases: check, validate]
lsp Language server operations
I'm rarely on Windows so I can't check right now but can you verify that taplo lsp
works from terminal and eventually try with /
instead of \\
as path separator?
I don't know what taplo is doing in normal conditions, but taplo lsp
works and prints usage:
> taplo lsp
taplo-lsp
Language server operations
USAGE:
taplo lsp [OPTIONS] <SUBCOMMAND>
OPTIONS:
-c, --config <CONFIG> Path to the Taplo configuration file [env: TAPLO_CONFIG=]
--cache-path <CACHE_PATH> Set a cache path
--colors <COLORS> [default: auto] [possible values: auto, always, never]
-h, --help Print help information
--log-spans Enable logging spans
--no-auto-config Do not search for a configuration file
--verbose Enable a verbose logging format
SUBCOMMANDS:
help Print this message or the help of the given subcommand(s)
stdio Run the language server over the standard input and output
tcp Run the language server and listen on a TCP address
However, running taplo lsp tcp
or taplo lsp stdio
(which I presume is operating mode for talking to VSCode), gives no output and the process terminates immediately. I tested on my working machine and in "clean" environment - Windows Sandbox - with the same executable.
Changing slashes from \\ to / doesn't help, same effect.
@arisudesu about this part:
However, running
taplo lsp tcp
ortaplo lsp stdio
(which I presume is operating mode for talking to VSCode), gives no output and the process terminates immediately.
You probably didn't install it with the lsp feature enabled. I had the same issue after installing with cargo and needed to add --features lsp
to fix it. For some reason with that feature enabled they expose the lsp commands and their help normally but just silently exit when you run them... :face_with_diagonal_mouth:
(I have no context on the rest of your issues, sorry, just came across your issue and noticed that part sounded familiar.)
@dbarnett wow! So, it has a lsp
command but it does nothing if feature isn't enabled during build... Surely taplo could report it better.
Okay, now that I know it, I noticed that there is a "taplo-full" builds on the release page. I grabbed taplo-full-windows-x86_64.zip from 0.9.3 and it does start as external LSP. I see its log in LSP output. However, apart from that nothing changed - it still has all the errors described in opening post. Now I wonder if there's more things that I miss to make it work correctly...
Vscode extension doesn't work if file extension is not .toml. Says "this document has been excluded" in the first line and schema selection doesn't work. File contents is Telegraf configuration.
Additionally, when I change the file extension to .toml, it shows "no schema selected", however I have associated any file with "any schema":
Furthermore, the schema selection is tripled.
Extension version is: v0.19.2.