Skip to content

Expose an API for language server use.#43

Merged
gotwarlost merged 3 commits intomainfrom
api
Feb 13, 2026
Merged

Expose an API for language server use.#43
gotwarlost merged 3 commits intomainfrom
api

Conversation

@gotwarlost
Copy link
Collaborator

This PR exposes the analyzer and formatter for use by the language server.

Note that the analyzer accepts an array of *hcl.File and not just the text of the file. This is such that ASTs with parse errors can also be analyzed.

A recover is added to the analysis in case anything panics when dealing with an invalid syntax tree.

I will add some tests and fix the unit tests in a separate commit.

Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Copy link
Collaborator

@ydubreuil ydubreuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gotwarlost gotwarlost merged commit c08e518 into main Feb 13, 2026
6 checks passed
@gotwarlost gotwarlost deleted the api branch February 13, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants