Skip to content

fix: better file type detection#125

Closed
oskarrrrrrr wants to merge 1 commit intodmtrKovalenko:mainfrom
oskarrrrrrr:main
Closed

fix: better file type detection#125
oskarrrrrrr wants to merge 1 commit intodmtrKovalenko:mainfrom
oskarrrrrrr:main

Conversation

@oskarrrrrrr
Copy link
Copy Markdown
Contributor

@oskarrrrrrr oskarrrrrrr commented Aug 19, 2025

Fixes missing highlighting for some file types (e.g. typescript or bash).

Fixes: #122

@oskarrrrrrr
Copy link
Copy Markdown
Contributor Author

Are we okay with the dependency?

@dmtrKovalenko
Copy link
Copy Markdown
Owner

Actually not sure about it I think for such a simple function maybe we can just copy the code from plenary sources?

Fixes missing highlighting for some file types (e.g. typescript or
bash).
@oskarrrrrrr
Copy link
Copy Markdown
Contributor Author

Copied the minimum amount of code that does what we want. Removed detecting based on shebang and modeline because I don't think that they're too important (also I would have to copy/reimplement more code for handling files).

I still feel like it's a lot for such a simple feature. We could put the file from data folder inline in filetype.lua and simplify logic a bit. Should I do that?

@dmtrKovalenko
Copy link
Copy Markdown
Owner

Can't push to your branch for some reason please apply this change to pass CI if possible

diff --git a/_typos.toml b/_typos.toml
index 0354a1a..e93f479 100644
--- a/_typos.toml
+++ b/_typos.toml
@@ -1,5 +1,5 @@
[files]
-extend-exclude = ["/CHANGELOG.md"]
+extend-exclude = ["/CHANGELOG.md", "data/filetypes/base.lua"]

[default.extend-words]
noice = "noice"

@dmtrKovalenko
Copy link
Copy Markdown
Owner

closing in favor of #129 I can not push to your branch

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.

No syntax highlighter for .ts files

2 participants