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

Add file extensions to major mode alist #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattiasdrp
Copy link

This allows to choose the correct grammar when the same major mode is used for different kind of files. Namely, in OCaml, .ml and .mli files are both handled by tuareg-mode but don't have the same grammar.

The issue right now is that I can't make tree-sitter-hl-mode work for .mli files.

This allows to choose the correct grammar when the same major mode is
used for different kind of files. Namely, in OCaml, .ml and .mli files
are both handled by tuareg-mode but don't have the same grammar.

The issue right now is that I can't make tree-sitter-hl-mode work for
.mli files.
@mattiasdrp
Copy link
Author

mattiasdrp commented Aug 30, 2022

This is a draft PR to show what the expected behaviour is.

It may be better to add functions instead of a pair of major-mode, extensions, something like

(major-mode . (function to load the proper grammar))

This would allow to not depend on extensions only in case other modes need another way to choose their grammar.

I'm still trying to understand why I can't have highlighting working when using ocaml-interface

@AltGr
Copy link

AltGr commented Jan 25, 2023

Just adding my 👍 on this: I'd be very interested in having this fixed for proper handling of OCaml .mli files

@mattiasdrp
Copy link
Author

@AltGr Hi, always a pleasure to have your support :-) If you want you can add your 👍🏽 to emacs-tree-sitter/elisp-tree-sitter#241 as they work together :-)

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