Comments (3)
Thanks for reporting! This isn't an issue with SchemaStore.nvim, but it is an important behavior that I should describe in the documentation.
This is due to the way jsonls
handles its configuration, which is a bit counter-intuitive IMO. It seems that if you pass settings = { json = { ... } }
, jsonls
treats any unspecified option as false
, rather than using the default value that would be used if you didn't pass any settings. The option that is causing your issue is validate.enable
. To fix this, you can explicitly enable the validate
option:
nvim_lsp.jsonls.setup({
on_attach = on_attach,
capabilities = capabilities,
settings = {
json = {
validate = { enable = true },
schemas = require("schemastore").json.schemas(),
},
},
})
from schemastore.nvim.
Ah, that's so helpful, thank you! I definitely agree that it's counter-intuitive to flip default settings when another setting is changed.. But that definitely addresses the issue on my end. Again, much appreciated :)
from schemastore.nvim.
For reference, here is the jsonls
code causing this issue: https://github.com/microsoft/vscode/blob/6fef251f8f0e9f74b7adb4ed310e35eabb97afdf/extensions/json-language-features/server/src/jsonServer.ts#L230-L239
validateEnabled
is true
by default, but if any of the settings are changed, it defaults to false
.
If you wanted, you could open an issue there and suggest that the default values should be kept if the settings doesn't include a certain key. They have over 6k open issues, though, so I have my doubts that it would be fixed any time soon.
from schemastore.nvim.
Related Issues (15)
- Added link in neovim-awesome HOT 1
- Error running config for nvim-lspconfig: /home/kricss/.config/nvim/lua/config/lsp/installer.lua:9: module 'schemastore' not found:
- Is there any log? HOT 2
- OpenAPI schemas HOT 2
- Can this be used with .js form of .json files? HOT 2
- Get current schema for buffer HOT 2
- Broken links in hover window due to \ being printed HOT 2
- Schema versions HOT 1
- Extend for yaml / yml HOT 2
- Breaking Changes
- Support for tsconfig.*.json HOT 4
- now.json seems to be deprecated HOT 4
- Using local schema repo HOT 10
- support yaml 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 schemastore.nvim.