Repository navigation
Warn about old dune grammars and fix dune completion - #117
Merged
Merged
Conversation
Grammars installed from tree-sitter-dune's master before 0.1.0 don't wrap fields in stanza_field nodes, which the font-lock rules name. Emacs 31 then turns most of the highlighting off with a warning that suggests downgrading the grammar, and Emacs 29 and 30 signal errors while fontifying. So neocaml-dune now says, once a session, to reinstall the grammar, as neocaml-mode does for outdated OCaml grammars.
Field names were offered at the head of any list inside a stanza, so the values of fields got them too, e.g. the tags of a package. Now they're only offered where a field goes: right inside a stanza (also one in a subdir), or inside a profile of an env stanza, right inside which the profile names are offered instead. Fields don't get offered inside other fields, as there are no tables of those yet. dune-project's package stanza gets its own fields, which stay out of the fallback for the stanzas the tables don't know. Inside an action field, and inside the actions that take actions, the action names are offered. Atoms can have # and ? in them now, for copy# and diff?.
bbatsov
force-pushed
the
dune-followups
branch
from
November 3, 2026 08:44
e65013c to
042da54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #93. With a dune grammar from before 0.1.0 most of the highlighting fails (Emacs 31 turns it off and suggests downgrading the grammar, 29 and 30 error while fontifying), so neocaml-dune now says once to reinstall it. Completion still goes by paren depth rather than the parse tree, since it runs on half-typed input, and the fields of fields like
foreign_stubshave no tables yet, so they get nothing rather than the wrong names.Fixes #92