Until we support dynamicRegistration, we should handle the client/registerCapability in core. There are still some language servers that send this request despite dynamicRegistration not being registered client-side (we got an upstream fix for the node ones, but this depends on them bumping vscode-languageserver-node).
This function returns the start and stop value if set else the node's range is used
When the node's range is used, the stop is incremented by 1 to make the search inclusive
Problem: When using ":sleep" the cursor is always displayed.
Solution: Do not display the cursor when using ":sleep!". (Jeremy Lerner,
closesvim/vim#7688)
e2edc2ed4a
Cursor showing/hiding is moved from core to TUI.
":sleep!" behaves the same as ":sleep".
Add support for default start and end row when omitted in the
query:iter_captures and query:iter_matches functions.
When the start and end row values are omitted, the values of the given
node is used. The end row value is incremented by 1 to include the node end
row in the match.
Updated tests and docs accordingly.
while there is some controversy, stdpath('cache') looks like a better fit for logs than stdpath('data'): you can remove logs without preventing nvim to work which fits the XDG_CACHE_HOME definition of `user specific non-essential data files`.
pyright (possibly others) does not send any hint diagnostics if we do not have tagSupport in PublishDiagnosticsClientCapabilities. This PR just adds them.
Problem: No 'backspace' value allows ignoring the insertion point.
Solution: Add the "nostop" and 3 values. (Christian Brabandt, closesvim/vim#5940)
aa0489e12d
Only the plugin/package manager should "manage" after/. Consumers of
nvim_get_runtime_file() should not need to special case it (if your plugin
manager is broken then fix it instead).
Don't use vim.fn.readfile(). Lua can already read files. It is even
better at it than vim script.
expose M.get_query_files(). Listing the queries is essential for user
config debug, and let plugins do fun things with it.
Abstraction-by-obscurity is not useful (plugins can just cargo cult copy
the code anyway, better with public entry points).
Problem: Cannot easily get all the current marks.
Solution: Add getmarklist(). (Yegappan Lakshmanan, closes#6032)
cfb4b47de0
Cherry-pick the column number fix from patch v8.2.0871
because patch v8.2.0871 cannot be fully ported
without the method patches.
Co-authored-by: Peter Wolf <pwolf2310@gmail.com>
Problem: Quickfix entries do not suport a "note" type.
Solution: Add support for "note". (partly by Yegappan Lakshmanan,
closesvim/vim#5527, closesvim/vim#6216)
e928366de5
Change the update of the client.messages.progress table to overwrite only the percentage and message properties on $report, Previously we were overwriting the table which meant client.messages.progress[token].message.title was wiped on report.
before the behaviour of 'mouse' was inconsistent in external UI,
as some remapping logic would check has_mouse() and others don't
(no difference in TUI or vim classic). With this change, the behaviour
is consistently up to the UI decide (see ui.txt edit)
Behaviour of tui.c is unaffected by this change.
Problem: Cannot navigate to errors before/after the cursor.
Solution: Add the :cbefore and :cafter commands. (Yegappan Lakshmanan,
closesvim/vim#4340)
cf6a55c4b0
Problem: No error for quickfix commands with negative range.
Solution: Add ADDR_UNSIGNED and use it for quickfix commands. Make
assert_fails() show the command if the error doesn't match.
25190db225
N/A patches for version.c:
vim-patch:8.2.0113: "make cmdidxs" fails
Problem: "make cmdidxs" fails.
Solution: Allow address for ":cquit". Add --not-a-term to avoid a delay.
9b24dfcb9f
Problem: Cannot see the selection type in :reg output. (Ayberk Aydın)
Solution: Add c/l/b. (Christian Brabandt, closesvim/vim#5110, closesvim/vim#4546)
3691f1ee72
Patch v8.1.0999 is not ported so ":registers" does not omit register 1.
When using "au User LspDiagnosticsChanged redrawstatus!", modelines get processed again (see h: doautocmd). Fortunately this can be suppressed using the <nomodeline> flag. this replaces every doautocmd call, that issues a User command, with doautocmd <nomodeline>.
"set foldcolumn=auto" is documented but not supported.
Support it by making it behave as "auto:1", similar to "signcolumn".
Close https://github.com/neovim/neovim/pull/13561
According to the specification[1] the payload must look like this:
interface DidSaveTextDocumentParams {
/**
* The document that was saved.
*/
textDocument: TextDocumentIdentifier;
/**
* Optional the content when saved. Depends on the includeText value
* when the save notification was requested.
*/
text?: string;
}
`text` must be on the same level as `textDocument´.
Where `TextDocumentIdentifier` is:
interface TextDocumentIdentifier {
/**
* The text document's URI.
*/
uri: DocumentUri;
}
[1]: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave
- If the shada file is set with shada option n, use it.
- If the shadafile is NONE, it does not check for file read/write access.
- If the shada file does not exist, try to create it.
Apparently the new version of LuaJIT changed the consistency with which it
sorted table dictionaries. IIRC lua sorts dictionary keys by memory address, so
it would appear that the reasons tests were previously passing was because of
a differentiation in the implementation of the lua runtime.
Ensure that array fields in the lsp protocol tables are consistently created,
by using ipair when generating arrays for completionItemKind and
symbolItemKind.
For CodeActionKind, the current implementation includes both the keys and the
values in the array. This is incorrect. Ensure that only the values are
included in the array and sort them for consistency.
Opt in to this secret world using
set wildchar=0
" already the default, but remove if non-zero existing config:
set wildcharm=0
now you can map 'wildmode' just like any mode:
cnoremap <tab> <c-z>
function! Spacey()
return getcmdline()[-1:] == "/" ? "\<bs>" : ""
endfunc
cnoremap <expr> / wildmenumode() ? Spacey()."/<c-z>" : "/"
Possibly asked questions:
What about backwards compatibility?
====
Just do nothing and your existing 'wildchar' and 'wildcharm' will keep working.
Doesn't `<c-z>` mean suspend?
====
Not in cmdline mode. If it would then the recommended wildcharm would not
have been `<c-z>` to start with.
My config relies on `:<c-z>` being a synonym to `:<nop>`!
====
just no.
Here I use a negative number to decide whether the count has been
explicitly set. I think it unlikely that negative sections will ever be
created given that negative numbers complicate argument handling:
```
$ man -1 foo
man: invalid option -- '1'
```
and given that there's already precedence for alphanumeric sections like
`3p`, `3x`, `n`, etc.
---
This does work, though:
```
$ man -S -3 baz
```
With `man baz.-3` and `man 'baz(-3)'`, (GNU) man *might* consider `-3`
internally as a section, but in the end reports as if the whole
argument was the name of a topic:
```
$ man 'baz(-3)'
No manual entry for baz(-3)
```
---
Closes#13411.
* First implementation of workspace folders
* Add completion for current directory
* Add tracking of workspace folders
* Add workspace folder listing
* Add checks on adding/removing workspaces
* Add appropriate initialization options
* Add documentation
* Make workspaceFolders available wherever client is
Problem: Cannot get window type for autocmd and preview window.
Solution: Add types to win_gettype(). (Yegappan Lakshmanan, closesvim/vim#6277)
0fe937fd86
Cherry-pick test_preview.vim,test_window_cmd.vim changes
from patch v8.2.0522.
In commit 63f0ca3263, `tagfunc` was introduced to
`runtime/autoload/man.vim`. Nonetheless the tag function instead
of using a short buffer name (e.g. `man://foo(3)`) uses the full
path to the man page (e.g. `man:///usr/share/.../foo.3.gz`). This
behaviour is inconsistent with `:Man!`, thus this commit.
Closes#13334
Problem: MS-Windows: shell commands fail if &shell contains a space.
Solution: Use quotes instead of escaping. (closesvim/vim#4920)
2efc44b3f0
Always double-quote &shell if it contains a space.
Neovim does not support escaping space with backslash, unlike Vim.
N/A patches for version.c:
vim-patch:8.0.1455: if $SHELL contains a space then 'shell' is incorrect
Problem: If $SHELL contains a space then the default value of 'shell' is
incorrect. (Matthew Horan)
Solution: Escape spaces in $SHELL. (Christian Brabandt, closesvim/vim#459)
4bfa8af141
vim-patch:8.2.1194: test failure because shell prompt differs
Problem: Test failure because shell prompt differs.
Solution: Set the shell prompt.
a4dc6f92bb
Implement the LanguageTree structure to enable language injection.
This is done be removing the old Parser metatable and replacing by the
new structure, with the same API (almost).
Some noticeable differences :
- `parser:parse()` now returns a table of trees
- There is no incremental parsing for child (injected) languages
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
Problem: Cabalconfig and cabalproject filetypes not recognized.
Solution: Detect more cabal files. (Marcin Szamotulski, closesvim/vim#7339)
dcbab75db3
N/A patches for version.c:
vim-patch:8.1.1598: update to test file missing
Problem: Update to test file missing.
Solution: Update the popup window test file.
53a95d6584
vim-patch:8.1.1601: missing changes to popup window test file
Problem: Missing changes to popup window test file.
Solution: Add those changes.
8da4181631
* lsp: Remove duplicate `diagnostics` fallback in diagnostic.display
* lsp: Expose all diagnostics
Before the changes in #12655 it was possible to retrieve all diagnostics
via `vim.lsp.util.diagnostics_by_buf`.
This adds a `diagnostic.get_all()` to enable users to retrieve all
diagnostics.
Use cases for that could include loading all diagnostics into the
quickfix list, or to build an enhanced goto_next that can move across
buffers.
Breaking Changes:
- Deprecated all `vim.lsp.util.{*diagnostics*}()` functions.
- Instead, all functions must be found in vim.lsp.diagnostic
- For now, they issue a warning ONCE per neovim session. In a
"little while" we will remove them completely.
- `vim.lsp.callbacks` has moved to `vim.lsp.handlers`.
- For a "little while" we will just redirect `vim.lsp.callbacks` to
`vim.lsp.handlers`. However, we will remove this at some point, so
it is recommended that you change all of your references to
`callbacks` into `handlers`.
- This also means that for functions like |vim.lsp.start_client()|
and similar, keyword style arguments have moved from "callbacks"
to "handlers". Once again, these are currently being forward, but
will cease to be forwarded in a "little while".
- Changed the highlight groups for LspDiagnostic highlight as they were
inconsistently named.
- For more information, see |lsp-highlight-diagnostics|
- Changed the sign group names as well, to be consistent with
|lsp-highlight-diagnostics|
General Enhancements:
- Rewrote much of the getting started help document for lsp. It also
provides a much nicer configuration strategy, so as to not recommend
globally overwriting builtin neovim mappings.
LSP Enhancements:
- Introduced the concept of |lsp-handlers| which will allow much better
customization for users without having to copy & paste entire files /
functions / etc.
Diagnostic Enhancements:
- "goto next diagnostic" |vim.lsp.diagnostic.goto_next()|
- "goto prev diagnostic" |vim.lsp.diagnostic.goto_prev()|
- For each of the gotos, auto open diagnostics is available as a
configuration option
- Configurable diagnostic handling:
- See |vim.lsp.diagnostic.on_publish_diagnostics()|
- Delay display until after insert mode
- Configure signs
- Configure virtual text
- Configure underline
- Set the location list with the buffers diagnostics.
- See |vim.lsp.diagnostic.set_loclist()|
- Better performance for getting counts and line diagnostics
- They are now cached on save, to enhance lookups.
- Particularly useful for checking in statusline, etc.
- Actual testing :)
- See ./test/functional/plugin/lsp/diagnostic_spec.lua
- Added `guisp` for underline highlighting
NOTE: "a little while" means enough time to feel like most plugins and
plugin authors have had a chance to refactor their code to use the
updated calls. Then we will remove them completely. There is no need to
keep them, because we don't have any released version of neovim that
exposes these APIs. I'm trying to be nice to people following HEAD :)
Co-authored: [Twitch Chat 2020](https://twitch.tv/teej_dv)
:cquit can use count to set the exit code
patch 8.2.0095: cannot specify exit code for :cquit
:tchdir tab-local current-directory
patch 8.1.1218: cannot set a directory for a tab page
Autocmd Events:
- DirChanged
patch 8.0.1459: cannot handle change of directory
- TextYankPost
patch 8.0.1394: cannot intercept a yank command
tabpagenr() "#" argument
g<Tab> goes to the last-accessed tabpage.
patch 8.2.1401: cannot jump to the last used tabpage
hl-QuickFixLine
patch 8.0.0641: cannot set a separate highlighting for the quickfix line
v:event
patch 8.0.1394: cannot intercept a yank command
K in help documents can be used like CTRL-].
Updated as part of a runtime update.
4c05fa08c9
This reverts the handling of base languages to the old way how
nvim-treesitter handled them. When a language extends a base language
it usually wants to be able to overwrite queries.
Related: https://github.com/nvim-treesitter/nvim-treesitter/issues/633
buf_request_sync returns a table indexed by the client id, so when
starting a second client on a separate buffer, result[1] will be nil.
Closes#13232.
Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
- Describe query components (capture, match, pattern). Not
well-described in tree-sitter documentation.
- Describe Query() object. Not actually described anywhere in
documenation.
Problem: Pragmas are indented all the way to the left.
Solution: Add an option to indent progmas like normal code. (Max Rumpf,
closesvim/vim#5468)
d881b516da
N/A patches for version.c:
vim-patch:8.1.2030: tests fail when build with normal features and terminal
Problem: Tests fail when build with normal features and terminal.
(Dominique Pelle)
Solution: Disable tests that won't work. (closesvim/vim#4932)
997d42427e
vim-patch:8.1.2063: some tests fail when +balloon_eval_term is missing
Problem: Some tests fail when +balloon_eval_term is missing but
_balloon_eval is present. (Dominique Pelle)
Solution: Check the right feature in the test. (closesvim/vim#4962)
1e82a784ac
vim-patch:8.2.1938: wiping out a terminal buffer makes some tests fail
Problem: Wiping out a terminal buffer makes some tests fail.
Solution: Do not wipe out the terminal buffer unless wanted.
a46765a797
We support applying all kinds in the spec equivalently and some servers (including dartls) won't send code actions if support for the relevant kinds is not explicitly stated in the client capabilities. Therefore, this PR makes that support explicit.
Also, as we support all CodeActionKinds, we should also mark the server as supporting code actions when it specifies code action kinds. This is also done in this PR.
Problem: Number of status line items is limited to 80.
Solution: Dynamically allocate the arrays. (Rom Grk, closesvim/vim#7181)
8133cc6bf4
The members of stl_item_T have not been prefixed with stl_ contrary to
the vim patch because the amount of stl_ prefixes on single lines of
code in that region was hurtful to readability.
We don't actually support snippets in core in the way that users would
truly expect. So, by default, we will not say that builtin-lsp has
`snippetSupport`.
To re-enable, users can do the following:
First, get a capabilities dictionary with
`local capabilities = vim.lsp.protocol.make_client_capabilities()`
Then override
`capabilities.textDocument.completion.completionItem.snippetSupport = true`
and then pass those capabilties to the setup function.
```
nvim_lsp.server_name.setup {
...,
capabilities = capabilities,
...,
}
```
See https://github.com/neovim/neovim/issues/12795
To avoid loading buffers https://github.com/neovim/neovim/pull/12440
changed the logic to not process diagnostics for unloaded buffers.
This is problematic for language servers where compile errors or build
errors are reported via diagnostics. These errors may prevent the
language server from providing all functions and it is difficult for
users to debug it without having access to the errors.
For example, with eclipse.jdt.ls there may be a problem with gradle (the
build tool for java), it results in a diagnostics like this:
org.gradle.toolingapi/build.gradle|1 col 1| Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8.1-bin.zip'.
This would be invisible to users unless the user happens to open the
right file. In this case the user would actually never see the error,
because the language server isn't attached to the build configuration
files.
This changes the behaviour to at least store the diagnostics. The other
operations which are more expensive are still skipped.
Refactors how required capabilities are detected and validated, and make
sure requests are only sent to clients that support it (and only fail if
no clients support the provided method).
The validation happens at the buf_request level, because we assume that
if someone is sending the request directly through the client, they know
what they're doing. Also, let unknown methods go through.
This is extracted from #12518 and closes#12755.
Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
Language servers can already send log messages to the client while the
server is still being initialized.
This currently leads to "client has shut down" messages which are
confusing to the user as the server is properly starting.
To fix this this changes the `get_client_by_id` method to also return a
client if it is still initializing.
Problem: Can't do something just before leaving Insert mode.
Solution: Add the InsertLeavePre autocommand event. (closesvim/vim#7177)
b53e13a91a
N/A patches for version.c:
vim-patch:8.1.1877: graduated features scattered
Problem: Graduated features scattered.
Solution: Put graduated and obsolete features together.
ffc0716af8
vim-patch:8.2.1875: warning when building GTK gui
Problem: Warning when building GTK gui.
Solution: Add missing function parameter.
3da855c8e2
vim-patch:8.2.1877: test for function list fails
Problem: Test for function list fails.
Solution: Move "obsolete" comments one line up.
b8f519e538
vim-patch:8.2.1878: GTK: error for redefining function
Problem: GTK: error for redefining function. (Tony Mechelynck)
Solution: Remove "gtk_" prefix from local functions and prepend "gui_" to
global functions.
8a99e66b4f
vim-patch:8.2.1881: cannot build with GTK3
Problem: Cannot build with GTK3.
Solution: Adjust form functions.
692d1a51e7
vim-patch:8.2.1883: compiler warnings when using Python
Problem: Compiler warnings when using Python.
Solution: Adjust PyCFunction to also have the second argument. Use "int"
return type for some functions. Insert "(void *)" to get rid of
the remaining warnings.
4ce5fe4c87