function-hcl-ls

command module
v0.2.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

function-hcl-ls

A language server implementation for function-hcl.

Provides the following features:

  • Completion
  • Hover descriptions
  • Goto Declaration/ Find references
  • Semantic tokens
  • Validations and inline errors
  • Code folding

Completion requires provider CRDs to be set up such that the language server can find type definitions.

The exact mechanics of how to set this up along with IDE integration will be documented under the docs page when the client code is added to the repo.

Internals

See modules and flows for some details of how it works, if you want to hack on it.

Standing on the shoulders of giants

This repo owes a lot to the HCL language library and the Terraform language server implementation.

This repo contains code copied from the above repos and modified for use. Since function-hcl is different enough from Terraform, the borrowed code did not work well for it but gave the authors a great starting point. A lot of refactoring has been done on both these copied codebases to make the language server work for function-hcl. Both upstream projects are licensed under the Mozilla Public License 2.0 (MPL-2.0). See NOTICE for specific attribution details and LICENSE-MPL-2.0.txt for the full license text.

In addition, the go.mod replaces the HCL dependency with a fork because of a critical fix for a known issue that is needed.

You cannot build this repo using go install github.com/... because of this. For source builds, you will need to clone the repo and build it locally.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd
Package cmd provides sub-command implementations.
Package cmd provides sub-command implementations.
document
Package document encapsulates processing for HCL text documents.
Package document encapsulates processing for HCL text documents.
document/diff
Package diff provides facilities to represent the differences between two document texts as a sequence of document.Change records.
Package diff provides facilities to represent the differences between two document texts as a sequence of document.Change records.
document/source
Package source provides facilities to represent text documents as a sequence of lines.
Package source provides facilities to represent text documents as a sequence of lines.
document/store
Package store implements a store for HCL documents open in the editor and tracks unsaved changes for each of them.
Package store implements a store for HCL documents open in the editor and tracks unsaved changes for each of them.
eventbus
Package eventbus provides facilities for asynchronous processing of events mediated by a type-safe bus.
Package eventbus provides facilities for asynchronous processing of events mediated by a type-safe bus.
features
Package features provides sub-packages for state tracking for use by language server features.
Package features provides sub-packages for state tracking for use by language server features.
features/crds
Package crds provides schema information for CRDs and XRDs that are used in function-hcl compositions.
Package crds provides schema information for CRDs and XRDs that are used in function-hcl compositions.
features/crds/store
Package store provides a self-managing CRD store and implements background CRD discovery.
Package store provides a self-managing CRD store and implements background CRD discovery.
features/modules
Package modules provides facilities to track the parsed state of modules and provider completion and hover contexts, among other things.
Package modules provides facilities to track the parsed state of modules and provider completion and hover contexts, among other things.
features/modules/store
Package store tracks derived information for modules.
Package store tracks derived information for modules.
filesystem
Package filesystem provides an FS abstraction over operating system files overlaid with unsaved editor content.
Package filesystem provides an FS abstraction over operating system files overlaid with unsaved editor content.
funchcl
Package funchcl is a container for function-hcl aware processing.
Package funchcl is a container for function-hcl aware processing.
funchcl/decoder
Package decoder supplies directory, file, and range level contexts for use by completion, hover, and other decoders.
Package decoder supplies directory, file, and range level contexts for use by completion, hover, and other decoders.
funchcl/decoder/completion
Package completion provides facilities for auto-complete and hover information.
Package completion provides facilities for auto-complete and hover information.
funchcl/decoder/folding
Package folding provides folding range support for HCL files.
Package folding provides folding range support for HCL files.
funchcl/decoder/symbols
Package symbols provides document symbols.
Package symbols provides document symbols.
funchcl/schema
Package schema provides the standard schema for the function-hcl DSL.
Package schema provides the standard schema for the function-hcl DSL.
funchcl/target
Package target provides definition and reference information for a function-hcl module.
Package target provides definition and reference information for a function-hcl module.
langhcl
Package langhcl is a fork of the HashiCorp hcl-lang repo, adapted for function-hcl use.
Package langhcl is a fork of the HashiCorp hcl-lang repo, adapted for function-hcl use.
langhcl/lang
Package lang defines the core types that can be adapted to language server constructs.
Package lang defines the core types that can be adapted to language server constructs.
langhcl/schema
Package schema defines the types that are used to represent schemas for validation and auto-complete.
Package schema defines the types that are used to represent schemas for validation and auto-complete.
langhcl/writer
Package writer returns source code for HCL syntax nodes, for debugging use.
Package writer returns source code for HCL syntax nodes, for debugging use.
langserver
Package langserver implements the language server endpoints.
Package langserver implements the language server endpoints.
langserver/handlers
Package handlers provides the core handler implementation that is responsible for managing internal features, and dispatching requests to these.
Package handlers provides the core handler implementation that is responsible for managing internal features, and dispatching requests to these.
langserver/lsp
Package lsp provides functions to convert generic interfaces to LSP-specific types.
Package lsp provides functions to convert generic interfaces to LSP-specific types.
langserver/protocol
Package protocol provides generated types for use in the language server implementation.
Package protocol provides generated types for use in the language server implementation.
langserver/session
Package session provides session lifecycle tracking for a language server.
Package session provides session lifecycle tracking for a language server.
resource
Package resource provides facilities to convert CRDs and XRDs to HCL schemas.
Package resource provides facilities to convert CRDs and XRDs to HCL schemas.
resource/loader
Package loader provides facilities for loading CRDs and XRDs from various sources.
Package loader provides facilities for loading CRDs and XRDs from various sources.
utils
Package utils provides miscellaneous utilities in sub-packages.
Package utils provides miscellaneous utilities in sub-packages.
utils/logging
Package logging provider logging facilities.
Package logging provider logging facilities.
utils/mdplain
Package mdplain allows cleanup of markdown into plain text.
Package mdplain allows cleanup of markdown into plain text.
utils/perf
Package perf provides facilities to measure and report performance
Package perf provides facilities to measure and report performance
utils/queue
Package queue provides a simple queue implementation with support for deduping equivalent jobs using the notion of a unique key for each job.
Package queue provides a simple queue implementation with support for deduping equivalent jobs using the notion of a unique key for each job.
utils/uri
Package uri provides miscellaneous facilities for URI manipulation.
Package uri provides miscellaneous facilities for URI manipulation.
types
v1

Jump to

Keyboard shortcuts

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