pulumi-lsp

module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2022 License: Apache-2.0

README

pulumi-lsp

A LSP server for writing Pulumi YAML.

License


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:

  1. There is a variable that is never referenced.

The Pulumi LSP Server should give contextual errors when:

  1. The file is not a valid YAML document.
  2. A reference refers to a variable that does not exist.
  3. 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:

  1. Typing in a predefined key for Pulumi YAML such as "resources" or "properties".
  2. Typing in the name of a resource property or function argument..
  3. Entering type tokens for resources or functions.
  4. Referencing a structured variable. For example if "cluster" is a eks:Cluster, then "${cluster.awsPr}" will suggest awsProvider.

Planned Capabilities

Analysis
  • Duplicate key errors
Hover
  • Highlight the variable at point across the file
Completion
  • When entering Pulumi YAML builtin keys.
    • Functions
    • Top level
    • 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.

Directories

Path Synopsis
cmd
sdk
lsp
step
Generic Concurrency primitives.
Generic Concurrency primitives.
yaml/bind
Bind performs static analysis on a YAML document.
Bind performs static analysis on a YAML document.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL