vscode-ocaml-platform icon indicating copy to clipboard operation
vscode-ocaml-platform copied to clipboard

Add support to enable lsp completion inside the OCaml blocks for OCamllex files

Open smorimoto opened this issue 5 years ago • 4 comments

smorimoto avatar Mar 06 '21 11:03 smorimoto

@rgrinberg @voodoos Where should this be addressed? Should we support this on the Merlin side?

smorimoto avatar Mar 06 '21 19:03 smorimoto

Well, I'm sure this shouldn't be addressed on the extension side.

smorimoto avatar Mar 06 '21 19:03 smorimoto

Where should this be addressed? Should we support this on the Merlin side?

I think both the language server and Merlin would have to add support. If I'm not mistaken, LSP support would have to be registered for the entire mll filetype because embedded blocks are not supported by the protocol. Merlin would have to recognize regex variables defined in the lexer rules: https://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html#ss:ocamllex-variables

mlantas avatar Mar 06 '21 19:03 mlantas

Yes, and it would be great if something like ocamlformat supports that, as well. I don't know if it should be done through LSP or by ocamlformat itself, but I think we need to take that into account.

smorimoto avatar Mar 07 '21 11:03 smorimoto