-
Notifications
You must be signed in to change notification settings - Fork 8
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
ftdetect tests fail in Neovim 0.10 #89
Comments
Manually removing those lines from Where is the incorrect shebang-based filetype detection coming from? Can we block or override it somehow (without impacting any filetypes other than justfiles)? |
Fixed in b46dabb . Remaining failures:
|
Hmmmmmm that's very strange! I'm not sure why it being added upstream would change our behavior. |
Looking at the failures, what's wrong with those two lines? They look like valid shebangs to me. |
They are missing the Trying to use such shebang in a To make such shebang not result in an error, there must be a normal justfile runnable from the same directory as the script is located. In which case |
Given that this can be different depending on platform and you can set command line arguments ( |
It's already very permissive. The current match is Line 7 in b46dabb
|
Maybe this is why? - https://github.com/neovim/neovim/pull/22140/files Typically that would not be an unreasonable assumption. Initial testing suggests this code might work around the problem, but...somehow this doesn't feel like a good answer. if has("nvim-0.10")
call luaeval("vim.filetype.add({ extension = { just = function()\nreturn nil\nend } })")
endif IIUC a better solution would override this while doing all Neovim filetype detection in Lua, and wrap the autocmds in an Also found https://neovim.discourse.group/t/how-to-modify-filetype-detection-for-filename-extension/3994/2 which would explain why editing runtime file didn't work. |
Ok, I've played with it a bit and think we could try doing filetype detection by name in Lua for Neovim. That way we can disable the problematic extension-based matching without killing the benefits of Lua filetype detection for Neovim users. Let's keep the autocmd for file contents for both Vim and Neovim. I'll draft a PR. |
Fixed by #91 , filetype detection tests now pass locally in Vim 8.2 & 9.1.437, Neovim 0.4.3 / 0.8.3 / 0.9.5 / 0.10.0. |
These failures don't occur in Neovim <= 0.9.5 or in Vim.
It's not a bug in the test runner. Neovim 0.10.0 really does detect these as justfiles.
Turns out shebangs with repeated slashes like
#!/usr//bin/just -f
actually do work (at least on Xubuntu 22.04), so 2 of these 4 test cases are wrong. But the shebangs invokingjust
without flags are not correctjust
script shebangs and should not result in detection as justfile.The text was updated successfully, but these errors were encountered: