Skip to content

Adjust CodeActionResponse #105

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 2 commits into from
Jun 28, 2019

Conversation

Xanewok
Copy link
Collaborator

@Xanewok Xanewok commented Jun 27, 2019

Looking at textDocument/codeAction it seems to be returning heterogeneous array (Command | CodeAction)[] | null rather than Command[] | CodeAction[] | null so I adjusted that accordingly.

Discovered this while working on rust-lang/vscode-rust#609 - right now RLS sends only Vec<Command> but to fix the issue we also need send some CodeActions as well, hence why we need the heterogenous array.

r? @Marwes

@Xanewok
Copy link
Collaborator Author

Xanewok commented Jun 27, 2019

A "weekend" project idea: one of these days it'd be great to have a bindgen but for TS which would just scan the .ts file and spit out the Rust bindings, maybe using https://github.com/FreeMasen/RESS? @matklad interested? 😝

@matklad
Copy link
Contributor

matklad commented Jun 28, 2019

Yeah, I was thinking writing a simple ts parser for that :D

The problem I see, though, is that there's really no single source of truth for the protocol definition :(

The markdown spec does not contain various experimental features, and simply extracting typescript snippets from md would be a bit of the pain.

Also, I mildly hate inconsistent naming in the protocol (some things are X, some things are XRequest), and I would probably prefer to rename them on the library level.

So, I think the pre-requsite for that work is to compile a machine-readable definition of the protocol first, separate from the md speck

@Marwes Marwes merged commit 732c29c into gluon-lang:master Jun 28, 2019
@Marwes
Copy link
Member

Marwes commented Jun 28, 2019

👍 Released as 0.58

@Marwes
Copy link
Member

Marwes commented Jun 28, 2019

A "weekend" project idea: one of these days it'd be great to have a bindgen but for TS which would just scan the .ts file and spit out the Rust bindings, maybe using https://github.com/FreeMasen/RESS? @matklad interested? 😝

Would be even better if the LSP spec used something like JSON schema microsoft/language-server-protocol#67 . The debug server protocol does actually provide that which let me generate the types for that protocol https://crates.io/crates/debugserver-types https://crates.io/crates/schemafy

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

Successfully merging this pull request may close these issues.

3 participants