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

lsp not watching config(?) #1060

Open
waalge opened this issue Nov 21, 2024 · 6 comments
Open

lsp not watching config(?) #1060

waalge opened this issue Nov 21, 2024 · 6 comments

Comments

@waalge
Copy link
Contributor

waalge commented Nov 21, 2024

What Git revision are you using?

aiken v1.1.7+94ff202

What operating system are you using, and which version?

nixos

Describe what the problem is?

  1. Write config.min_val in some aiken module
  2. Lsp complains "Did you forget to make this public ...".
  3. Add min_val to aiken.toml config section.
  4. Lsp still complains
  5. Manually restart Lsp.
  6. No more complaints.

What should be the expected behavior?

Watch config and update without restart?

An aside: There are no non-public config declarations. Worth writing a special error message for this case? maybe not

@rvcas
Copy link
Member

rvcas commented Dec 26, 2024

ah yea, I don't think it knows to do anything when these files are changed

@rvcas
Copy link
Member

rvcas commented Dec 31, 2024

DidChangeWatchedFiles::METHOD => {
    if let Ok(config) = Config::load(&self.root) {
        self.config = Some(config);
            self.create_new_compiler();
            self.compile(connection)?;
    } else {
        self.stored_messages.push(lsp_types::ShowMessageParams {
            typ: lsp_types::MessageType::ERROR,
            message: "Failed to reload aiken.toml".to_string(),
        });
    }

    self.publish_stored_diagnostics(connection)?;

    Ok(())
}

seems like it should be doing the right thing?

@waalge
Copy link
Contributor Author

waalge commented Dec 31, 2024

I lack the context.
I was guessing the aiken.toml was not being watched.
But Perhaps it was being watched, but not triggering a create_new_compile?
If so, the above looks reasonable.

@rvcas
Copy link
Member

rvcas commented Jan 13, 2025

Are you still having the issue?

@waalge
Copy link
Contributor Author

waalge commented Jan 14, 2025

Yes.
Version v1.1.9+6d2e388
Lsp still not seeing value unless restarted.

Related. The help could be more explicit. From a fresh start

use config

results in

7 │ use config
   · ─────┬────
   ·      ╰── unknown module
 8 │

Despite this looking like it exists in the aiken.toml.
You have to consult the docs to know that the magic is actually looking for [config.default].
Perhaps this should be what the template has (on aiken new)

@rvcas
Copy link
Member

rvcas commented Jan 15, 2025

@waalge good point thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🪣 Backlog
Development

No branches or pull requests

2 participants