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

Republish diagnostics on schema change automatically #1540

Open
radeksimko opened this issue Dec 20, 2023 · 0 comments
Open

Republish diagnostics on schema change automatically #1540

radeksimko opened this issue Dec 20, 2023 · 0 comments

Comments

@radeksimko
Copy link
Member

radeksimko commented Dec 20, 2023

Background

As discovered in multiple issues:

the server currently does not re-publish relevant diagnostics whenever the schema changes, for example, when a provider is installed.

Proposal

We currently refresh various things, such as semantic tokens and this is all done through memdb "hooks" here:

if _, ok := lsp.ExperimentalClientCapabilities(cc.Experimental).ShowReferencesCommandId(); ok {
moduleHooks = append(moduleHooks, refreshCodeLens(svc.server))
}
if commandId, ok := lsp.ExperimentalClientCapabilities(cc.Experimental).RefreshModuleProvidersCommandId(); ok {
moduleHooks = append(moduleHooks, callRefreshClientCommand(svc.server, commandId))
}
if commandId, ok := lsp.ExperimentalClientCapabilities(cc.Experimental).RefreshModuleCallsCommandId(); ok {
moduleHooks = append(moduleHooks, callRefreshClientCommand(svc.server, commandId))
}
if commandId, ok := lsp.ExperimentalClientCapabilities(cc.Experimental).RefreshTerraformVersionCommandId(); ok {
moduleHooks = append(moduleHooks, callRefreshClientCommand(svc.server, commandId))
}
if cc.Workspace.SemanticTokens != nil && cc.Workspace.SemanticTokens.RefreshSupport {
moduleHooks = append(moduleHooks, refreshSemanticTokens(svc.server))
}

We may need to add another hook which republishes relevant diagnostics.

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