-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Replace Dune grammar and add more filenames #7126
base: main
Are you sure you want to change the base?
Conversation
There's one non-blocking issue with this update,
cc @smorimoto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the template to fill in the appropriate section for adding the other filenames, You need to fill out all that apply and this is not a simple grammar switch with these additions.
Please note, if any of these new files do not meet our usage requirements, this PR will be blocked until they do meet our requirements or they are removed from this PR. Accordingly, you might want to consider splitting this PR into two.
This will be the only grammar used and it will be applied to all files identified as Dune as per the |
I've updated the PR to reflect.
They meet the requirements, except for |
You'll need to remove this filename if you want this PR merged. |
Includes `dune` and `dune-workspace`.
ba18ae6
to
69d5bf0
Compare
I've removed references to |
Looks like you might not have used the |
Mm, i'm pretty sure i had, but it was weird. It didn't generate some files, i had to replace them manually. Looks like i missed updating gitmodules, one second. |
Should be okay now? Just missed deleting the actual submodule. |
Please use the script. It correctly orders things in various files that are automatically maintained by it. It also validates the grammar files. This should do the trick: script/add-grammar --replace vendor/grammars/vscode-ocaml-platform https://github.com/ocamllabs/vscode-ocaml-platform.git |
@lildude, quick question relating to the previous non-blocking issue I mentioned. If I have a new tmLanguage.json syntax file that includes other patterns as follows {
"name": "dune-all",
"scopeName": "source.dune-all",
"fileTypes": ["dune", "dune-project", "dune-workspace"],
"patterns": [{ "include": "source.dune#general" }, { "include": "source.dune#stanzas" }, { "include": "source.dune-project#stanzas" }, { "include": "source.dune-workspace#stanzas" }],
} would that work with linguist? These "sources" come from the same submodule. It's just to reduce maintainership burden, otherwise we can have a script that merges all three into a single file. |
Yes, I believe the syntax highlighter will successfully pull those in as we have other grammars that use includes without any reports of problem. @Alhadis is more of an expert about writing grammars so can confirm from his experience. |
@huwaireb Yes. In fact, the largest grammar repository I maintain, |
Description
Migrates to the official OCaml vscode extension's TextMate grammar for Dune. And adds
dune
anddune-workspace
to the files to be recognized.Checklist:
I am adding a new extension to a language.
I am changing the source of a syntax highlighting grammar