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

languages: add editorconfig #8076

Closed
wants to merge 1 commit into from
Closed

languages: add editorconfig #8076

wants to merge 1 commit into from

Conversation

nbsp
Copy link
Contributor

@nbsp nbsp commented Aug 27, 2023

note that this is unrelated to #279; this is simply a highlighting grammar for .editorconfig files, which i felt was useful regardless.

homepage, specification, tree-sitter grammar i wrote

note that this is unrelated to #279; this is simply a highlighting
grammar for .editorconfig files, which i felt was useful
nonetheless.
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being able to highlight editorconfig syntax without support for editorconfig seems needless to me. In a pinch you can use the ini language, so I don't think we need to add another language just for this use case

@nbsp
Copy link
Contributor Author

nbsp commented Aug 27, 2023

fair enough. should i turn this into a draft so we could look at it again when editorconfig support gets implemented?

@the-mikedavis the-mikedavis marked this pull request as draft August 27, 2023 15:05
@yoav-lavi
Copy link
Contributor

yoav-lavi commented Sep 16, 2023

@the-mikedavis I think adding .editorconfig to

file-types = [
in the meantime, until we have support would be a net benefit for everyone. I can open a PR if needed

EditorConfig files use an INI format that is compatible with the format used by Python ConfigParser Library, but [ and ] are allowed in the section names. The section names are filepath globs, similar to the format accepted by gitignore. Forward slashes (/) are used as path separators and semicolons (;) or octothorpes (#) are used for comments. Comments should go individual lines. EditorConfig files should be UTF-8 encoded, with either CRLF or LF line separators.

It's not 100% INI but the question would be whether highlighting correctly in most cases is better than not highlighting at all until Helix supports editorconfig directly. My assumption is that the files that aren't INI compatible are rare.

(Although in all honesty I think being able to use the specific grammar in this PR even before adding official support is also a good idea)

@yoav-lavi
Copy link
Contributor

yoav-lavi commented Sep 16, 2023

RE: Why you'd want this without support - Shared projects use EditorConfig files often, and being able to read them highlighted is a nicer experience even if Helix doesn't yet have the functionality to support them yet IMO

@the-mikedavis
Copy link
Member

INI seems like a nice compromise to me 👍. I'd like to avoid pulling in a special parser for the syntax if possible it anyways

@the-mikedavis
Copy link
Member

Superseded by #8308

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.

3 participants