Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for function signature help #1077

Merged
merged 7 commits into from
Mar 17, 2023
Merged

Add support for function signature help #1077

merged 7 commits into from
Mar 17, 2023

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Sep 23, 2022

This PR enables signature help for function signatures.

To make this work, we first add the function signatures from terraform-schema (introduced in hashicorp/terraform-schema#145) to the PathContext. This work is also required to enable completion, hover, etc. for functions later on.

We then add a new handler for the textDocument/signatureHelp LSP method.

UX

Nested function calls with variadic parameters
2023-03-14 14 06 18

Functions without any arguments
2023-03-14 14 07 34

No signature help, if passing too many arguments
2023-03-14 14 08 07

Multiline function calls
2023-03-14 14 17 06


@dbanck dbanck self-assigned this Sep 23, 2022
@dbanck dbanck force-pushed the f-function-support branch from 682e224 to b58ec93 Compare October 7, 2022 16:05
@dbanck dbanck force-pushed the f-function-support branch from c53e993 to b6acd5d Compare December 6, 2022 13:14
@dbanck dbanck force-pushed the f-function-support branch 3 times, most recently from 2bb46db to d1bdf99 Compare February 14, 2023 11:08
@dbanck dbanck force-pushed the f-function-support branch from d1bdf99 to 20509ec Compare March 12, 2023 19:47
@dbanck dbanck force-pushed the f-function-support branch from 6bc553f to b141022 Compare March 15, 2023 17:22
@dbanck dbanck changed the title Add support for built-in functions Add support for function signature help Mar 15, 2023
@dbanck dbanck marked this pull request as ready for review March 15, 2023 18:17
@dbanck dbanck requested a review from a team as a code owner March 15, 2023 18:17
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

LGTM overall, works great 🥇 👍🏻

I left only very minor questions and comments in-line but they're not really blocking.

@dbanck dbanck merged commit 68b265f into main Mar 17, 2023
@dbanck dbanck deleted the f-function-support branch March 17, 2023 09:12
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide function signature help
2 participants