Comments (9)
I don't get your point neither, why didn't you post the issue to helix
instead? That editor is out of our control?
from taplo.
Did you try this config option?
https://taplo.tamasfe.dev/configuration/file.html#schema
from taplo.
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.
from taplo.
Schema will be enabled with filename patterns by default. And why helix
editor's behaviour should be related to taplo?
from taplo.
I still don't get your point. So, I will describe my use case in more detail.
I use helix
to edit a random toml file. It has the below content:
[config_a]
name_1="value1"
name_2 = 4
helix
does support taplo. I check it with Cargo.toml
and it works fine. But for this random toml file, as you can guess from the content, it's just a random file with no schema, and I cannot perform formatting in helix
(using :fmt
command). However, I open the same file in VSCode with Even Better Toml
extension installed, press Shift-Alt-F
and I can format the file.
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 taplo lsp
, the helix
one cannot work without a schema, while the VSCode still works without a schema. What is the difference? How can I make the helix one behaves like the VSCode one?
from taplo.
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 helix
is implemented generally for all languages (it does not have a toml plugin, it doesn't even have plugin system yet), I can't imagine helix
fails to send the request for toml
alone. Which means it's highly likely that the server side, taplo in this case, somehow refutes the request or fails to send the response.
from taplo.
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 helix
to approve that's something wrong with taplo's side.
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.
from taplo.
Found the problem. I got suggestion when looking into the nvim-lspconfig for taplo
. For the lsp to work, we need to configure the lsp root. Both VSCode and NeoVim already set the root for taplo in their plugins. Meanwhile helix
is just barebone without any config and it considers a git project as root. That's why a random file from a random place is ignored.
from taplo.
LSP root config issue.
For those who got the same problem, I was able to fix this by adding this config in languages.toml
[[language]]
name = "toml"
roots = ["."]
from taplo.
Related Issues (20)
- `tags` in samconfig.toml show error HOT 1
- Setting the indentation size in the even better toml extention HOT 3
- Flags falsely on a googleAnalytics ID HOT 4
- Does "Even Better TOML" support Unicode-based keys, such as Chinese characters, parentheses, and underscores? HOT 1
- ERROR initialize:initialize: failed to add schemas from catalog HOT 4
- Links on "Binary Releases" documentation page do not work HOT 1
- Incorrect error in wrangler.toml HOT 2
- Bug: align entries fails when one entry is multiline
- Align keys of array<inline tables>
- Feature Request: Add support for cargo-machete HOT 2
- False positive syntax error when using dotted key syntax HOT 4
- When I create an app.toml file in an arbitrary folder inside my project, it returns an "expo" is a required property error? HOT 1
- Support `taplo` configuration in `pyproject.toml`
- LSP: robust handling of `uri-reference`
- Slow formatting when using @taplo/cli
- How is this VSCode extension aware of the right completions for my Alacritty TOML file? I see something incorrect HOT 2
- reorder_arrays = false is ignored if the key is set to the array. HOT 1
- Complaining about cranelift (shouldn't do it) HOT 1
- Can't keep lines from indenting, even though it is not enabled
- What is it sending to an azure endpoint? HOT 2
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 taplo.