What am I missing that makes the language server not work?

I’m checking the source code of other extensions and they don’t appear to be doing anything special. This is all my code except exports.deactivate

var client = null;

exports.activate = function() {
    let serverOptions = {
        path: nova.config.get("rustanalyzer.path")
    };
    let clientOptions = {
        syntaxes: ['rust']
    };
    client = new LanguageClient('rustanalyzer', 'Rust Analyzer', serverOptions, clientOptions);
    client.start();
}

I realize it probably isn’t that easy, but I have no clue how to do it. What Nova handles and what I have to handle manually etc.
I checked the Rust Analyzer manual and the default options seem fine. I only got it to compile but it does nothing useful like jump to definition, linting and such…
I’m obviously a total beginner in this, so any help to point me towards some info would be great! Thanks in advance!

Hi Lara! There’s a lot to troubleshoot, so let me make sure I understand what you’ve already done:

  • You used the Extensions → Create New Extension… menu in Nova to get the starter files for a language extension. Or, you created all the files you need for a .novaextension bundle.
  • In your extension project, you chose Extensions → Activate Project as Extension from the menu to activate it locally. When you choose Extensions → Extension Library… you see your extension listed at the top of the sidebar.
  • In the Extension Library, you went to the Preferences tab of your extension, and set a value for the rustanalyzer.path field, since you aren’t setting a default path in the code above if this preference isn’t set.

If all this is true, then client.start() should be throwing an error if there’s a problem. With your extension project still open and activated as an extension, open a Rust project and in this Rust project select Extensions → Show Extension Console. Any errors from launching your extension would appear here.

I’m actually currently working on an extension for Rust that uses Rust Analyzer:

I was able to get many benefits from Rust Analyzer without much more effort than initializing the LanguageClient – like hover info, Jump to Definition, and completions. One thing that didn’t work well in my experience was issues. The Nova LanguageClient seemed to get out of sync quickly, so I’m manually creating issues when users save.

I think it’s awesome that there’s so much interest in making Nova better for Rust users after it’s been seemingly neglected for a while. I’m currently approaching what I consider a Version 1.0 (a few more things to work out), with the understanding that there’s still a lot of room for improvement. I think collaborators would help make it much better, should your or anyone else’s goals align with this project.

thanks for the reply! here’s the full package and I even get “Started” logged. here i committed the whole thing https://github.com/laralove143/nova-rust-analyzer btw I didn’t know there was an ra extension, I might as well just use yours