If nothing matched in match_from_hashbang, also check the file extension table.
For a hashbang like '#!/bin/env foo', this will set the filetype to 'fooscript'
assuming the filetype for the 'foo' extension is 'fooscript' in the extension
table.
The original motivation for this change came from developping
https://github.com/neovim/neovim/pull/22159, which will require adding
more autocommand creation to Neovim's startup sequence.
This change requires lightly editing a test that expected no autocommand
to have been created from lua.
- Render node ranges as virtual text
- Set filettype=query. The virtual text is to avoid parsing errors.
- Make sure highlights text is always in view.
Problem: Move language files are not recognized.
Solution: Recognize Move language files. (Amaan Qureshi, closesvim/vim#11947)
6642982bea
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
In a few places ipairs was used to iterate over elements of the array.
However, the first return value of ipairs was erronously used, which is
not the value, but rather the index. This would result in errors, for
instance when trying to retrieve a field from the value.
Problem: .clangd and .stylelintrc files don't get a filetype.
Solution: Use yaml for .clangd and json for .stylelintrc files. (Mark
Skelton, closesvim/vim#11916)
9c51798a1f
Co-authored-by: Mark Skelton <mdskelton99@gmail.com>
This value can not be relied on as it doesn't work for
multi-configuration generators. I don't think this undocumented option
is used much, if at all, so I think we should remove it.
Problem: NetworkManager connection files are not recognized.
Solution: Add a pattern for NetworkManager connection files. (closesvim/vim#11893)
04e4f1d985
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Problem: Some injections (like markdown) allow specifying arbitrary
language names for code blocks, which may be lead to errors when
looking for a corresponding parser in runtime path.
Solution: Validate that the language name only contains alphanumeric
characters and `_` (e.g., for `c_sharp`) and error otherwise.
`vim.lsp.buf.format()` silently did nothing if no servers supported
`textDocument/rangeFormatting` when formatting with a range.
Issue found by `@hwrd:matrix.org` in the Matrix chat.
Problem:
Build is not reproducible, because generated source files (.c/.h/) are not
deterministic, mostly because Lua pairs() is unordered by design (for security).
https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671https://www.lua.org/manual/5.1/manual.html#pdf-next
> The order in which the indices are enumerated is not specified [...]
>
>> The hardening of the VM deliberately randomizes string hashes. This in
>> turn randomizes the iteration order of tables with string keys.
Solution:
- Update the code generation scripts to be deterministic.
- That is only a partial solution: the exported function
(funcs_metadata.generated.h) and ui event
(ui_events_metadata.generated.h) metadata have some mpack'ed
tables, which are not serialized deterministically.
- As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can
inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0)
that preserves table order.
- Longer-term we should change the mpack'ed data structure so it no
longer uses tables keyed by strings.
Closes#20124
Co-Authored-By: dundargoc <gocdundar@gmail.com>
Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
According to the specification `workspace/applyEdit` must be called with
`ApplyWorkspaceEditParams`.
So far the client just returned, which could lead to a misleading error
on the server side because `workspace/applyEdit` must respond with a
`ApplyWorkspaceEditResult`.
This adds an assertion to clarify that the server is violating the
specification.
See https://github.com/neovim/neovim/issues/21925
Problem: On tmux v3.2+, the `terminal-features` option may be used to enable RGB
capabilities over `terminal-overrides`. However, `show-messages` cannot be used
to detect if RGB capabilities are enabled using `terminal-features`.
Solution: Try to use `display-message -p #{client_termfeatures}` instead.
The returned features include "RGB" if either "RGB" is set in
`terminal-features`, or if "Tc" or "RGB" is set in `terminal-overrides` (as
before).
Nothing is returned by tmux versions older than v3.2, so fallback to checking
`show-messages` in that case.
Also, un-Vimscriptify the previous logic a bit, and change the error message to
point to using the `terminal-features` option instead for newer tmux versions.
Regression from the health.vim to .lua changes.
Unlike Vim script, Lua does not implicitly convert strings to numbers, so this
comparison threw an error.
Problem: Some Bazel files are not recognized.
Solution: Add an extra Bazel pattern. (Keith Smily, closesvim/vim#11807)
3213952966
Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.