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

Read from .sublime-syntax's hidden_file_extensions #2227

Open
0x326 opened this issue Jun 27, 2022 · 3 comments
Open

Read from .sublime-syntax's hidden_file_extensions #2227

0x326 opened this issue Jun 27, 2022 · 3 comments
Labels
feature-request New feature or request good first issue Good for newcomers

Comments

@0x326
Copy link

0x326 commented Jun 27, 2022

Would it be possible for bat to read from the hidden_file_extensions property of .sublime-syntax files in addition to the file_extension property? For some projects, file types are have a different extension than usual, such as XML in C# and VB.NET projects (.csproj and .vbproj are written in XML syntax). These less common extensions seem to be already listed in some .sublime-syntax files, but are not currently being read by bat (example).

Expected behavior: Syntax highlighting of files such as .csproj

Current behavior: No syntax highlighting

@0x326 0x326 added the feature-request New feature or request label Jun 27, 2022
@0x326 0x326 changed the title Read from .sublime-syntaxhidden_file_extensions Read from .sublime-syntax's hidden_file_extensions Jun 27, 2022
@Enselic
Copy link
Collaborator

Enselic commented Jun 27, 2022

Support for hidden_file_extensions was added to syntect 5.0.0 (trishume/syntect#419) so this should be pretty straightforward to do. Tentatively setting as good-first-issue.

@Enselic Enselic added the good first issue Good for newcomers label Jun 27, 2022
@dufferzafar
Copy link

@Enselic Could you provide some more details? Which pieces of the code would be involved in this? I'd like to work on my first rust contribution 😺

@Enselic
Copy link
Collaborator

Enselic commented Aug 14, 2022

Hmm, after thinking some more about it, I actually expected it to already work. But the syntect implementation looks incomplete. bat relies on the following code, but I think it should be changed to also take hidden_file_extensions into account:

https://github.com/trishume/syntect/blob/606450becf047721b1411da7b1ddd782e6c25d3d/src/parsing/syntax_set.rs#L185-L187

Maybe you can make your first rust contribution towards syntect rather than bat? 👼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants