how to setup ansible-language-server ? #7950
-
Hi, I’d like to get completion and such for ansible, but so far I’ve been unable to get it working.
hx --health seems happy, but I don’t get completion for ansible. Could someone give me a hand, please ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Oh, btw I tried too to add it as a 2nd language server in yaml part of helix config, without success. |
Beta Was this translation helpful? Give feedback.
-
What does the log file say when running in verbose mode? ( |
Beta Was this translation helpful? Give feedback.
-
Hi @the-mikedavis ! [language-server]
ansible-language-server = { command = "ansible-language-server", args = ["--stdio"] }
...
[[language]]
name = "yaml"
...
language-servers = [ "ansible-language-server", "yaml-language-server" ] (which seems the best bet to me to get it properly running given the « familiarity » with yaml) hx -v gives (reformated for readability) : {
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"capabilities": {
"general": {
"positionEncodings": [
"utf-8",
"utf-32",
"utf-16"
]
},
"textDocument": {
"codeAction": {
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"dataSupport": true,
"disabledSupport": true,
"isPreferredSupport": true,
"resolveSupport": {
"properties": [
"edit",
"command"
]
}
},
"completion": {
"completionItem": {
"deprecatedSupport": true,
"insertReplaceSupport": true,
"resolveSupport": {
"properties": [
"documentation",
"detail",
"additionalTextEdits"
]
},
"snippetSupport": true,
"tagSupport": {
"valueSet": [
1
]
}
},
"completionItemKind": {}
},
"hover": {
"contentFormat": [
"markdown"
]
},
"inlayHint": {
"dynamicRegistration": false
},
"publishDiagnostics": {
"versionSupport": true
},
"rename": {
"dynamicRegistration": false,
"honorsChangeAnnotations": false,
"prepareSupport": true
},
"signatureHelp": {
"signatureInformation": {
"activeParameterSupport": true,
"documentationFormat": [
"markdown"
],
"parameterInformation": {
"labelOffsetSupport": true
}
}
}
},
"window": {
"workDoneProgress": true
},
"workspace": {
"applyEdit": true,
"configuration": true,
"didChangeConfiguration": {
"dynamicRegistration": false
},
"didChangeWatchedFiles": {
"dynamicRegistration": true,
"relativePatternSupport": false
},
"executeCommand": {
"dynamicRegistration": false
},
"inlayHint": {
"refreshSupport": false
},
"symbol": {
"dynamicRegistration": false
},
"workspaceEdit": {
"documentChanges": true,
"failureHandling": "abort",
"normalizesLineEndings": false,
"resourceOperations": [
"create",
"rename",
"delete"
]
},
"workspaceFolders": true
}
},
"clientInfo": {
"name": "helix",
"version": "23.05 (13e7edab)"
},
"processId": 2470385,
"rootPath": "/home/lwandrebeck/personal_environment_tweaks",
"rootUri": "file:///home/lwandrebeck/personal_environment_tweaks",
"workspaceFolders": [
{
"name": "personal_environment_tweaks",
"uri": "file:///home/lwandrebeck/personal_environment_tweaks"
}
]
},
"id": 0
} Thanks ! |
Beta Was this translation helpful? Give feedback.
-
Ha, nevermind. Got it running by putting ansible-language-server after yaml-language-server. I’ll update the documentation. |
Beta Was this translation helpful? Give feedback.
Ha, nevermind. Got it running by putting ansible-language-server after yaml-language-server.
language-servers = [ "yaml-language-server", "ansible-language-server" ]
I’ll update the documentation.