-
Notifications
You must be signed in to change notification settings - Fork 7
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
Flexible grammar installer #54
base: master
Are you sure you want to change the base?
Conversation
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.
ok so i did a quick check of this PR, and i have a few things to say.
firstly, i've been planning to add this feature eventually so thanks for deciding to work on it! the problem is that this removes "officially" supported queries and parsers. queries are taken from nvim-treesitter and are more complete than those hosted on the repository of a parser. if you could add this feature without removing officially supported parsers, that would be cool.
secondly, why did you remove the installer? the reason it downloads from the build repository is that windows users can't easily just compile a parser. additionally, downloading from somewhere it's already built is faster and more convenient.
thirdly, functions should be camelCase and commits should be conventional.
you could've used the existing installer functions to facilitate this feature, no? i've also realized that this removes defaults from evergreen and users need to find the parsers to use for their languages. it adds extra effort for no good reason. i would prefer to not remove the ease of use and only add the ability to configure extra parsers (which would be none in the future, optimally) and not all required ones of a user. |
Hi @TorchedSammy, thank you for your feedback!
Let me know what do you think about my proposal. |
overall 👍 |
BREAKING CHANGE: `add_grammar` become `addGrammar`
…in a more rational way BREAKING CHANGE: `addGrammar` is now moved into the module `config`, `installer` module is also back
@xcb-xwii, @TorchedSammy I added the following commands:
I do not think to implement any other features, as I think is now quite complete and flexible. |
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.
lost a bit of interest in evergreen for a bit. still haven't tried out the changes myself. mainly cosmetic stuff
Co-authored-by: sammyette <[email protected]>
Co-authored-by: sammyette <[email protected]>
README.md
Outdated
extensions = { "cue" }, -- list of extensions to match. | ||
-- it can be omitted if the language has the same name of the | ||
-- extension (like in this case) | ||
-- filenames = {...}, -- list of filenames to match |
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.
better explanation? what are the filenames matching for..
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.
The file names are coming from the current implementation of evergreen and in particular at languages.lua:30
.
But basically is for grammars that matches complete filenames and not only extensions, but I believe it would be better to add regular expression (such as %.cue
) in order to first be more flexible (for example I have makesfile that could be matched by something like this Makefile.%
) and avoid the need to have the two separate fields. Moreover I think lite-xl-lsp
uses something like that.
What do you think about it?
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.
Hi, I updated it with a single filePatterns
entry where it is possible to specify any regex (as in lite-xl-lsp:file_patterns
(is really unfortunate to use different naming patterns...)).
Please let me know what do you think about it.
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.
assuming this is the same as ignore_patters in lite xl, it's a good change.
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.
that is all from me i think, @takase1121 @xcb-xwii review
Instead of hard-coding the grammars and queries I added the possibilities to install them and add them in the
init.lua
user configuration file.Now it is possible to configure its own grammar from local files or from remote git repositories (doc and examples in the
README.md
)