Commit Graph

19007 Commits

Author SHA1 Message Date
Michael Lingelbach
248974a4c6
Merge pull request #14115 from mfussenegger/lsp-commands
lsp: Add a registry for client side code action commands
2021-09-22 11:42:56 -07:00
Justin M. Keyes
ec447b8798
docs: .git-blame-ignore-revs #15653 2021-09-22 06:36:53 -07:00
dundargoc
48e67b2294
refactor: format with uncrustify #15741 2021-09-22 06:25:38 -07:00
Christian Clason
fb6f27e86f
vim-patch:34cc7d8c034f #15753
Update runtime files
34cc7d8c03
2021-09-22 06:12:06 -07:00
Michael Lingelbach
e8fb0728e2
Merge pull request #15717 from gpanders/diagnostic-include-source
feat(diagnostic): add option to include diagnostic source
2021-09-21 18:32:32 -07:00
Gregory Anders
bc652f148f refactor(diagnostic): remove get_virt_text_chunks()
This function isn't compatible with including diagnostic sources when
"source" is "if_many" since it only has access to diagnostics for a
single line. Rather than having an inconsistent or incomplete interface,
make this function private. It is still exported as part of the module
for backward compatibility with vim.lsp.diagnostics, but it can
eventually be made into a local function.
2021-09-21 18:54:28 -06:00
Gregory Anders
d43151ea0b feat(diagnostic): add option to include diagnostic source
Add an option to virtual text display and floating window previews to
include diagnostic source in the diagnostic message.
2021-09-21 18:54:26 -06:00
Gregory Anders
17b7968f02
fix(diagnostic): preserve fields from LSP diagnostics via user_data (#15735)
* preserve fields from LSP diagnostics via adding a user_data table to the diagnostic, which can hold arbitrary data in addition to the lsp diagnostic information.
2021-09-21 15:27:12 -07:00
Mathias Fußenegger
8164adc144
fix(lsp): update lsp-handler signature in call_hierarchy (#15738)
This fixes the handler signature and also prevents n+1 requests firing
if there are multiple clients.

(The first `prepareCallHierarchy` handler is called once per client,
each invocation used `buf_request` to make more requests using *all*
clients)
2021-09-21 15:05:49 -07:00
dundargoc
a65d8c34e6
ci(PVS): PVS/V009: add required header #15751 2021-09-21 09:02:43 -07:00
Justin M. Keyes
c76cddf3e0
fix(startup): init.lua: set $MYVIMRC to absolute path #15748
- main.c: remove os_setenv("MYVIMRC",…), it is already done by
  do_source().
  - This also sets $MYVIMRC to a full (absolute) path.
- code cleanup.
2021-09-21 08:47:46 -07:00
James McCoy
c208993026
Merge pull request #15745 from e-kwsm/Makefile
build: enhance Makefile
2021-09-21 08:22:08 -04:00
Eisuke Kawashima
7014731035
build: enhance Makefile
- fix regression where `-j` is not passed to ninja
  (39c886551b, #15708)
- enable to pass `-l` (load) to ninja as well
- s/BUILD_TYPE/CMAKE_GENERATOR/
2021-09-21 15:54:14 +09:00
James McCoy
21f7555277
Merge pull request #15743 from jamessan/libuv-threads
build: Add ${CMAKE_THREAD_LIBS_INIT} to LIBUV_LIBRARIES
2021-09-20 21:56:49 -04:00
James McCoy
2435cf77d1
build: add ${CMAKE_THREAD_LIBS_INIT} to LIBUV_LIBRARIES
This is a workaround for not yet having fully correct Find* cmake
modules for static builds.

https://github.com/Tronic/cmake-modules/issues/3#issuecomment-624469020
2021-09-20 21:19:52 -04:00
Mathias Fussenegger
6c03601e3a feat(lsp): add a registry for client side code action commands
This builds on https://github.com/neovim/neovim/pull/14112 and closes
https://github.com/neovim/neovim/issues/12326
2021-09-20 22:26:00 +02:00
Mathias Fussenegger
187579fe19 feat(lsp): include original request params in handler ctx
This is mostly motivated by https://github.com/neovim/neovim/issues/12326

Client side commands might need to access the original request
parameters.

Currently this is already possible by using closures with
`vim.lsp.buf_request`, but the global handlers so far couldn't access
the request parameters.
2021-09-20 22:06:54 +02:00
Gregory Anders
0216aed20c
fix(diagnostic): clamp line numbers in display layer (#15729)
Some parts of LSP need to use cached diagnostics as sent from the LSP
server unmodified. Rather than fixing invalid line numbers when
diagnostics are first set, fix them when they are displayed to the user
(e.g. in show() or one of the get_next/get_prev family of functions).
2021-09-20 11:32:21 -07:00
dundargoc
f4ca3a29dd
refactor: reformat with uncrustify #15736
* fix function parameter comments
* remove space after star in function names
2021-09-20 09:35:41 -07:00
itchyny
1f8c91bf72
fix(inccommand): ignore trailing commands only for *previewed* command #15638
Since the `State` is global, other scripts are unexpectedly affected during the
'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in
order to ignore trailing '|'-separated commands only for the command invoking
the preview.

fix #8796, update #7494
2021-09-20 07:33:10 -07:00
dundargoc
30fefee684
refactor: format with uncrustify #15726 2021-09-20 06:53:38 -07:00
Justin M. Keyes
490e09c6d8
Merge #15727 build(lint): check scripts/*.lua 2021-09-19 16:56:57 -07:00
Justin M. Keyes
41da72ffb6 build(lint): commit linter 2021-09-19 16:39:34 -07:00
Justin M. Keyes
736299bf22 build(lint): check scripts/*.lua 2021-09-19 16:36:08 -07:00
kylo252
39c886551b
refactor(Makefile): use built-in make commands #15708
Changes to the main Makefile:
- add `MAKEFILE_PATH` and `MAKEFILE_DIR` that are set with native commands
- add `NVIM_PRG`
- rename `BUILD_TYPE` to `CMAKE_GENERATOR` to align with CMake naming
- remove the misleading `BUILD_CMD` and use `BUILD_TOOL` instead

Add the following phony target to quickly test the changes

```make
debug-print:
	@echo makefile path: $(MAKEFILE_PATH)
	@echo makefile dir: $(MAKEFILE_DIR)
	@echo build dir: $(BUILD_DIR)
	@echo cmake generator tool: $(CMAKE_GENERATOR)
	@echo build-tool: $(BUILD_TOOL)
	@echo nvim-prg: $(NVIM_PRG)
```
2021-09-19 15:53:48 -07:00
Gregory Anders
e61ea7772e
feat(diagnostic): match(), tolist(), fromlist() #15704
* feat(diagnostic): add vim.diagnostic.match()
  Provide vim.diagnostic.match() to generate a diagnostic from a string and
  a Lua pattern.
* feat(diagnostic): add tolist() and fromlist()
2021-09-19 15:13:23 -07:00
dundargoc
853346a94d
refactor: format with uncrustify #15722 2021-09-19 13:07:42 -07:00
Justin M. Keyes
6565adcbff
build(lint): commit linter #15725
Example test failure:

    $ nvim -es +"lua require('scripts.lintcommit')._test()"
    [ FAIL ]: expected=true, got=false
        input: ":no type before colon 1"
    [ FAIL ]: expected=true, got=false
        input: "ci: tab after colon"

Example main({trace=true}) output:

    $ nvim -es +"lua require('scripts.lintcommit').main()"
    run: { "git", "branch", "--show-current" }
    run: { "git", "merge-base", "origin/master", "master" }
    run: { "git", "merge-base", "upstream/master", "master" }
    run: { "git", "rev-list", "89db07556dbdce97c0c150ed7e47d80e1ddacad3..master" }
    run: { "git", "show", "-s", "--format=%s", "d2e6d2f5fc93b6da3c6153229135ba2f0b24f8cc" }
    Invalid commit message: "buildlint): commit linter #15620"
        Commit: d2e6d2f5fc93b6da3c6153229135ba2f0b24f8cc
        Invalid commit type "buildlint)". Allowed types are:
        { "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "test", "chore", "vim-patch" }
        See also:
            https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages
            https://www.conventionalcommits.org/en/v1.0.0/
2021-09-19 12:57:57 -07:00
Jan Edmund Lazo
89db07556d
Merge pull request #15630 from zeertzjq/vim-8.2.3424
vim-patch:8.1.{1071,1078,1079,1110},8.2.{2640,3424,3425,3437}
2021-09-19 14:31:10 -04:00
Justin M. Keyes
2aa662568a build(lint): commit linter #15620 2021-09-19 11:06:47 -07:00
dundargoc
65572c719a
build(lint): commit linter #15620 2021-09-19 09:27:08 -07:00
Justin M. Keyes
2afbce7651
refactor(tests): remove redir_exec #15718
Problem
- `redir_exec` is obsolete, but it keeps getting used in new tests
  because people copy existing tests.
- Disadvantages of `redir_exec`:
  - Captures extra junk before the actual error/message that we _want_ to test.
  - Does not fail on error, unlike e.g. `command()`.

Solution
- Use new functions like `nvim_exec` and `pcall_err`.
2021-09-19 02:29:37 -07:00
zeertzjq
f4ce4c1677 vim-patch:8.2.3437: compiler warnings for 32/64 bit usage
Problem:    Compiler warnings for 32/64 bit usage.
Solution:   Add type casts. (Mike Williams, closes vim/vim#8870)
f5785cf059
2021-09-19 13:13:44 +08:00
zeertzjq
a348c666a3 vim-patch:8.2.3425: warning for using uninitialized variable
Problem:    Warning for using uninitialized variable.
Solution:   Initialize it. (John Marriott)
56e14698b4
2021-09-19 13:13:44 +08:00
zeertzjq
51567db4b6 vim-patch:8.2.3424: a sequence of spaces is hard to see in list mode
Problem:    A sequence of spaces is hard to see in list mode.
Solution:   Add the "multispace" option to 'listchars'. (closes vim/vim#8834)
f14b8ba137
2021-09-19 13:13:44 +08:00
zeertzjq
177e87525a vim-patch:8.2.2640: screenstring() returns non-existing composing characters
Problem:    screenstring() returns non-existing composing characters.
Solution:   Only use composing characters if there is a base character.
f1387285e2
2021-09-19 13:13:44 +08:00
zeertzjq
59e80c4dfc vim-patch:8.1.1110: composing chars on space wrong when 'listchars' is set
Problem:    Composing chars on space wrong when 'listchars' is set.
Solution:   Do not use "space" and "nbsp" entries of 'listchars' when there is
            a composing character.  (Yee Cheng Chin, closes vim/vim#4197)
e5e4e22c1c
2021-09-19 13:13:44 +08:00
zeertzjq
c14dc616bf vim-patch:8.1.1079: no need for a separate ScreenLinesUtf8() test function
Problem:    No need for a separate ScreenLinesUtf8() test function.
Solution:   Get the composing characters with ScreenLines().
48aed0824e
2021-09-19 13:13:44 +08:00
zeertzjq
32663b0f7e vim-patch:8.1.1078: when 'listchars' is set a composing char on a space is wrong
Problem:    When 'listchars' is set a composing char on a space is wrong.
Solution:   Separate handling a non-breaking space and a space. (Yasuhiro
            Matsumoto, closes vim/vim#4046)
5f8069bbf5
2021-09-19 13:13:44 +08:00
zeertzjq
963474321b vim-patch:8.1.1071: cannot get composing characters from the screen
Problem:    Cannot get composing characters from the screen.
Solution:   Add screenchars() and screenstring(). (partly by Ozaki Kiichi,
            closes vim/vim#4059)
2912abb3a2
2021-09-19 13:13:44 +08:00
Gregory Anders
924e8e4f2d
fix(diagnostic): only update decorations for loaded buffers (#15715)
When vim.diagnostic.config() is called, the decorations for diagnostics
are re-displayed to use the new configuration. This should only be done
for loaded buffers.
2021-09-18 14:01:03 -07:00
Justin M. Keyes
77399184d7
ci(labeler): diagnostic 2021-09-18 13:29:56 -07:00
hrsh7th
41cfba63cd
feat(lsp): improve vim.lsp.util.apply_text_edits (#15561)
- Fix the cursor position after applying TextEdits
- Support reversed range of TextEdit
- Invoke nvim_buf_set_text one by one
2021-09-18 13:19:21 -07:00
Michael Lingelbach
340f77e78e
Merge pull request #15710 from gpanders/show_line_diagnostics
fix(diagnostic): resolve nil bufnr in show_line_diagnostics
2021-09-18 10:31:40 -07:00
Jaehwang Jerry Jung
de406f651c
vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode (#15547)
Problem:    Filler lines are wrong when changing text in diff mode.
Solution:   Don't change the filler lines on every change.  Check
            scrollbinding when updating the filler lines. (closes vim/vim#8809)
04626c243c
2021-09-18 12:38:58 -04:00
dundargoc
51a98aa0c2
refactor: format #15702 2021-09-18 09:34:23 -07:00
Gregory Anders
752d2d2081 test: add test case for show_line_diagnostics 2021-09-18 10:07:54 -06:00
Gregory Anders
ef52433847 fix(diagnostic): resolve nil bufnr in show_line_diagnostics 2021-09-18 09:44:30 -06:00
Björn Linse
6cad86fffd
Merge pull request #15632 from bfredl/rtptest
runtime: always use DIP_START and remove duplication of start packages in &rtp
2021-09-18 17:14:25 +02:00
Björn Linse
a860f7880f refactor(runtime): handle pack/foo/start/bar/after dirs properly
The order should be:
XDG_CONFIG_HOME/nvim
XDG_DATA_HOME/nvim/site/pack/foo/start/bar/
XDG_CONFIG_HOME/nvim/after
XDG_DATA_HOME/nvim/site/pack/foo/start/bar/after
2021-09-18 13:59:19 +02:00