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

Support ruby highlighting for 'Capfile's #1807

Open
zw963 opened this issue Aug 21, 2021 · 7 comments
Open

Support ruby highlighting for 'Capfile's #1807

zw963 opened this issue Aug 21, 2021 · 7 comments
Labels
syntax-highlighting upstream-error A bug in an upstream component

Comments

@zw963
Copy link

zw963 commented Aug 21, 2021

image

Should be Capfile instead of capfile.

@zw963 zw963 added the bug Something isn't working label Aug 21, 2021
@sharkdp sharkdp changed the title Support ruby language format error. Support ruby highlighting for 'Capfile's Aug 21, 2021
@sharkdp sharkdp added syntax-highlighting upstream-error A bug in an upstream component and removed bug Something isn't working labels Aug 21, 2021
@sharkdp
Copy link
Owner

sharkdp commented Aug 21, 2021

Thank you for reporting this. It should be fixed upstream (in sublimehq/Packages - it would be great if you could report it there). You can patch it locally by adding

--map-syntax 'Capfile:Ruby'

to your bat config file.

@zw963
Copy link
Author

zw963 commented Aug 22, 2021

Okay, thank you.

@zw963 zw963 closed this as completed Aug 22, 2021
@keith-hall
Copy link
Collaborator

note that Sublime Text will happily open a lowercase capfile with Ruby syntax (tested on Linux), which suggests it isn't case sensitive. Perhaps we need to alter syntect to also be case insensitive?

@sharkdp
Copy link
Owner

sharkdp commented Aug 22, 2021

note that Sublime Text will happily open a lowercase capfile with Ruby syntax (tested on Linux), which suggests it isn't case sensitive. Perhaps we need to alter syntect to also be case insensitive?

Thank you for the hint. I have a feeling that we discussed this problem before...

@sharkdp sharkdp reopened this Aug 22, 2021
@keith-hall
Copy link
Collaborator

I just noticed I got my comment wrong, but you understood correctly anyway :) to clarify, Capfile (and even CAPFILE) works in ST despite the syntax definition referring to capfile

@zw963
Copy link
Author

zw963 commented Aug 23, 2021

to clarify, Capfile (and even CAPFILE) works in ST despite the syntax definition referring to capfile

But, current capfile not works when i open my project Capfile use bat if not specify config.

@keith-hall
Copy link
Collaborator

But, current capfile not works when i open my project Capfile use bat if not specify config.

Yes, sorry for not being clear. My point was that Sublime Text recognizes Capfile, so we need to change our (dependency's) code to behave the same way. Once we have updated the dependency (syntect) and reference a version with the fix, this will also work in bat without any need for changing the sublimehq/Packages repo (though it may still make sense to do so just for "correctness", for (fictional) example so that choosing an extension from a combobox would pick the correct case)

I have raised a PR to fix this in syntect: trishume/syntect#369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax-highlighting upstream-error A bug in an upstream component
Projects
None yet
Development

No branches or pull requests

3 participants