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

validate diagnostics not being cleared on file change/closing or revalidation #524

Closed
radeksimko opened this issue May 19, 2021 · 1 comment · Fixed by #603
Closed

validate diagnostics not being cleared on file change/closing or revalidation #524

radeksimko opened this issue May 19, 2021 · 1 comment · Fixed by #603
Labels

Comments

@radeksimko
Copy link
Member

Server Version

0.16.3

Terraform Version

0.15.1

Client Version

2.11.0

Terraform Configuration Files

output "name" {
  value = "Hello, ${var.name}!"
}

Log Output

2021/05/19 19:03:34 server.go:266: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///private/var/workspace/tf-test/github/main.tf","version":2},"contentChanges":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":0}},"rangeLength":0,"text":"variable \"name\" {\n  type = string\n  default = \"test\"\n}"}]}
2021/05/19 19:03:34 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///private/var/workspace/tf-test/github/main.tf","version":2},"contentChanges":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":0}},"rangeLength":0,"text":"variable \"name\" {\n  type = string\n  default = \"test\"\n}"}]}
2021/05/19 19:03:34 module_loader.go:196: ML: enqueing "OpTypeParseConfiguration" module operation: /private/var/workspace/tf-test/github
2021/05/19 19:03:34 module_loader.go:148: executing "OpTypeParseConfiguration" for /private/var/workspace/tf-test/github
2021/05/19 19:03:34 module_loader.go:171: finished "OpTypeParseConfiguration" for /private/var/workspace/tf-test/github
2021/05/19 19:03:34 module_loader.go:196: ML: enqueing "OpTypeLoadModuleMetadata" module operation: /private/var/workspace/tf-test/github
2021/05/19 19:03:34 module_loader.go:148: executing "OpTypeLoadModuleMetadata" for /private/var/workspace/tf-test/github
2021/05/19 19:03:34 module_loader.go:183: finished "OpTypeLoadModuleMetadata" for /private/var/workspace/tf-test/github
2021/05/19 19:03:34 server.go:448: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///private/var/workspace/tf-test/github/main.tf","diagnostics":[{"range":{"start":{"line":1,"character":20},"end":{"line":1,"character":28}},"severity":1,"source":"terraform validate","message":"Reference to undeclared input variable: An input variable with the name \"name\" has not been declared. This variable can be declared with a variable \"name\" {} block."}]}

Expected Behavior

validate diagnostics be cleared (i.e. republished) whenever file is typed into or closed, and when user re-runs terraform validate command.

Actual Behavior

stale validate diagnostics seem to be persisted and republished

Screenshot 2021-05-19 at 19 01 49

Steps to Reproduce

  1. Copy the above config
  2. Run terraform validate from the command palette in VS Code
  3. Add a missing variable as below
  4. See stale diagnostic
  5. Try re-running terraform validate
  6. See stale diagnostic
variable "name" {
  type = string
  default = "test"
}
@github-actions
Copy link

github-actions bot commented Sep 3, 2021

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 Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant