neoclide / coc-yaml

Yaml language server extension for coc.nvim
MIT License
248 stars 23 forks source link

.gitlab-ci schema not working #45

Closed Renerick closed 3 years ago

Renerick commented 3 years ago

I have these lines in my coc-settings.json

"https://json.schemastore.org/gitlab-ci.json": [
    "*gitlab-ci*"
]

But the plugin (or LSP) is ignoring them, I have no completion or validation in any of my .gitlab-ci.yml or .gitlab-ci.yaml files.

[Trace - 2:56:12 PM] Sending request 'textDocument/completion - (2)'.
Params: {
    "textDocument": {
        "uri": "file:///home/user/Development/redacted/.gitlab-ci.yml"
    },
    "position": {
        "line": 12,
        "character": 4
    },
    "context": {
        "triggerKind": 1
    }
}

[Trace - 2:56:12 PM] Received request 'custom/schema/request - (12)'.
Params: [
    "file:///home/user/Development/redacted/.gitlab-ci.yml"
]

[Trace - 2:56:12 PM] Sending response 'custom/schema/request - (12)'. Processing request took 0ms
Result: []

[Trace - 2:56:12 PM] Received response 'textDocument/completion - (2)' in 9ms.
Result: {
    "items": [],
    "isIncomplete": false
}
## versions

vim version: NVIM v0.5.0
node version: v16.5.0
coc.nvim version: 0.0.80-fe35d5fe2b
coc.nvim directory: /home/user/.vim/plugged/coc.nvim
term: screen-256color
platform: linux

I added the same config lines in my VSCode-yaml config, and completion works fine. Also, coc-yaml actually works with other file schemas, for example, I managed to set up ansible without a problem, so it's something weird with gitlab-ci specifically. Could you please help me with troubleshooting this issue to set up the plugin properly?


Here is the full coc-settings.json file

{
    "yaml.schemas": {
        "https://json.schemastore.org/ansible-inventory.json": "inventory/*.yml",
        "https://json.schemastore.org/ansible-playbook.json": [
            "playbooks/*.yml",
            "*.playbook.yml"
        ],
        "https://json.schemastore.org/ansible-role-2.9.json": [
            "roles/*/tasks/*.yml"
        ],
        "https://json.schemastore.org/gitlab-ci.json": [
            "*gitlab-ci*"
        ]
    },
    "yaml.completion": true,
    "yaml.validate": true,
    "json.format.enable": true,
    "yaml.format.enable": true,
    "yaml.trace.server": "verbose",
    "yaml.schemaStore.enable": true,
    "languageserver": {
        "terraform": {
            "command": "terraform-ls",
            "args": [
                "serve"
            ],
            "filetypes": [
                "terraform",
                "tf"
            ],
            "initializationOptions": {}
        }
    }
}