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
Problem: trim() always trims both ends.
Solution: Add an argument to only trim the beginning or end. (Yegappan
Lakshmanan, closesvim/vim#6126)
2245ae18e3
Problem: Not enough testing for the Ruby interface.
Solution: Add more tests. (Dominique Pelle, closesvim/vim#3252)
edd6aacb01
Modified some tests to make them pass for Neovim.
Some tests will always fail because +ruby is externalized in Neovim.
Skip failing ruby tests for now.
Also allow to get parser ranges.
This will be useful for language injection, allowing us to tweak the
parser's ranges on the fly.
Update runtime/lua/vim/treesitter.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
Runtime queries just work like ftplugins, that is:
- Queries in the `after` directory are sourced _after_ the "base" query
- Otherwise, the last define query takes precedence.
Queries can be found in the `queries` directory.
Update runtime/lua/vim/treesitter/query.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
Problem: Quickfix buffer shows up in list, can't get buffer number.
Solution: Make the quickfix buffer unlisted when the quickfix window is
closed. get the quickfix buffer number with getqflist().
(Yegappan Lakshmanan, closesvim/vim#4113)
647e24ba3d
Problem: Cannot easily change the current quickfx list index.
Solution: Add the "idx" argument to setqflist(). (Yegappan Lakshmanan,
closesvim/vim#3701)
5b69c22fd2
Problem: Dictionary with string keys is longer than needed.
Solution: Use *{key: val} for literaly keys.
d5abb4c877
Vim's popup,textprop features are N/A.
Neovim has not polyfilled their APIs.
Skip docs and tests for these features.
In #8226 <A-x> and <M-x> were changed to behave like <Esc>x in insert
mode when no mapping exists. This commit backs out that change and
replaces it with a more general one that makes unmapped ALT and META
keypresses as <Esc>+char in all modes. This fixes an unnecessary and
confusing inconsistency between modes.
- The previous commit lost information in the tests. Instead, add some
more "normalization" substitutions in pcall_err(), so that the general
shape of the stacktrace is included in the asserted text.
- Eliminate contains(), it is redundant with matches()
Problem: 'verbose' value 16 causes duplicate output.
Solution: Combine levels 15 and 16 into one message. (Christian Brabandt,
closesvim/vim#6153)
823654bc06
Problem: Spell checking doesn't work for CamelCased words.
Solution: Add the "camel" value in the new option 'spelloptions'.
(closesvim/vim#1235)
362b44bd4a
* lsp: remove popup No signature available.
If no signatures. we shouldn't popup No signature available ..It will make noise when use
` api.nvim_command("autocmd CompleteDone <buffer> lua vim.lsp.buf.signature_help()")`
* fix ci test failed remove whitespace
* print message when no signature help
* Add comment
- TUI: Fix a case where the cursor was not displayed after hiding the
cursor and then setting it to be displayed again.
- Change to reset everything before setting guicursor.
fixes#12800close#12811
Steps to reproduce:
nvim -u NORC
:set termguicolors
:hi nCursor guifg=red guibg=red
:hi iCursor guifg=green guibg=green
:hi cCursor guifg=blue guibg=blue
:set guicursor=n:block-nCursor,i:hor25-iCursor,c:ver25-cCursor
:set guicursor-=c:ver25-cCursor
Actual behaviour: Cursor is a blue vertical.
Expected behaviour: Cursor should be the default color block.
* docs: Add hint for :help vim.lsp.buf for new users
* fix: Use help linker for vim.lsp.buf
* docs: Extend full api list language. Move gd to bottom. Add note about limited support
This will significantly reduce the parsing work
needed e.g. when rehighlighting after every keypress
in insert mode.
Also add safety check for tree-sitter trying to read
past the end of a line. This can happen after we sent
an incorrect buffer update.
Problem: ruby#Detect() and node#Detect() don't return a [prog, err] pair
which means callers must special-case them.
Solution: align their return signatures with the perl/pythonx providers.
* support for :perl, :perlfile, :perldo and perleval()
* document that the perl provider doesn't currently work on Windows
* document that the perl legacy interface is now also supported
* added perleval() documentation
* import legacy perl interface tests
* only perl 5.22+ is supported
* healtcheck: use g:perl_host_prog if its set instead
using just 'perl' isn't correct as it may not be the version requested.
ditto for 'cpanm', rather go through 'App::cpanminus' to find the latest
perl version
using just 'perl' isn't correct as it may not be the version requested.
ditto for 'cpanm', rather go through 'App::cpanminus' to find the latest
perl version
Fix #12623
problem: nvim_buf_get_lines(0) returns empty during startup, where no buffers are loaded yet.
solution: return empty object
Happens during startup, where buffer may not be loaded yet, because...
`source_startup_scripts()` is done before `edit_buffers()`:
9bb552875d/src/nvim/main.c (L362)9bb552875d/src/nvim/main.c (L480)
- remove redundant autocmd list
This "grouped" list is useless, it only gets in the way when searching
for event names.
- intro.txt: cleanup
- starting.txt: update, revisit
- doc: `:help bisect`
- mbyte.txt: update aliases 1656367b90. closes#11960
- options: remove 'guifontset'. Why:
- It is complicated and is used by almost no one.
- It is unlikely to be implemented by Nvim GUIs (complicated to parse,
specific to Xorg...).
Since 1c3ca4f18f, 2c1d12d0be, #7836, the "unix" and "slash" behavior
of 'sessionoptions'/'viewoptions' is always enabled, and the flags are
just ignored. There is no reason for that behavior to be configurable.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: Not so easy to interrupt a script programatically.
Solution: Add the interrupt() function. (Yasuhiro Matsumoto, closesvim/vim#2834)
67a2deb9cb
Problem: Cannot redefine user command without ! in same script
Solution: Allow redefining user command without ! in same script, like with
functions.
55d4691308
Problem: Sign column takes up space. (Adam Stankiewicz)
Solution: Optionally put signs in the number column. (Yegappan Lakshmanan,
closesvim/vim#4555, closesvim/vim#4515)
394c5d8870
I removed the SunOS stuff since no one uses SunOS and I've never tested
it on there.
I removed the section_flag init as we can just use -S instead of -s
and -S is used by every implementation as far as I know.
This brings man#init's time from 50-70ms to 15-20ms for me.
Closes#12318
Related #6766
Related #6815
* LSP: Add support for call hierarchies
* LSP: Add support for call hierarchies
* LSP: Add support for call hierarchies
* LSP: Jump to call location
Jump to the call site instead of jumping to the definition of the
caller/callee.
* LSP: add tests for the call hierarchy callbacks
* Fix linting error
Co-authored-by: Cédric Barreteau <>
Problem: When evaluating 'statusline' the current window is unknown.
(Daniel Hahler)
Solution: Set "g:actual_curwin" for %{} items. Set "g:statusline_winid"
when evaluationg %!. (closesvim/vim#4406, closesvim/vim#3299)
1c6fd1e100
Autoread now works in TUI too. The checktimestamp test is run at most once every 2 seconds not to poll too much and also because it doesn't make sense on some filesystems. A solution based on filesystem notifications should arrive soon.
* Fix some small doc issues
* doc: fixup
* doc: fixup
* Fix lint and rebase
* Remove bad advice
* Ugh, stupid mpack files...
* Don't let people include these for now until they specifically want to
* Prevent duplicate tag
* LSP: Add tests & use nvim_buf_get_lines in locations_to_items
This is to add support for cases where the server returns a URI in the
locations that does not have a file scheme but needs to be loaded via a
BufReadCmd event.
* LSP: Don't iterate through all lines in locations_to_items
* fixup! LSP: Don't iterate through all lines in locations_to_items
* fixup! fixup! LSP: Don't iterate through all lines in locations_to_items
* fixup! fixup! fixup! LSP: Don't iterate through all lines in locations_to_items
Problem: Syntax foldlevel is taken from the start of the line.
Solution: Add ":syn foldlevel" to be able to use the minimal foldlevel in the line.
e35a52aee7
With `foldmethod=syntax` the foldlevel of a line is computed based
on syntax items on the line. Previously we always used the level
of the syntax item containing the start of the line. This works
well in cases such as:
if (...) {
...
}
else if (...) {
...
}
else {
...
}
which folds like this:
+--- 3 lines: if (...) {---------------------------
+--- 3 lines: else if (...) {----------------------
+--- 3 lines: else {-------------------------------
However, the code:
if (...) {
...
} else if (...) {
...
} else {
...
}
folds like this:
+--- 7 lines: if (...) {---------------------------
We can make the latter case fold like this:
+--- 2 lines: if (...) {---------------------------
+--- 2 lines: } else if (...) {--------------------
+--- 3 lines: } else {-----------------------------
by choosing on each line the lowest fold level that is followed
by a higher fold level.
Add a syntax command
:syntax foldlevel [start | minimum]
to choose between these two methods of computing the foldlevel of
a line.
The client creates buffers on the fly to be able to apply text edits on
files that weren't previously open, which is great, but it uses the
bufadd() function, which creates unlisted buffers and can lead to a
weird experience in the text editor. Setting the buffer to buflisted
fixes this.
Closes#12488.
Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
* lsp: support custom hl groups in show_line_diagnostics
Closes#12472.
* runtime: add docs for the new lsp highlight groups
Co-authored-by: francisco souza <fsouza@users.noreply.github.com>