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

Autocomplete in for expression appends the full choice to what's been typed instead of replacing #1685

Closed
1 task
vincer opened this issue Feb 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@vincer
Copy link

vincer commented Feb 1, 2024

Extension Version

v2.29.3

VS Code Version

Version: 1.86.0 (Universal)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.2.0

Operating System

macOS 14.2.1 (23C71)

Terraform Version

1.7.0

Steps to Reproduce

  1. Start typing a resource in the config inside a for expression
  2. Prompt for autocomplete suggestions
  3. Select a suggestion

Expected Behavior

What was types in step 1 should be entirely replaced with the selected suggestion.

Actual Behavior

Selected suggestion is appended to what was typed in step 1.

Screenshot 2024-02-01 at 11 58 32 AM

In this screenshot, I typed aws_route_, then highlighted aws_route_table.private. The result after hitting enter:

Screenshot 2024-02-01 at 12 05 20 PM

It appends the selection to what I typed: aws_route_aws_route_table.private

Terraform Configuration

No response

Project Structure

No response

Gist

No response

Anything Else?

I don't see this behavior when doing an autocomplete in a local variable (e.g. foo = aws_route_ works as expected).

Workarounds

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@vincer vincer added the bug Something isn't working label Feb 1, 2024
@vincer vincer changed the title Autocomplete appends the full choice to what's been typed instead of replacing Autocomplete in for expression appends the full choice to what's been typed instead of replacing Feb 1, 2024
@dbanck
Copy link
Member

dbanck commented Feb 5, 2024

Hi @vincer!

Thanks for taking the time to report this issue. I'm able to reproduce the problem.
This is likely due to the lack of support for for expressions, see hashicorp/terraform-ls#527.

The good news is that there is a PR in review that will fix the issue and respect the prefix on completion: hashicorp/hcl-lang#368

I'll keep you posted as soon as it lands.

@dbanck
Copy link
Member

dbanck commented Feb 14, 2024

We just released a new version 2.29.4. This adds support for for expressions. The update should appear automatically in VS Code.

I'll close this issue for now. If you encounter any problems, please let us know.

@dbanck dbanck closed this as completed Feb 14, 2024
Copy link

I'm going to lock this issue 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 similar to this, 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 Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants