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

Create a generic abstraction over all state entities #1627

Closed
Tracked by #1614
dbanck opened this issue Feb 12, 2024 · 2 comments
Closed
Tracked by #1614

Create a generic abstraction over all state entities #1627

dbanck opened this issue Feb 12, 2024 · 2 comments

Comments

@dbanck
Copy link
Member

dbanck commented Feb 12, 2024


We need to introduce a new way to interacts with variable definition related things, after they've been removed from the Module struct. Access through the module store won't be possible anymore, so we need a new abstraction.

mod, err := svc.modStore.ModuleByPath(dh.Dir.Path())
if err != nil {
if state.IsModuleNotFound(err) {
err = svc.modStore.Add(dh.Dir.Path())
if err != nil {
return err
}
mod, err = svc.modStore.ModuleByPath(dh.Dir.Path())
if err != nil {
return err
}
} else {
return err
}
}

This will allow the LSP handlers (like did_open, did_change) to continue to work as before, but instead of accessing a module directly, they use the abstraction and the language ID to complete the operation, like adding an entity or checking for existence.

@dbanck
Copy link
Member Author

dbanck commented Jun 11, 2024

Closed via #1667

@dbanck dbanck closed this as completed Jun 11, 2024
Copy link

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

No branches or pull requests

1 participant