Cfn Lsp Extra
Project description
Cfn Lsp Extra
An experimental cloudformation lsp server built on top of cfn-lint aiming to provide hovering, completion, etc.
Usage
pipx install git+https://github.com/LaurenceWarne/cfn-lsp-extra
Emacs
You need to install an lsp client like lsp-mode and register cfn-lsp-extra
. yaml-mode is also highly recommended.
;; After lsp-mode and yaml-mode have been loaded
(when-let ((exe (executable-find "cfn-lsp-extra")))
;; Copied from https://www.emacswiki.org/emacs/CfnLint
(define-derived-mode cfn-json-mode js-mode
"CFN-JSON"
"Simple mode to edit CloudFormation template in JSON format."
(setq js-indent-level 2))
(add-to-list 'magic-mode-alist
'("\\({\n *\\)? *[\"']AWSTemplateFormatVersion" . cfn-json-mode))
(add-to-list 'lsp-language-id-configuration
'(cfn-json-mode . "cloudformation"))
(add-hook 'cfn-json-mode-hook #'lsp)
(when (featurep 'yaml-mode)
(define-derived-mode cfn-yaml-mode yaml-mode
"CFN-YAML"
"Simple mode to edit CloudFormation template in YAML format.")
(add-to-list 'magic-mode-alist
'("\\(---\n\\)?AWSTemplateFormatVersion:" . cfn-yaml-mode))
(add-to-list 'lsp-language-id-configuration
'(cfn-yaml-mode . "cloudformation"))
(add-hook 'cfn-yaml-mode-hook #'lsp))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection exe)
:activation-fn (lsp-activate-on "cloudformation")
:server-id 'cfn-lsp-extra)))
Alternatives
vscode-cfn-lint
cfn-lint
Note this is used by cfn-lsp-extra
under the hood.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cfn-lsp-extra-0.1.1.tar.gz
(1.2 MB
view hashes)
Built Distribution
Close
Hashes for cfn_lsp_extra-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410b81e318f69a1788f8fc122e8d07bf26128b2306e49bd42c7f5e9d8cfa14d1 |
|
MD5 | 8108472455b3bfa54bcbce1339dc909c |
|
BLAKE2b-256 | 5962c3661c1dd19fa28a06b75e0db3c37abd2203764e06eebb3a93376de0a63d |