Closed cogig closed 1 year ago
Thanks for your reply.
"languageserver": {
"dls": {
"command": "diagnostic-languageserver",
"args": ["--stdio"],
"filetypes": ["cmake"],
"initializationOptions": {
"linters": {
"cmakelint": {
"command": "cmakelint",
"args": [ "--filter=-whitespace/indent"],
"debounce": 100,
"offsetLine": 0,
"offsetColumn": 1,
"sourceName": "cmakelint",
"formatLines": 1,
"formatPattern": [
"(.*)\\s+on\\s+line\\s+(\\d+)\\s+at\\s+column\\s+(\\d+)\\s*$",
{
"line": 2,
"column": 3,
"message": 1
}
]
}
},
"filetypes": {
"cmake": "cmakelint"
}
}
}
},
I tried to add the snippets into coc-setting.json,but it seems like that it doesn't work.
You should not register custom lsp if you use this extension, you should just config diagnostic-languageserver.linters
for linters.
for example
"diagnostic-languageserver.linters": {
"cmakelint": {
"command": "cmakelint",
"args": [ "--filter=-whitespace/indent"],
"debounce": 100,
"offsetLine": 0,
"offsetColumn": 1,
"sourceName": "cmakelint",
"formatLines": 1,
"formatPattern": [
"(.*)\\s+on\\s+line\\s+(\\d+)\\s+at\\s+column\\s+(\\d+)\\s*$",
{
"line": 2,
"column": 3,
"message": 1
}
]
}
},
"diagnostic-languageserver.filetypes": {
"cmake": "cmakelint"
},
Similar issue: https://github.com/regen100/cmake-language-server/issues/79
It has been supported. https://github.com/iamcco/coc-diagnostic/blob/master/src/config.ts#L972
I do not use cmake-lint but maybe others can help, or you can add it support by yourself.