-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taplo lsp abandons formating and diagnostic if it cannot find a schema #580
Comments
Did you try this config option? |
My file does not have any schema. The point is formatting and basic toml syntax diagnosis (something like brackets not matching...) shouldn't need a schema. |
Schema will be enabled with filename patterns by default. And why |
I still don't get your point. So, I will describe my use case in more detail. I use [config_a]
name_1="value1"
name_2 = 4
What's more, I intentionally create a syntax error like below [config_a]
name_1="value1"
name_2 =
4 I open the file in helix, and there's no error message. I open the file in VSCode, and it says there's an error. I hope now you can understand what I'm trying to say. Even both editors use the same |
I don't get your point neither, why didn't you post the issue to |
My gut told me this is an issue on taplo side. From my understanding, in LSP, to do formatting, the editor sends a request along with the current code to the LSP server, and the server sends a response back with the formatted code. Since the LSP logic in |
It requires https://github.com/helix-editor/helix's contributors to debug in depth then. As you found, it worked for VSCode extension, so you still need to reproduce without The point is always: why it's taplo's issue instead of helix's, so if you can reproduce it with a failing test case, that would be great. |
Found the problem. I got suggestion when looking into the nvim-lspconfig for |
LSP root config issue. For those who got the same problem, I was able to fix this by adding this config in [[language]]
name = "toml"
roots = ["."] |
FYI here is how to solve the problem in Neovim: https://www.reddit.com/r/neovim/comments/1fkprp5/how_to_properly_setup_lspconfig_for_toml_files/ The key is that by default, Taplo looks for a git repository so if you are not within one, you will get the |
Unfortunately Example: cd ~/Desktop/
# doc excluded
hx ~/.config/helix/languages.toml
cd ~/
# works!
hx .config/helix/languages.toml |
I use
taplo
with the helix editor. Upon opening a toml file, there's only one message at the top: "this document has been excluded". I guess because it cannot find the schema. That is fine. But I cannot perform formatting for the document, and even if there's toml syntax errors, the taplo lsp does not give any warning.I cross-checked with VSCode "even better toml" extension and everything works fine in VSCode. What causes the difference in behavior even though both editors use the same taplo lsp?
The text was updated successfully, but these errors were encountered: