| Commit message (Collapse) | Author | Age |
... | |
| |\ \
| | | |
| | | |
| | | | |
feat(lsp): add function to get semantic tokens at cursor
feat: `vim.inspect_pos()`, `vim.show_pos()` and `:Inspect[!]`
|
| | | | |
|
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
While `return` and `return nil` are for most intents and purposes
identical, there are situations where they're not. For example,
calculating the amount of values via the `select()` function will yield
varying results:
```lua
local function nothing() return end
local function null() return nil end
select('#', nothing()) -- 0
select('#', null()) -- 1
```
`vim.tbl_get` currently returns both nil and no results, which makes it
unreliable to use in certain situations without manually accounting for
these discrepancies.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
fix(treesitter): check buffer is loaded when restoring options
Also restore spelloptions
Fixes #21416
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
detection (#21417)
Problem: Conflict between supercollider and scala filetype detection.
Solution: Do not check for "Class : Method", it can appear in both
filetypes. (Chris Kipp, closes vim/vim#11699)
https://github.com/vim/vim/commit/70ef3f546b6ef83e463e91b7e388d9c68ad58894
Co-authored-by: Chris Kipp <ckipp@pm.me>
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Apply semantic token modifiers as separate extmarks with corresponding
highlight groups (e.g., `@readonly`). This is a low-effort PR to enable
the most common use cases (applying, e.g., italics or backgrounds on top
of type highlights; language-specific fallbacks like `@global.lua` are
also available). This can be replaced by more complicated selector-style
themes later on.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of testing for every possible modifier type, only test bits up
to the highest set in the token array. Saves many bit ops and
comparisons when there are no modifiers or when the highest set bit is a
lower bit than the highest possible in the legend on average.
Can be further simplified when non-luaJIT gets the full bit module (see #21222)
|
| |
| |
| | |
Closes https://github.com/neovim/neovim/issues/18225
|
| |
| |
| |
| |
| |
| | |
- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most
errors in pi_netrw.txt, so we can remove that workaround from
ignore_parse_error().
- improved codeblock
|
| |
| |
| |
| |
| |
| |
| |
| | |
The spec indicates that the response may be `null`, but it doesn't
really say what a `null` response means. Since neovim raises an error if
the response is `null`, I figured that ignoring it would be the safest
bet.
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
|
| |
| |
| | |
Follow up to https://github.com/neovim/neovim/pull/21337
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1. The algorithm for applying edits was slightly incorrect. It needs to
preserve the original token list as the edits are applied instead of
mutating it as it iterates. From the spec:
Semantic token edits behave conceptually like text edits on
documents: if an edit description consists of n edits all n edits are
based on the same state Sm of the number array. They will move the
number array from state Sm to Sm+1.
2. Schedule the semantic token engine start() call in the
client._on_attach() function so that users who schedule_wrap() their
config.on_attach() functions (like nvim-lspconfig does) can still
disable semantic tokens by deleting the semanticTokensProvider from
their server capabilities.
|
| |
| |
| |
| |
| |
| | |
* credit to @smolck and @theHamsta for their contributions in laying the
groundwork for this feature and for their work on some of the helper
utility functions and tests
|
| |
| |
| |
| | |
This is necessary for now to support filetypes that use a parser with a
different name (e.g. the "terraform" filetype uses the "hcl" parser).
|
| |
| |
| |
| |
| |
| |
| | |
Add a "show_tree" function to view a textual representation of the
nodes in a language tree in a window. Moving the cursor in the
window highlights the corresponding text in the source buffer, and
moving the cursor in the source buffer highlights the corresponding
nodes in the window.
|
| | |
|
| |
| |
| |
| |
| | |
`willSaveWaitUntil` allows servers to respond with text edits before
saving a document. That is used by some language servers to format a
document or apply quick fixes like removing unused imports.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Zir files are not recognized.
Solution: Add a pattern for Zir files. (closes vim/vim#11664)
https://github.com/vim/vim/commit/25201016d5043954689a4c9f7833935294149404
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
- use pcall when calling vim.secure.read from C
- catch keyboard interrupts in vim.secure.read, rethrow other errors
- selecting "view" in prompt runs :view command
- simplify lua stack cleanup with lua_gettop and lua_settop
Co-authored-by: ii14 <ii14@users.noreply.github.com>
|
| |
| |
| | |
Closes https://github.com/neovim/neovim/issues/21052
|
| |
| |
| |
| | |
Closes https://github.com/neovim/neovim/issues/21177
|
| | |
|
| |
| |
| |
| | |
(#21271)
|
| |\
| | |
| | | |
feat(help): highlighted codeblocks
|
| | | |
|
| |/
| |
| |
| | |
Avoid using vim.env and vim.fn in vim.fs functions so that
they can be used in "fast" contexts.
|
| |
| |
| |
| |
| | |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce vim.secure.trust() to programmatically manage the trust
database. Use this function in a new :trust ex command which can
be used as a simple frontend.
Resolves: https://github.com/neovim/neovim/issues/21092
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: ii14 <ii14@users.noreply.github.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Eclipse preference files are not recognized.
Solution: Add a pattern to use "jproperties" for Eclipse preference files.
(closes vim/vim#11618)
https://github.com/vim/vim/commit/f3f198b6349fe252b72975701e2f17d932b19c70
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#21174)
* vim-patch:9.0.0935: when using dash it may not be recognize as filetype "sh"
Problem: When using dash it may not be recognize as filetype "sh".
Solution: Add checks for "dash". (Eisuke Kawashima,closes vim/vim#11600)
https://github.com/vim/vim/commit/24482fbfd599d2273c48951df7d00d62f3e66c85
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Oblivion files are not recognized.
Solution: Recognize Oblivion files and alike as "obse". (closes vim/vim#11540)
https://github.com/vim/vim/commit/ecfd511e8d802068434735dda00db6b783df6922
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#21183)
Problem: Workflow Description Language files are not recognized.
Solution: Add a pattern for the "wdl" filetype. (Matt Dunford,
closes vim/vim#11611)
https://github.com/vim/vim/commit/f60bdc3417a56a1f69e001a7ec210b92d5b0f2e1
Co-authored-by: Matt Dunford <zenmatic@gmail.com>
|
| |
| |
| |
| | |
Co-Authored-By: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-Authored-By: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Mermaid files are not recognized.
Solution: Add patterns for Mermaid. (Crag MacEachern)
https://github.com/vim/vim/commit/364438d1e817d1d76003695f9ab533df35f8948a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| | |
Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #18687
This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.
It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
|
| |
| |
| |
| |
| | |
* fix(diagnostic): use api variable and improve validate
* fix: fix test case
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Language servers can take some time to respond to the
`textDocument/hover` and `textDocument/signatureHelp` messages. During
that time, the user could have already moved to another buffer. The
popup was always shown in the current buffer, which could be a different
one than the buffer for which the request was sent.
This was particularly annoying when moving to a buffer with a `BufLeave`
autocmd, as that autocmd was triggered when the hover popup was shown
for the original buffer.
Ignoring the response from these 2 messages if they are for a buffer
that is not the current one leads to less noise. The popup will only be
shown for the buffer for which it was requested.
A more robust solution could involve cancelling the hover/signatureHelp
request if the buffer changes so the language server can free its
resources. It could be implemented in the future.
|
| |
| |
| |
| | |
To illustrate a use-case this also changes `window/showMessageRequest`
to use `vim.ui.select`
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Clinical Quality Language files are not recognized.
Solution: Add the "*.cql" pattern. (Matthew Gramigna, closes vim/vim#11452)
https://github.com/vim/vim/commit/12babe45a389cd1ea8befd5b06239e877b4abbba
Co-authored-by: mgramigna <mgramigna@mitre.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
|
| |
| |
| |
| |
| |
| |
| |
| | |
style: changed double quotes to single quotes
feat: add tests
fix tests
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Followup to #20883
Related: #18144
This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `<C-c>`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `<C-c>` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `<Esc>`.
I can think of three good reasons why the behavior should be this way:
1. Easier for the user to understand** It's not intuitive for there to be two
ways to abort an input dialog that have _different_ outcomes. As a user,
I would expect any action that cancels the input to leave me in the same
state. As a plugin author, I see no value in having two possible outcomes for
aborting the input. I have to handle both cases, but I can't think of
a situation where I would want to treat one differently than the other.
2. Provides an API that can be overridden by other implementations** The current
contract of "throw an error upon `<C-c>`" cannot be replicated by async
implementations of `vim.ui.input`. If the callsite wants to handle the case
of the user hitting `<C-c>` they need to use `pcall(vim.ui.input, ...)`,
however an async implementation will instantly return and so there will be no
way for it to produce the same error-throwing behavior when the user inputs
`<C-c>`. This makes it impossible to be fully API-compatible with the
built-in `vim.ui.input`.
3. Provides a useful guarantee to the callsite** As a plugin author, I want the
guarantee that `on_confirm` will _always_ be called (only catastrophic errors
should prevent this). If I am in the middle of some async thread of logic,
I need some way to resume that logic after handing off control to
`vim.ui.input`. The only way to handle the `<C-c>` case is with `pcall`,
which as already mentioned, breaks down if you're using an alternative
implementation.
|