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 request: support eliom file extensions #353

Open
jrochel opened this issue Dec 22, 2020 · 4 comments
Open

feature request: support eliom file extensions #353

jrochel opened this issue Dec 22, 2020 · 4 comments

Comments

@jrochel
Copy link
Contributor

jrochel commented Dec 22, 2020

This would be ".eliom" for OCaml and ".eliomi" for Ocaml interface.
The patch is trivial, but I still can't seem to get it to work.
I hope someone who knows this source code will be able to implement this within 5 seconds.

@jordanrmerrick
Copy link

jordanrmerrick commented Dec 22, 2020

Do you mean you want to apply OCaml syntax and ocaml-lsp features to .eliom and .eliomi files? If so, a current workaround can be found here.

@jrochel
Copy link
Contributor Author

jrochel commented Dec 23, 2020

Indeed, that's what I want and what I'm already doing. However, the recognition of whether the current file is an interface file or and implementation file is done in ocaml-lsp-server, if I'm not mistaken.

I did add the file extensions ".eliom" and ".eliomi" to ocaml-lsp-server/src/document.ml and to ocaml-lsp-server/src/inference.ml, but that didn't seem to do the trick. When editing an .eliomi file it still treated it as an Impl file.

Maybe I should make a PR (that doesn't work).

@jrochel
Copy link
Contributor Author

jrochel commented Dec 23, 2020

#354

@jrochel
Copy link
Contributor Author

jrochel commented Dec 23, 2020

The PR has been merged, but I still cannot get the recognition of .eliomi files to work:

Even when sending "languageId": "ocaml.interface" my .eliomi files are still treated as Impl files. When I edit some .mli file the file is correctly treated as an Intf file, while in the logs I see no occurrence of ocaml.interface, but only ever "languageId":"ocaml". Also, in the ocaml-lsp source code the mapping from "ocaml.interface" is to OCaml and not to (OCaml, Intf). I suspect that there is some magic somewhere that uses the file extension of the path to determine whether the file is an Intf or an Impl, but I don't understand why it only works for .ml/.mli but not .eliom/.eliomi.

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

No branches or pull requests

2 participants