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

minimal support for non-default LSPs #186

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

tgolsson
Copy link
Contributor

@tgolsson tgolsson commented Dec 1, 2020

This adds support for using the LSP implemenation from other workspaces to expose custom bindings without reimplementing the whole binary. To make this easier, it also adds a VSCode extension setting so you can set the binary path to where your custom LSP lives. This gives you a workspace file with a minimum:

{
    "rune.binaryPath": "/home/tgolsson/Repos/rune/target/release/rune-languageserver"
}

This is me using a locally built version of the rune languageserver as I build the whole toolchain locally.

For a fully custom integration, I do this when I'm working on my game-engine:

extern crate binds;
fn main() -> anyhow::Result<()> {
        let mut context = rune_modules::default_context()?;

        for module in binds::all_modules() {
            context.install(&module)?;
        }

        let mut options = rune::Options::default();
        options.macros(true);

        rune_languageserver::run(context, options)
}

and use a workspace file targeting this binary instead.

Copy link
Collaborator

@udoprog udoprog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. It's a good workaround for the lack of metadata from native modules. I'll take it for a spin as soon as I can to make sure everything works as expected, but it looks good.

@udoprog udoprog merged commit 9917edd into rune-rs:main Dec 2, 2020
@udoprog udoprog added enhancement New feature or request changelog Issue has been added to the changelog labels Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants