Comments (12)
This seems to be an issue with how https://www.schemastore.org/api/json/catalog.json is parsed.
GitHub Workflow
has .github/workflows/**.yml
defined but if your file ends in deploy.yml
, it's caught first by Deployer Recipe
from coc-yaml.
Appreciate this issue has been open for a while, found it whilst googling as I have the same problem.
I have a GCP cloudbuild.yaml
file that I just could not get the LSP to point the right schema at, because it ended in build.yaml
it kept pointing the hammerkit schema at it. ¯_(ツ)_/¯
I am just adding that the latest release of the language server has nothing about this in their changelog so I suspect it's not been fixed. In any case, I have found a workaround that suits me:
I disable the schema store in my global config: "yaml.schemaStore.enable": false
Then do the mapping as normal in local:
"yaml.schemas": {
"http://json.schemastore.org/cloudbuild": ["cloudbuild.yaml"]
}
Hope this helps anyone else who might still have the issue.
from coc-yaml.
The solution for me was to :CocConfig
and add:
{
"yaml.schemaStore.enable": false,
"yaml.schemas": {}
}
from coc-yaml.
Confirmed this to be an issue with the following versions
coc-yaml 1.3.0
vim: NVIM v0.4.4
node: v14.15.1
coc.nvim: 0.0.80-7642d33d6
from coc-yaml.
Might be fixed on latest coc-yaml, also checkout the verbose output from your language server.
from coc-yaml.
Updated to latest coc-yaml. Problem still occurs.
To duplicate, create a file named test-deploy.yml
with the following contents:
version: v1.0
With this, coc-yaml will flag version
as invalid using the yaml-schema mentioned in this issue.
What's funny is when I rename the file to deploy-test.yml
. Using this filename, coc-yaml does not complain.
Seems like coc-yaml is trying to guess and download a yaml schema based on the last word in the filename.
from coc-yaml.
Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel
from coc-yaml.
Here's the output from the yaml LSP output channel:
[Trace - 11:09:38 AM] Sending request 'initialize - (0)'.
Params: {
"processId": 22987,
"rootPath": "/home/stuff/lsp-testing",
"rootUri": "file:///home/stuff/lsp-testing",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional"
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"tagSupport": {
"valueSet": [
1
]
}
},
"executeCommand": {
"dynamicRegistration": true
},
"configuration": true,
"workspaceFolders": true
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false,
"tagSupport": {
"valueSet": [
1,
2
]
}
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true
},
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
}
}
},
"definition": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true,
"tagSupport": {
"valueSet": [
1
]
}
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
}
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"typeDefinition": {
"dynamicRegistration": true
},
"implementation": {
"dynamicRegistration": true
},
"declaration": {
"dynamicRegistration": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true
},
"selectionRange": {
"dynamicRegistration": true
}
},
"window": {
"workDoneProgress": true
}
},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///home/stuff/lsp-testing",
"name": "Desktop"
}
],
"clientInfo": {
"name": "coc.nvim",
"version": "0.0.79"
}
}
[Trace - 11:09:39 AM] Received response 'initialize - (0)' in 196ms.
Result: {
"capabilities": {
"textDocumentSync": 1,
"completionProvider": {
"resolveProvider": false
},
"hoverProvider": true,
"documentSymbolProvider": true,
"documentFormattingProvider": false,
"documentRangeFormattingProvider": false,
"documentLinkProvider": {},
"workspace": {
"workspaceFolders": {
"changeNotifications": true,
"supported": true
}
}
}
}
[Trace - 11:09:39 AM] Sending notification 'initialized'.
Params: {}
[Trace - 11:09:39 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
"settings": {
"yaml": {
"execArgv": [
"--nolazy",
"--inspect-brk=6045"
],
"trace": {
"server": "verbose"
},
"schemas": {},
"format": {
"enable": false,
"singleQuote": false,
"bracketSpacing": true,
"proseWrap": "preserve"
},
"validate": true,
"hover": true,
"completion": true,
"customTags": []
},
"http": {
"proxyStrictSSL": true
},
"[yaml]": {}
}
}
[Trace - 11:09:39 AM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///home/stuff/lsp-testing/test-deploy.yml",
"languageId": "yaml",
"version": 1,
"text": "version: v1.0\n"
}
}
[Trace - 11:09:39 AM] Sending notification 'json/schemaAssociations'.
Params: []
[Trace - 11:09:39 AM] Sending notification 'yaml/registerCustomSchemaRequest'.
No parameters provided.
[Trace - 11:09:39 AM] Sending notification 'yaml/registerVSCodeContentRequest'.
No parameters provided.
[Trace - 11:09:39 AM] Received request 'client/registerCapability - (0)'.
Params: {
"registrations": [
{
"id": "96e76749-c1b1-4379-8d36-219c037b8659",
"method": "workspace/didChangeWorkspaceFolders",
"registerOptions": {}
}
]
}
[Trace - 11:09:39 AM] Sending response 'client/registerCapability - (0)'. Processing request took 1ms
No result returned.
[Trace - 11:09:39 AM] Received request 'custom/schema/request - (1)'.
Params: "file:///home/stuff/lsp-testing/test-deploy.yml"
[Trace - 11:09:39 AM] Sending response 'custom/schema/request - (1)'. Processing request took 0ms
Result: []
[Trace - 11:09:39 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/stuff/lsp-testing/test-deploy.yml",
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 7
}
},
"message": "Property version is not allowed.",
"severity": 1,
"source": "yaml-schema: https://raw.githubusercontent.com/deployphp/deployer/master/src/schema.json"
}
]
}
This is my coc-settings.json
file:
{
"yaml.trace.server": "verbose"
}
from coc-yaml.
This is happening for me as well, file name build-and-deploy.yml
. This is a python project, the file is a github actions file.
coc: 0.0.80
coc-yaml: 1.3.0
node: v14.15.5
nvim: NVIM v0.4.4
from coc-yaml.
Any solution to ignoring the Deployer Recipe
schema?
from coc-yaml.
My "solution" was to add this as a header to all my GitHub Actions workflow files... :/
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
from coc-yaml.
There is yaml.selectSchema
command to choose another schema
from coc-yaml.
Related Issues (20)
- completion for yaml is partially working HOT 2
- Can a license be added?
- `yaml.selectSchema` command should have "no schema" as an option HOT 5
- Some schemas missing in selectSchema list
- How I can change version kubernetes schema from 1.22.4 to another HOT 9
- No file not starting language server HOT 1
- JSON schemas with a `required` attribute cause `coc-yaml` to break the LSP contract on `textDocument/completion` request HOT 1
- How do I configure a schema that uses a "bundle" format? HOT 4
- coc-yaml cannot resolve $ref for ansiblem.json schema HOT 3
- formatting not respecting yaml spec 1.2 for Collections HOT 4
- about docker-compose.yml HOT 2
- docker-compose HOT 1
- Add a command to go to the schema for the current file HOT 1
- Show type in hover HOT 4
- Load schema from file path
- switch schema for kubernetes HOT 3
- Cannot get yaml-language-server to start HOT 1
- [question] How to update json schema store's schemas? HOT 1
- How to disable "yaml.validate" for a particular folder as opposed to globally? HOT 1
- Allow disabeling the language server for some file patterns
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 coc-yaml.