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

Introduce Code to Diagnostic #647

Open
4 tasks
Tracked by #363
radeksimko opened this issue Jan 9, 2024 · 0 comments
Open
4 tasks
Tracked by #363

Introduce Code to Diagnostic #647

radeksimko opened this issue Jan 9, 2024 · 0 comments

Comments

@radeksimko
Copy link
Member

Background

In order to support upcoming work on code actions in the Terraform language server and possibly other future language servers and editor integrations, it is necessary to have some way for downstream HCL consumers to uniquely identify diagnostics such as these:

hcl.Diagnostic{
	Severity: hcl.DiagError,
	Summary:  "Ambiguous attribute key",
	Detail:   "If this expression is intended to be a reference, wrap it ...",
	Subject:  e.Range().Ptr(),
}

See more details about code actions at

Proposal

  • Introduce a new Code DiagCode field into the hcl.Diagnostic struct
  • Fill out the Code field for existing diagnostics which are "fixable"
    • TODO
  • Document naming conventions for the Code/DiagCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant