hashicorp / vscode-terraform

HashiCorp Terraform VSCode extension
https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform
Mozilla Public License 2.0
911 stars 180 forks source link

Heredoc causes text cursor to freeze #1784

Open Lewis-Globacap opened 1 week ago

Lewis-Globacap commented 1 week ago

Extension Version

v2.30.2024042211

VS Code Version

Version: 1.83.0 Commit: e7e037083ff4455cf320e344325dacb480062c3c Date: 2023-10-03T16:13:10.518Z Electron: 25.8.4 ElectronBuildId: 24154031 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin arm64 23.5.0

Operating System

macOS Sonoma 14.5 Apple M1

Terraform Version

Terraform v1.7.3 on darwin_arm64

Steps to Reproduce

  1. Create any terraform resource
  2. Create a Heredoc where atleast two lines start with a terraform variable. eg (${var.example})

Demo

heredoc-bug

Expected Behavior

VSCode operates as normal no noticable change.

Actual Behavior

Text cursor stop visibly moving, however it is actually moving and you can update text.

Terraform Configuration

resource "datadog_monitor" "monitor" {
    name = "Service"
    type = "metric alert"
    query = ""

    message = <<EOF
{{#is_alert}}
${var.environment} DOWN
{{/is_alert}} 

{{#is_alert_recovery}}
${var.environment} Service is UP
{{/is_alert_recovery}} 
EOF
}

Project Structure

No response

Gist

No response

Anything Else?

No response

Workarounds

No response

References

No response

Help Wanted

Community Note

ansgarm commented 1 week ago

Hi @Lewis-Globacap šŸ‘‹

First of all: Thank you for the awesome demo gif šŸ‘ Well appreciated!

I was able to reproduce your issue on VS Code v1.83.0: vscode-1 83 0

Is there a reason why you are on that specific version given it's quite a few months old already? I tried a more recent version (1.90.1) and wasn't able to reproduce it: vscode-1 90 1

That said, it is probably something we won't be able to fix on the extension side either as it seems to stem from the VS Code itself since we aren't in control of the cursor šŸ˜