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

Fix validate on save #799

Merged
merged 1 commit into from
Feb 24, 2022
Merged

Fix validate on save #799

merged 1 commit into from
Feb 24, 2022

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Feb 22, 2022

The /didSave handler was missing WithModuleManager and WithExecutorFactory, which the validate command handler needs to find terraform to execute validate.

Closes #792

@jpogran jpogran self-assigned this Feb 22, 2022
@jpogran jpogran added the bug Something isn't working label Feb 22, 2022
@jpogran jpogran marked this pull request as ready for review February 22, 2022 16:13
@dbanck
Copy link
Member

dbanck commented Feb 22, 2022

Closes #792

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, but I'd prefer to rebase & merge this after #782

@radeksimko radeksimko added this to the v0.26.0 milestone Feb 23, 2022
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.

@jpogran Do you mind rebasing this one? I think it's just the ModuleManager removal that needs reflecting here.

The `/didSave` handler was missing WithModuleManager and WithExecutorFactory, which the validate command handler needs to find terraform to execute validate.
@jpogran jpogran force-pushed the fix_validate_on_save branch from bd89355 to f138325 Compare February 24, 2022 17:43
@jpogran
Copy link
Contributor Author

jpogran commented Feb 24, 2022

Rebased and pushed

@jpogran
Copy link
Contributor Author

jpogran commented Feb 24, 2022

Confirmed works as expected:

2022/02/24 12:42:39 rpc_logger.go:29: Incoming notification for "textDocument/didSave": {"textDocument":{"uri":"file:///c%3A/Users/james/src/hashicorp/learn/example/main.tf"}}
2022/02/24 12:42:40 opts.go:254: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///C:/Users/james/src/hashicorp/learn/example","diagnostics":[]}
2022/02/24 12:42:40 opts.go:254: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///C:/Users/james/src/hashicorp/learn/example/main.tf","diagnostics":[{"range":{"start":{"line":15,"character":43},"end":{"line":15,"character":44}},"severity":1,"source":"terraform validate","message":"Missing required argument: The argument \"resource_group_name\" is required, but no definition was found."},{"range":{"start":{"line":15,"character":43},"end":{"line":15,"character":44}},"severity":1,"source":"terraform validate","message":"Missing required argument: The argument \"data_residency_location\" is required, but no definition was found."},{"range":{"start":{"line":15,"character":43},"end":{"line":15,"character":44}},"severity":1,"source":"terraform validate","message":"Missing required argument: The argument \"sku_name\" is required, but no definition was found."},{"range":{"start":{"line":15,"character":43},"end":{"line":15,"character":44}},"severity":1,"source":"terraform validate","message":"Missing required argument: The argument \"domain_name\" is required, but no definition was found."}]}

@jpogran jpogran merged commit 6ab2488 into main Feb 24, 2022
@jpogran jpogran deleted the fix_validate_on_save branch February 24, 2022 18:30
@github-actions
Copy link

This functionality has been released in v0.26.0 of the language server.
If you use the official Terraform VS Code extension, it will prompt you to upgrade to this version automatically upon next launch or within the next 24 hours.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@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 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working textDocument/didSave
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate on save doesn't work
3 participants