Code Monkey home page Code Monkey logo

Comments (12)

egyptianbman avatar egyptianbman commented on August 11, 2024 10

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.

daogilvie avatar daogilvie commented on August 11, 2024 3

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.

dubiousdavid avatar dubiousdavid commented on August 11, 2024 2

The solution for me was to :CocConfig and add:

{
  "yaml.schemaStore.enable": false,
  "yaml.schemas": {}
}

from coc-yaml.

windowsrefund avatar windowsrefund commented on August 11, 2024 1

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.

chemzqm avatar chemzqm commented on August 11, 2024

Might be fixed on latest coc-yaml, also checkout the verbose output from your language server.

from coc-yaml.

bwright1558 avatar bwright1558 commented on August 11, 2024

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.

chemzqm avatar chemzqm commented on August 11, 2024

Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

from coc-yaml.

bwright1558 avatar bwright1558 commented on August 11, 2024

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.

egyptianbman avatar egyptianbman commented on August 11, 2024

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.

bombillazo avatar bombillazo commented on August 11, 2024

Any solution to ignoring the Deployer Recipe schema?

from coc-yaml.

bombillazo avatar bombillazo commented on August 11, 2024

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.

chemzqm avatar chemzqm commented on August 11, 2024

There is yaml.selectSchema command to choose another schema

from coc-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.