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

feature(lsp): add metamodel parser #728

Closed
wants to merge 1 commit into from

Conversation

rgrinberg
Copy link
Member

In preparation for 3.17, we should be able to replace the typescript parser with a code generator that depends on this json file.

@rgrinberg rgrinberg requested review from tatchi and ulugbekna June 17, 2022 18:51
@rgrinberg rgrinberg force-pushed the ps/rr/featuer_lsp___add_metamodel_parser branch from aee9b10 to d075241 Compare June 17, 2022 18:52
@ulugbekna
Copy link
Collaborator

ulugbekna commented Jun 17, 2022

Interesting

  1. is the plan to go from vscode.d.ts -> metamodel.json -> Metamodel.t -> generated ocaml code?
  2. I don't see code generation, will the ocaml code generation come in another PR?
  3. how do you generate this metamodel.json?

Also, during my work on semantic highlighting I changed data (ref) from int list to int array because it's more efficient, especially when we compute diff between data from previous response and the currently computed data. I wonder whether this work is a good place to discuss when we should treat json array as a list and when as an array.

@rgrinberg
Copy link
Member Author

is the plan to go from vscode.d.ts -> metamodel.json -> Metamodel.t -> generated ocaml code?

Yes it is.

I don't see code generation, will the ocaml code generation come in another PR?

We already have a code generator that goes from typescript to OCaml. The plan is to replace the typescript parser with reading Metamodel.t. Hopefully this will simplify the maintenance.

how do you generate this metamodel.json?

It is generated for us already thankfully. I just copied it from the lsp spec repo.

Also, during my work on semantic highlighting I changed data (ref) from int list to int array because it's more efficient, especially when we compute diff between data from previous response and the currently computed data. I wonder whether this work is a good place to discuss when we should treat json array as a list and when as an array.

Sometimes it's possible to write the converters for the types that we need manually ourselves. It's possible to tell the code generator to exclude certain things from being generated. Another option would be to hack the generator to special case the semantic tokens.

in preparation for 3.17

Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: E0AE7554-7060-4327-854C-5BABF6DB7742
@rgrinberg rgrinberg force-pushed the ps/rr/featuer_lsp___add_metamodel_parser branch from d075241 to 56dae72 Compare June 20, 2022 20:07
@ulugbekna ulugbekna self-assigned this Jun 29, 2022
@ulugbekna
Copy link
Collaborator

I'd love to work on inlay hints when we upgrade to 3.17. I'd like to show types as inlay hints for symbols #685

@rgrinberg
Copy link
Member Author

Okay, let me start pushing the remaining of what I have.

@rgrinberg rgrinberg closed this Jul 31, 2022
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.

2 participants