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.
Installation
First install the executable, pipx
is recommended, but you can use pip
instead if you like to live dangerously:
pipx install cfn-lsp-extra
Or get the bleeding edge from source:
pipx install git+https://github.com/laurencewarne/cfn-lsp-extra.git@$(git ls-remote git@github.com:laurencewarne/cfn-lsp-extra.git | head -1 | cut -f1)
Updating:
pipx upgrade 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)))
Patches detailing integration steps for other editors are very welcome 🙏
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.2.0.tar.gz
(1.3 MB
view hashes)
Built Distribution
Close
Hashes for cfn_lsp_extra-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e51e0b49e55922b01da208a264713878dbc39d0d5d18c33d278c9e97617097 |
|
MD5 | db4f2b49f1779ca079325433b71d3176 |
|
BLAKE2b-256 | 435898eb2ebfa5a7a49bd28f99ecf9e7f42902930dc223268e9573e72d6bf9a7 |