terraform-ls

command module
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

README

Terraform Language Server

Experimental version of Terraform language server.

What is LSP

Read more about the Language Server Protocol at https://microsoft.github.io/language-server-protocol/

Current Status

Not all language features (from LSP's or any other perspective) are available at the time of writing, but this is an active project with the aim of delivering smaller, incremental updates over time.

We encourage you to browse existing issues and/or open new issue if you experience a bug or have an idea for a feature.

Installation

Homebrew (macOS / Linux)

You can install via Homebrew

brew install hashicorp/tap/terraform-ls
Ubuntu/Debian (APT)
# Add the HashiCorp GPG key
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
# Add the official HashiCorp Linux repository
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"

sudo apt-get update && sudo apt-get install terraform-ls
CentOS/RHEL (YUM)
# Install yum-config-manager to manage your repositories
sudo yum install -y yum-utils
# Add the official HashiCorp Linux repository
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

sudo yum -y install terraform-ls
Amazon Linux (YUM)
# Install yum-config-manager to manage your repositories
sudo yum install -y yum-utils
# Add the official HashiCorp Linux repository
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo

$ sudo yum -y install terraform-ls
Fedora (DNF)
# Install dnf config-manager to manage your repositories
sudo dnf install -y dnf-plugins-core
# Add the official HashiCorp Linux repository.
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo

sudo dnf -y install terraform-ls
Other platforms
  1. Download for the latest version of the language server relevant for your operating system and architecture.
  2. The language server is distributed as a single binary. Install it by unzipping it and moving it to a directory included in your system's PATH.
  3. You can verify integrity by comparing the SHA256 checksums which are part of the release (called terraform-ls_<VERSION>_SHA256SUMS).
  4. Check that you have installed the server correctly via terraform-ls -v. You should see the latest version printed to your terminal.

Usage

The most reasonable way you will interact with the language server is through a client represented by an IDE, or a plugin of an IDE.

Please follow the relevant guide for your IDE.

Credits

terraform-ls VS terraform-lsp

Both HashiCorp and the maintainer of terraform-lsp expressed interest in collaborating on a language server and are working towards a long-term goal of a single stable and feature-complete implementation.

For the time being both projects continue to exist, giving users the choice:

  • terraform-ls providing

    • overall stability (by relying only on public APIs)
    • compatibility with any provider and any Terraform >=0.12.0
    • currently less features
      • due to project being younger and relying on public APIs which may not offer the same functionality yet
  • terraform-lsp providing

    • currently more features
    • compatibility with a single particular Terraform (0.12.20 at time of writing)
      • configs designed for other 0.12 versions may work, but interpretation may be inaccurate
    • less stability (due to reliance on Terraform's own internal packages)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd
filesystem
Package filesystem implements a virtual filesystem which reflects the needs of both the language server and the HCL parser.
Package filesystem implements a virtual filesystem which reflects the needs of both the language server and the HCL parser.
hcl
lsp
protocol
Package protocol contains data types and code for LSP jsonrpcs generated automatically from vscode-languageserver-node commit: 901fd40345060d159f07d234bbc967966a929a34 last fetched Mon Oct 26 2020 09:10:42 GMT-0400 (Eastern Daylight Time)
Package protocol contains data types and code for LSP jsonrpcs generated automatically from vscode-languageserver-node commit: 901fd40345060d159f07d234bbc967966a929a34 last fetched Mon Oct 26 2020 09:10:42 GMT-0400 (Eastern Daylight Time)
schemas
Package schemas embeds provder schemas for completion support, in particular, for uninitialized modules
Package schemas embeds provder schemas for completion support, in particular, for uninitialized modules
uri

Jump to

Keyboard shortcuts

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