pulumi-lsp
A LSP server for
writing Pulumi YAML.
Note: The Pulumi YAML LSP Server is in a public beta. If you have suggestions
for features or find bugs, please open an issue.
Existing Capabilities
Warnings and Errors
The Pulumi LSP Server should give contextual warnings when:
- There is a variable that is never referenced.
The Pulumi LSP Server should give contextual errors when:
- The file is not a valid YAML document.
- A reference refers to a variable that does not exist.
- More then one variable/resource share the same name.
On Hover
When you hover your mouse over a resources type token, you should observe a
popup that describes the resource. Likewise for the type token of a function.
Completion
You should get semantic completion when:
- Typing in a predefined key for Pulumi YAML such as "resources" or "properties".
- Typing in the name of a resource property or function argument..
- Entering type tokens for resources or functions.
- Referencing a structured variable. For example if "cluster" is a
eks:Cluster
, then "${cluster.awsPr}" will suggest awsProvider
.
Planned Capabilities
Analysis
Hover
- [ ] Highlight the variable at point across the file
Completion
- [ ] When entering Pulumi YAML builtin keys.
- [ ] Functions
- [x] Top level
- [x] Resources
- [ ] On the return value for invokes
Actions
- [ ] Rename variable
- [ ] Fill in input properties
Setting Up Pulumi LSP
The server is theoretically deployable to any editor that supports LSP.
VS Code
Because VS Code is the most common editor, I used it for
initial testing. Running make install vscode-client
will install the server on your path
and build a .vsix
file in ./bin
. Running code ${./bin/pulumi-lsp-client-*.vsix}
will
install the extension. See the docs
for details.
Emacs
pulumi-yaml.el
provides a major mode for editing Pulumi YAML which should be
auto-invoked on relevant documents. It also associates a LSP server
emacs-lsp which can be launched the usual way:
M-x lsp
. Run make install emacs-client
to install the server in $GOPATH/bin
. A
pulumi-yaml.elc
fill will be generated in ./bin
.