Commit Graph

18449 Commits

Author SHA1 Message Date
Björn Linse
e877eccafd refactor(lua): initialize lua state at startup instead of dynamically
lua is used as part of implementation for more core features. As an
example, every user keypress will invoke a lua function to check for
keypress handlers (regardless if they are registered or not). Thus not
starting lua until it is first used doesn't make much sense anymore.

nlua_enter was also needed due to the earlier stateful &rtp
translation, which by now have been made stateless.
2021-07-19 16:12:39 +02:00
Folke Lemaitre
c36df20aef
feat: aggregate code actions from all clients (#15121) 2021-07-18 01:58:35 -07:00
Oliver Marriott
5377b2b00a
fix(ci): remove mongodb from brew to avoid brew upgrade error (#15115)
macOS CI was failing because:

- brew upgrade fails because,
- mongodb-community cant upgrade because,
- some symlinks are owned by ...  mongodb-community...

We don't use mogodb, so we can just remove it wholesale.
2021-07-17 16:59:39 +02:00
Ido Ariel
d8f5f4d090
doc(lsp): various small fixes (#15113)
- remove incorrect usage of docstrings
- fix make_formatting_params return type documentation to 'DocumentFormattingParams'
- make progress_handler private
- fix links
2021-07-17 11:15:57 +02:00
Björn Linse
682247b52e
Merge pull request #15078 from bfredl/p_vim_vi
refactor(options): remove obsolete distinction of "vi" vs "vim" defaults
2021-07-14 22:21:57 +02:00
Björn Linse
f0cc3a9480 refactor(options): remove obsolete distinction of "vi" vs "vim" defaults
It might come as a schocking surprise, but the defaults we support
are the NEOVIM defaults.
2021-07-14 21:54:19 +02:00
Michael Lingelbach
19a2e59f7e
Merge pull request #15017 from donbex/local-file-uri
fix(lsp): accept file URIs without a hostname
2021-07-14 12:20:13 -07:00
Björn Linse
fc869da6dc refactor(options): delet unused P_VIM flag 2021-07-14 21:06:07 +02:00
Michael Lingelbach
c31bc6ea73
fix(lsp): pass bufnr for async formatting (#15084)
the `textDocument/rangeFormatting` nad `textDocument/formatting` did not
pass bufnr to apply_text_edits, meaning edits were applied to
the user's currently active buffer. This could result in text being
applied to the wrong buffer.
2021-07-14 09:15:43 -07:00
Björn Linse
02bf251bb3
Merge pull request #14812 from gpanders/stdin_closed
feat(job): add parameter to close stdin
2021-07-13 20:51:46 +02:00
Gregory Anders
f83763b261 Add test case for 'null' stdin mode 2021-07-12 13:22:56 -06:00
Gregory Anders
d7382475b3 Fix line length clint error 2021-07-12 12:17:44 -06:00
Gregory Anders
35e13df3c8 Rename stdin to stdin_mode
stdin is a macro in Windows builds.
2021-07-12 12:17:44 -06:00
Gregory Anders
eb7f24b4ae feat(job): add parameter to close stdin
Some programs behave differently when they detect that stdin is being
piped. This can be problematic when these programs are used with the job
control API where stdin is attached, but not typically used. It is
possible to run the job using a PTY which circumvents this problem, but
that includes a lot of overhead when simply closing the stdin pipe would
suffice.

To enable this behavior, add a new parameter to the jobstart options
dict called "stdin" with two valid values: "pipe" (the default)
implements the existing behavior of opening a channel for stdin and
"null" which disconnects stdin (or, if you prefer, connects it to
/dev/null). This is extensible so that other modes can be added in the
future.
2021-07-12 15:17:10 +02:00
Michael Lingelbach
eece0735fe
fix(lsp): avoid ipairs on non-sequential tables (#15059)
ipairs terminates on the first nil index when iterating over table keys:

for i,k in ipairs( {[1] = 'test', [3] = 'test'} ) do
  print(i, k)
end

prints:
1 test

Instead, use pairs which continues iterating over the entire table:

for i,k in pairs( {[1] = 'test', [3] = 'test'} ) do
  print(i, k)
end

prints:
1 test
3 test
2021-07-11 11:34:26 -07:00
ansimita
e5b75d41db
chore(clang): Fix 'Array subscript is undefined' #15057 2021-07-11 07:59:23 -07:00
Shadman
22b5381396
fixup(clipboard): Fix error not properly handled #14984
fixes #14967
2021-07-11 06:19:54 -07:00
Mathias Fussenegger
c21a6972a0 fix(lsp): Ensure human readable errors are printed
`return err_message(tostring(err))` caused errors to be printed as
`table: 0x123456789` instead of showing the error code and error
message.

This also removes some `if err` blocks that never got called because at
the end of `handlers.lua` all the handlers are wrapped with logic that
adds generic error handling.
2021-07-11 11:22:35 +02:00
Mathias Fussenegger
256570a7a6 fix(lsp): Ensure users get feedback on references/symbols errors or empty results
Relates to https://github.com/neovim/neovim/issues/15050

Users should get some indication if there was an error or an empty
result.
2021-07-11 10:57:00 +02:00
Daniel Steinberg
79fe9dedcf
window.c: address Coverity failure #14996
Check that `wip2` does not point to the same address as `wip`, to address the
Coverity test failure from PR #14884.

Based on the `if` clauses, `free_wininfo(wip2, ...)` is only called when
`wip2->wi_win == NULL` and `wip->wi_win == wp`. I think `wip2` would only point
to the same address as `wip` in scenarios where `wp` were `NULL`, which can be
assumed otherwise based on the earlier code.
2021-07-10 21:32:37 -07:00
Daniel Steinberg
936f3a4ddc
test/memory_usage_spec: skip on MacOS #15043
Memory compression could complicate the measurements.
2021-07-10 20:15:38 -07:00
Mathias Fußenegger
7c61d9c3bf
fix(lsp): Add separator between codelens in virttext (#15049)
Before:

  Lens1Lens2

After:

  Lens1 | Lens2

Fixes https://github.com/neovim/neovim/issues/15048
2021-07-10 21:35:38 +02:00
Oliver Marriott
0b64d5ecd1
fix(lsp): correctly check for windows in lsp logger (#14954) 2021-07-10 11:11:33 -07:00
Tom Payne
1dab9357de feat(vim.uri): Allow URI schemes other than file: without authority 2021-07-10 18:27:37 +01:00
Alessandro Pezzoni
82a443e1f3 test(lsp): file URIs do not allow relative paths 2021-07-10 18:27:37 +01:00
Alessandro Pezzoni
ce5f4228aa test(lsp): file URIs without a hostname 2021-07-10 18:27:37 +01:00
Alessandro Pezzoni
a2c2a08652 fix(lsp): accept file URIs without a hostname
RFC 8089, which defines the file URI scheme, also allows URIs without a
hostname, i.e. of the form file:/path/to/file. These are returned by
some language servers and accepted by other LSP implementations, such as
VSCode's, so it is reasonable for us to accept them as well.
2021-07-10 18:27:37 +01:00
Matthieu Coudron
3de7017d9d
Merge pull request #15047 from teto/flake-tests
flake update
2021-07-10 18:37:07 +02:00
Matthieu Coudron
389cbe63bf chore: add log hander to gen_vimdoc
so it actually dumps output.
Plus a description of what it does in the argparser.
2021-07-10 17:55:45 +02:00
Matthieu Coudron
de909bf48b chore(flake): update inputs
Updated inputs so no need to add tree-sitter ourselves anymore.

Added checks:
- for pylint/shlint
- distinguish the devolpment shell from the ASAN build (closure for ASAN
  version is smaller). While in the devShell, functionaltests would fail
because bin/nvim could not load
outputs/out/share/nvim/syntax/syntax.vim
So we touch the file.
2021-07-10 17:52:15 +02:00
Mathias Fussenegger
e43dbfdd05 feat(lsp): Make line diagnostics display prettier
Adds indentation that matches the number prefix to ensure diagnostic
messages spawning multiple lines align.

Before:

    Diagnostics:
    1. • Variable not in scope: red :: t0 -> t
    • Perhaps you meant one of these:
        ‘rem’ (imported from Prelude), ‘read’ (imported from Prelude),
        ‘pred’ (imported from Prelude)
    2. • Variable not in scope: repeDoubleColon :: [Char] -> t0
    • Perhaps you meant ‘replaceDoubleColon’ (line 32)

After:

    Diagnostics:
    1. • Variable not in scope: red :: t0 -> t
       • Perhaps you meant one of these:
           ‘rem’ (imported from Prelude), ‘read’ (imported from Prelude),
           ‘pred’ (imported from Prelude)
    2. • Variable not in scope: repeDoubleColon :: [Char] -> t0
       • Perhaps you meant ‘replaceDoubleColon’ (line 32)
2021-07-09 20:36:08 +02:00
Björn Linse
37af69285a
Merge pull request #15036 from vigoux/decurbuf-2
refactor(undo): don't assume curbuf in u_compute_hash
2021-07-09 18:52:26 +02:00
Thomas Vigouroux
ff53c5585f
refactor(undo): don't assume curbuf in u_compute_hash 2021-07-09 15:36:07 +02:00
Thomas Vigouroux
191d3e6af7
Merge pull request #15035 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-07-09 14:40:19 +02:00
marvim
832e1708c2 docs: regenerate 2021-07-09 10:39:24 +00:00
Folke Lemaitre
9132b76da6
fix(lsp): support duplicate params in signature help (#15032) 2021-07-09 03:38:29 -07:00
Björn Linse
1c41689287
Merge pull request #12971 from vigoux/decurbuf
Decrease reliance on curbuf in BUFEMPTY and `undo.c`
2021-07-09 10:15:18 +02:00
James McCoy
27118c6eb3
Merge pull request #14908 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-07-08 22:50:18 -04:00
Thomas Vigouroux
9c93e6461c
refactor(undo): remove last occurence of save_curbuf 2021-07-08 23:08:42 +02:00
Thomas Vigouroux
b35fefc57f
refactor: remove all mentions to curbuf_lock 2021-07-08 23:08:27 +02:00
comicfans
9c7e04eb3b
build(cmake): skip download if target file exists #14844) 2021-07-08 11:16:13 -07:00
dundargoc
980d50d90e
vim-patch:8.2.3125: variables are set but not used #15028
Problem:    Variables are set but not used.
Solution:   Move the declarations to the block where they are used.
            (closes vim/vim#8527)
09f688c33a
2021-07-08 11:04:46 -07:00
dundargoc
4339f528db
vim-patch:8.2.3089: garbage collection has useless code #15027
Problem:    Garbage collection has useless code.
Solution:   Bail out when aborting. (closes vim/vim#8504)
20cc528320
2021-07-08 11:03:33 -07:00
marvim
6b313d68d0 docs: regenerate 2021-07-08 15:42:31 +00:00
Folke Lemaitre
03d15d9e09
fix(lsp): restore diagnostics extmarks that were moved to the last edit line (#15023) 2021-07-08 08:40:41 -07:00
Folke Lemaitre
af263711a3
feat(lsp): highlight active parameter in signature help (#15018) 2021-07-07 23:04:35 -07:00
cbarrete
f2205b83c5
doc: "--remote" is not supported #14936
There are plans to support the --remote-xx stuff (or something like it): #1750 #8326
But we don't need this doc meanwhile.
2021-07-07 19:04:49 -07:00
cbarrete
bd7a0b46a9
doc: remove mentions of compile-time flags #14935
Nvim always compiles everything in so those are useless at best and
confusing at worst.
2021-07-07 18:51:40 -07:00
dundargoc
4547137aaf
chore: use codespell to spell check #15016 2021-07-07 15:28:44 -07:00
dundargoc
e2bc7e321b
clang/'Dead initialization': don't assign unused value to variable "string" #15015 2021-07-07 14:25:27 -07:00