Skip to content

wasm demo completions support #2

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

Merged
merged 6 commits into from
Sep 21, 2019

Conversation

JasperDeSutter
Copy link
Contributor

Adds basic typing completions support to the wasm demo. Things such as functions, the rust-analyzer helpers (box, dbg...) work now.
This includes some refactoring to have the same Conv and ConvWith<CTX> as used in ra_lsp_server.

additionalTextEdits: additional_text_edits,
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

It feels bad that we need to literally duplicate this between ra_lsp_server and wasm demo, but still, I think its the right thing to do. Wrapping rust-analyzer into some front-end is a ton of boilerplate (b/c the API surface is large), but it is still much easier than implementing the "compiler" itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There might be some opportunity for reducing the code duplication, but that would probably require having an entire "lsp-types"-like crate for monaco.
This way rust-analyzer could have an intermediate crate mapping ra-ide to lsp, which both lsp-server and the wasm demo could use.
It sounds like too much effort to me, including the fact that monaco itself isn't stable and changes API regularly and does everything just a little differently.

@matklad matklad merged commit 6134d03 into rust-analyzer:src Sep 21, 2019
@matklad
Copy link
Member

matklad commented Sep 21, 2019

@JasperDeSutter I've also granted you the permissions on this repository, in case I am slow with reviewing things :)

@JasperDeSutter
Copy link
Contributor Author

cool! thanks 😄

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

Successfully merging this pull request may close these issues.

2 participants