-
Notifications
You must be signed in to change notification settings - Fork 191
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
fix: add missing filetypes #531
Conversation
Nice! Might be worth adding to required checks on CI. |
79b7a54
to
5eebe88
Compare
scripts/filetypes.sh
Outdated
if [ -n "$line" ]; then | ||
continue | ||
else | ||
[ -f "/usr/share/nvim/runtime/syntax/$key.vim" ] && |
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.
This is valid on Arch Linux but is it the same path on Ubuntu (CI)?
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.
For nvim-tree, we're setting $VIMRUNTIME
in the workflow, based on the installed location of rhysd/action-setup-vim@v1
https://github.com/nvim-tree/nvim-tree.lua/blob/5ad87620ec9d1190d15c88171a3f0122bc16b0fe/.github/workflows/ci.yml#L89
The related check script then uses that or defaults to /usr/share/nvim/runtime
https://github.com/nvim-tree/nvim-tree.lua/blob/8f974879a04b93fff68b4627087782e76cdf2ed0/scripts/luals-check.sh#L6
We're using the same action here so everything should Just Work.
5eebe88
to
c5e49f5
Compare
@@ -4,22 +4,24 @@ Thank you for your contribution! | |||
|
|||
## Order | |||
|
|||
Please ensure `icons_by_filename`, `icons_by_file_extension` and `filetypes` are ordered alphabetically, to prevent merge conflicts. | |||
Please ensure `icons_by_filename`, `icons_by_file_extension`, `icons_by_operating_system`, `icons_by_desktop_environment`, |
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.
Line breaks at 120 char but could be 100 or 80 on .md
files.
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.
I'm easy either way, although links often end up >80
Yes please! |
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.
Fantastic! Working as advertised.
Please:
- delete
scripts/filetype-generator.sh
- add to CI
scripts/filetypes.sh
Outdated
if [ -n "$line" ]; then | ||
continue | ||
else | ||
[ -f "/usr/share/nvim/runtime/syntax/$key.vim" ] && |
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.
For nvim-tree, we're setting $VIMRUNTIME
in the workflow, based on the installed location of rhysd/action-setup-vim@v1
https://github.com/nvim-tree/nvim-tree.lua/blob/5ad87620ec9d1190d15c88171a3f0122bc16b0fe/.github/workflows/ci.yml#L89
The related check script then uses that or defaults to /usr/share/nvim/runtime
https://github.com/nvim-tree/nvim-tree.lua/blob/8f974879a04b93fff68b4627087782e76cdf2ed0/scripts/luals-check.sh#L6
We're using the same action here so everything should Just Work.
|
||
Add the icon to table **1.** if the icon is for a file that is always named that way, for example `.gitconfig`. | ||
Add the icon to table **2.** if the icon is for all files with an extension, for example `vim`. | ||
Add the icon to table **3.**, **4.**, **5.** if the icon is from an OS, DE or WM. |
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.
Thank you!
@@ -0,0 +1,25 @@ | |||
#!/usr/bin/env bash |
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.
Shellcheck OK
Looks like we do need bash (not /bin/sh) for the pattern matching.
@@ -4,22 +4,24 @@ Thank you for your contribution! | |||
|
|||
## Order | |||
|
|||
Please ensure `icons_by_filename`, `icons_by_file_extension` and `filetypes` are ordered alphabetically, to prevent merge conflicts. | |||
Please ensure `icons_by_filename`, `icons_by_file_extension`, `icons_by_operating_system`, `icons_by_desktop_environment`, |
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.
I'm easy either way, although links often end up >80
Dumb question 1: Could we generate these mappings at runtime, rather than compile time? Users may have installed other filetypes. The mapping would still need to exist, for unconventional mappings like It looks like we could use vim.fn.getcompletion("", "filetype", false) at startup. |
Dumb question 2: edit: never mind, I didn't read the doc |
Or let users add new filetypes on the config file so if they have more filetypes they know they have to also include it. |
Yes, that is necessary and we have many cases. I'm happy whichever way you go. |
Looking good, I created a branch to test: #534 The script doesn't fail when a file type is missing:
It's going to need to return non-zero (1 will do) when a type is missing, so that CI can fail. |
It looks like I've instrumented the script to show what's present: https://github.com/nvim-tree/nvim-web-devicons/actions/runs/12539821919/job/34966371519?pr=535 It looks like we can use |
Added filetypes to required CI runs |
Nice! Glad it worked |
Based on the script: #433 (comment)