Commit Graph

2771 Commits

Author SHA1 Message Date
Stephan Seitz
b058c671d2 treesitter: avoid escaping complete query strings
Escape "\\" only for `vim-match?` not for `match?`
Fixes #12595
2020-08-31 17:24:38 +02:00
Thomas Vigouroux
e123fd0a5d treesitter: allow to iterate over node children 2020-08-31 13:42:30 +02:00
Justin M. Keyes
c2662210b5
docs, remove 'guifontset' #11708
- 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...).
2020-08-31 00:51:35 -07:00
Anmol Sethi
3229ba0cde
lsp: Fix bad sortText comparison (#12485)
The spec indicates we have to fallback to comparing by label
if sortText is falsy.

Closes #12431
2020-08-30 22:29:47 -07:00
Jacques Germishuys
dd33725802 document that the perl provider doesn't currently work on Windows 2020-08-30 17:19:05 +01:00
Jacques Germishuys
9bef25314e support for :perl, :perlfile, :perldo and perleval() 2020-08-30 17:19:05 +01:00
Hirokazu Hata
3b1db74963
lsp: add key name to the output log value
Unless we look at the code every time, we will not know what the value is, so add the key name.
2020-08-26 12:06:07 +09:00
Hirokazu Hata
154cbe61c4
lsp: remove output log at rpc.notify
Since "rpc.send.payload" outputs the log with almost the same contents, delete the output here.
2020-08-26 12:06:07 +09:00
TJ DeVries
43202964f3
Merge pull request #12708 from runiq/lsp-doc
Add docs for some methods in vim.lsp
2020-08-25 09:52:22 -04:00
Jan Edmund Lazo
107e50b25e
vim-patch:8.2.1517: cannot easily get the character under the cursor
Problem:    Cannot easily get the character under the cursor.
Solution:   Add the {chars} argument to strpart().
6c53fca023
2020-08-23 18:32:39 -04:00
Patrice Peterson
b5782c3b81 Add FIXMEs 2020-08-23 13:48:27 +02:00
Patrice Peterson
ac05343a10 Add docs for most vim.lsp methods
Most of the lsp.log will be addressed in a separate PR.
2020-08-23 13:48:25 +02:00
Jan Edmund Lazo
27a6728848
vim-patch:8.2.1476: filetype test fails on MS-Windows
Problem:    Filetype test fails on MS-Windows.
Solution:   Remove "^" from pattern.
aa9675a61d
2020-08-17 18:30:34 -04:00
Jan Edmund Lazo
97d3bd0bc6
vim-patch:8.2.1474: /usr/lib/udef/rules.d not recognized as udevrules
Problem:    /usr/lib/udef/rules.d not recognized as udevrules.
Solution:   Adjust match pattern. (Haochen Tong, closes 36722)
624b6eaf20
2020-08-17 18:30:10 -04:00
Manuel Krebs
83f5bf435d
runtime/tex.vim: patch to 2547aa930b59 #12504
vim/vim@2547aa930b
2020-08-16 15:23:28 -07:00
Jan Edmund Lazo
c219d3eec4
defaults: sessionoptions+=unix,slash #12760
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>
2020-08-15 19:19:06 -07:00
Jan Edmund Lazo
273ad7d66f
fixup! mksession: always unix slashes "/" for filepaths 2020-08-15 10:57:17 -04:00
Jan Edmund Lazo
6ac51792b9
fixup! vim-patch:68e6560b84f1 2020-08-15 10:57:17 -04:00
Jan Edmund Lazo
afc6753f64
vim-patch:8.2.1458: .gawk files not recognized
Problem:    .gawk files not recognized.
Solution:   Recognize .gawk files. (Doug Kearns)
9a5c553f79
2020-08-15 10:57:16 -04:00
Jan Edmund Lazo
ab85f774a6
vim-patch:8.2.1410: adding compiler plugin requires test change
Problem:    Adding compiler plugin requires test change.
Solution:   Include compiler plugin and adjust test.
7f7a888869
2020-08-14 18:20:30 -04:00
Jan Edmund Lazo
5e95e0da44
vim-patch:8.2.1409: nmpmrc and php.ini filetypes not recognized
Problem:    Nmpmrc and php.ini filetypes not recognized.
Solution:   Add filetype detection. (Doug Kearns)
1e91eafc2e
2020-08-14 18:20:30 -04:00
Jan Edmund Lazo
7a047d8dc2
vim-patch:8.2.1347: cannot easily get the script ID
Problem:    Cannot easily get the script ID.
Solution:   Support expand('<SID>').
909443028b
2020-08-14 18:20:28 -04:00
Jan Edmund Lazo
0680b5218e
vim-patch:8.1.2341: not so easy to interrupt a script programatically
Problem:    Not so easy to interrupt a script programatically.
Solution:   Add the interrupt() function. (Yasuhiro Matsumoto, closes vim/vim#2834)
67a2deb9cb
2020-08-14 18:20:28 -04:00
Jan Edmund Lazo
6d68b2801b
vim-patch:8.1.1674: script to check a colorscheme can be improved
Problem:    Script to check a colorscheme can be improved.
Solution:   Match the whole group name. Don't warn for what is usually omitted.
4e63f9425e
2020-08-14 18:20:27 -04:00
Jan Edmund Lazo
903cd73af1
vim-patch:8.1.0573: cannot redefine user command without ! in same script
Problem:    Cannot redefine user command without ! in same script
Solution:   Allow redefining user command without ! in same script, like with
            functions.
55d4691308
2020-08-14 18:20:27 -04:00
TJ DeVries
3ccdbc570d
lua: add vim.register_keystroke_callback (#12536)
* feat: Add vim.register_keystroke_callback

* fixup: Forgot to remove mention of old option

* fixup: Answer jamessan comments

* fixup: Answer norcalli comments

* fixup: portability

* Update runtime/doc/lua.txt

Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
2020-08-14 10:03:17 -04:00
TJ DeVries
aa48c1c724
Merge pull request #12739 from vigoux/ts-refactor-predicates
treesitter: refactor
2020-08-14 08:33:50 -04:00
Thomas Vigouroux
6a8dcfab4b treesitter: allow to force predicate addition 2020-08-13 20:40:40 +02:00
Thomas Vigouroux
5900c99b7c treesitter: update docs on predicates 2020-08-13 20:30:15 +02:00
Thomas Vigouroux
9564803d1a treesitter: add predicate negation 2020-08-13 20:30:15 +02:00
Thomas Vigouroux
d7b12e58df treesitter: add and test vim-match? predicate 2020-08-13 20:30:15 +02:00
Thomas Vigouroux
58e37d7df8 treesitter: add contains? predicate 2020-08-13 20:30:15 +02:00
Thomas Vigouroux
18c0e77528 treesitter(docs): update and refresh docs 2020-08-13 20:30:15 +02:00
Thomas Vigouroux
613068071e treesitter: refactor and use lua regexes 2020-08-13 20:30:15 +02:00
Matthieu Coudron
602e7505e2
Merge pull request #12621 from Shougo/vim-8.1.1564
[RDY] vim-patch:8.1.1564, 1570, 1623, 1712 : sign column takes up space
2020-08-09 16:19:11 +02:00
Patrice Peterson
1869f86e35
Remove unused function (#12719) 2020-08-08 23:49:44 +02:00
Anmol Sethi
7f49594813
man.vim: Add - to 'iskeyword' (#12598)
Pressing K on manpages with - in their name will now work.

I noticed this the manpages of https://github.com/cli/cli
2020-08-08 12:48:33 -04:00
Jan Edmund Lazo
1123a979d0
vim-patch:8.1.0862: no verbose version of character classes
Problem:    No verbose version of character classes.
Solution:   Add [:ident:], [:keyword:] and [:fname:]. (Ozaki Kiichi,
            closes vim/vim#1373)
221cd9f4dd
2020-08-02 12:00:02 -04:00
Jan Edmund Lazo
45b91711e4
vim-patch:8.2.1292: AIDL filetype not recognized
Problem:    AIDL filetype not recognized.
Solution:   Add filetype detection. (Dominique Pellé, closes vim/vim#6533)
2afc3b4f77
2020-08-02 12:00:02 -04:00
Andreas Johansson
82bfdbfe5c
Revert "lsp: Fix text edits with the same start position (#12434)" (#12564)
This reverts commit 44fe8828f0.
2020-07-30 13:37:19 -04:00
Shougo Matsushita
d3eddcf630 vim-patch:8.1.1564: sign column takes up space
Problem:    Sign column takes up space.  (Adam Stankiewicz)
Solution:   Optionally put signs in the number column. (Yegappan Lakshmanan,
            closes vim/vim#4555, closes vim/vim#4515)
394c5d8870
2020-07-23 10:29:36 +09:00
Matthieu Coudron
b059fb5c67
Merge pull request #12654 from cbarrete/nomodifiable-hover
LSP: make the hover window nomodifiable
2020-07-21 19:50:33 +02:00
Anmol Sethi
a6917f840d
man.vim: Simplify man#init to reduce load time (#12482)
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
2020-07-21 11:46:42 -04:00
Matthieu Coudron
459800db43
Merge pull request #12575 from cbarrete/vim-8.2.0935
[RFC] vim-patch:8.2.{0935,0937}
2020-07-20 22:04:30 +02:00
Cédric Barreteau
fd6361278b Make the window nomodifiable when it's created 2020-07-20 20:16:46 +02:00
Cédric Barreteau
8bb2c3087a LSP: make the hover window nomodifiable 2020-07-20 20:16:46 +02:00
cbarrete
56f3b95180
doc: Add documentation for some vim.lsp.buf functions (#12552)
* Add documentation for some `vim.lsp.buf` functions

* Add inline Lua documentation

* Use generated documentation for LSP buffer functions

Co-authored-by: Cédric Barreteau <>
2020-07-19 17:16:12 -04:00
David Lukes
33837745bb
Fix / improve report messages (#12396) 2020-07-19 22:37:50 +02:00
Matthieu Coudron
e1d1c413f7
Merge pull request #12480 from nhooyr/mansect-trim
man.vim: Refactor verify_exists to unset $MANSECT as needed
2020-07-19 21:55:12 +02:00
Jan Edmund Lazo
93f2dc0d03
vim-patch:8.2.0893: assert_equalfile() does not take a third argument
Problem:    Assert_equalfile() does not take a third argument.
Solution:   Implement the third argument. (Gary Johnson)
fb517bac23
2020-07-19 11:40:34 -04:00
cbarrete
08efa7037e
lsp: Add support for call hierarchies (#12556)
* 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 <>
2020-07-18 15:10:09 -04:00
Cédric Barreteau
6420615e3f vim-patch:8.2.0935: flattening a list with existing code is slow
Problem:    Flattening a list with existing code is slow.
Solution:   Add flatten(). (Mopp, closes vim/vim#3676)
077a1e670a
2020-07-15 20:27:20 +02:00
Thomas Vigouroux
341e139992 treesitter: add parser on_lines callbacks 2020-07-10 17:16:24 +02:00
Thomas Vigouroux
0f7eaa3555 treesitter: cache the capture hl relation 2020-07-10 17:16:24 +02:00
Thomas Vigouroux
c5119dbad6 treesitter: use change calbacks on redraw 2020-07-10 17:16:23 +02:00
Thomas Vigouroux
529251d5e4
treesitter: call bufload before parsing (#12603) 2020-07-10 09:33:27 -04:00
TJ DeVries
b39edb5b60
doc: Add information about lua function calls (#12574) 2020-07-08 10:42:34 -04:00
Christian Clason
91572ddad1
doc: mention that defer_fn applies schedule_wrap (#12601) 2020-07-07 10:55:40 +02:00
Matthieu Coudron
e49fc4ba1f
Merge pull request #12538 from janlazo/vim-8.2.1055
vim-patch:8.1.{93,1372},8.2.{1055,1060,1089,1095,1104}
2020-07-06 23:31:24 +02:00
Christian Clason
4ab7bbf3ea
lua: add options to highlight.on_yank (#12549)
NOTE: Configuration options have  changed for highlight.on_yank.

Check help for |:help highlight.on_yank()|
2020-07-05 21:30:12 -04:00
Christian Clason
f9579d473e
lsp: add optional vertical padding, maximal size to floats (#12444)
* add vertical padding to floats

* add max_width, max_height option to float methods

* lint

* lintlint

* guard against nil wrap_at
2020-07-05 21:09:52 -04:00
Jan Edmund Lazo
10c563577c
vim-patch:8.1.0093: non-MS-Windows: Cannot interrupt gdb when program is running
Problem:    non-MS-Windows: Cannot interrupt gdb when program is running.
Solution:   Only use debugbreak() on MS-Windows.
2ed890f1f8
2020-07-04 12:10:04 -04:00
Jan Edmund Lazo
f01bb307fd
vim-patch:8.2.1060: not all elinks files are recognized
Problem:    Not all elinks files are recognized.
Solution:   Just check for "elinks.conf". (Guido Cella, closes vim/vim#6337)
5f36d5fbb8
2020-07-04 10:05:34 -04:00
Jan Edmund Lazo
edaff441de
vim-patch:8.1.1372: when evaluating 'statusline' the current window is unknown
Problem:    When evaluating 'statusline' the current window is unknown.
            (Daniel Hahler)
Solution:   Set "g:actual_curwin" for %{} items.  Set "g:statusline_winid"
            when evaluationg %!. (closes vim/vim#4406, closes vim/vim#3299)
1c6fd1e100
2020-07-04 10:05:34 -04:00
Jan Edmund Lazo
43a2e5fe4b
vim-patch:8.2.1055: no filetype set for pacman config files
Problem:    No filetype set for pacman config files.
Solution:   Recognize pacman.conf and *.hook. (Guido Cella, closes vim/vim#6335)
73b4465ba7
2020-07-04 10:05:34 -04:00
Matthieu Coudron
bd5f0e9695
Merge pull request #12531 from BK1603/autoread-tui
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.
2020-07-04 15:27:32 +02:00
TJ DeVries
7b529e7912
doc: fix scripts and regenerate (#12506)
* 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
2020-07-02 07:09:17 -04:00
Anmol Sethi
2844cd54da
docs: Describe how to escape keycodes with nvim_feedkeys (#12484)
Closes #12297
2020-07-01 21:57:03 -04:00
BK1603
22828f59bb Added healt check for tmux focus events 2020-07-02 04:40:35 +05:30
Mathias Fußenegger
554b21261e
lsp: Use nvim_buf_get_lines in locations_to_items and add more tests (#12357)
* 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
2020-06-30 11:48:04 -04:00
Matthieu Coudron
1920ba4b55
Merge pull request #12491 from vigoux/treesitter-set-ranges
[RDY] Treesitter set ranges
2020-06-30 00:02:46 +02:00
Thomas Vigouroux
b652f74ca3 treesitter: use nodes to mark ranges 2020-06-29 22:21:06 +02:00
Thomas Vigouroux
558893b1b9 treesitter: add some documentation for parsers 2020-06-29 22:21:06 +02:00
Thomas Vigouroux
333f3f19db treesitter: add set_included_ranges to the parser
This is the first step towards language injection using treesitter.
2020-06-29 22:21:06 +02:00
Matthieu Coudron
d5bbaf92c1 doc: fix wordcount description
was fixed in vim patch c572da5f67aa5cdbbc127fc6f1d0a42e38468325
and forgot in corresponding vim patch 8c3377ee76.
2020-06-29 20:08:20 +02:00
cbarrete
48ac77a14c
LSP: Set current name as default rename text (#12553)
Since we don't know what the server considers to be a symbol, `cword` is
the best bet in most cases.

Co-authored-by: Cédric Barreteau <>
2020-06-27 20:10:19 +02:00
Hirokazu Hata
7efb302d26
Merge pull request #12252 from dlukes/formatting-sync 2020-06-27 11:27:51 +09:00
James McCoy
225f0bcd98
Merge pull request #12133 from bradking/syntax-fold 2020-06-24 13:09:30 -04:00
Jan Edmund Lazo
352831229f
vim-patch:8.2.1044: not all systemd file types are recognized (#12527)
Problem:    Not all systemd file types are recognized.
Solution:   Match several more files. (Guido Cella, closes vim/vim#6319)
ef6d86c173
2020-06-24 10:18:06 +02:00
Brad King
357c16515c vim-patch:8.2.0865 syntax: Add command to control how foldlevel is computed
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.
2020-06-23 19:07:33 -04:00
francisco souza
2f6d1d3c88
lsp: when apply text edits, set buflisted on buffers (#12489)
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>
2020-06-23 17:50:37 +02:00
David Lukes
ebee9ebe2b lsp: Add sync variant of LSP formatting
Also, factor out a `vim.lsp.util.get_effective_tabstop()` helper and add
tests for it.
2020-06-22 09:48:41 +02:00
Jan Edmund Lazo
b4e4c2ad95
vim-patch:8.2.0983: SConstruct file type not recognized
Problem:    SConstruct file type not recognized.
Solution:   Use python for SConstruct files. (Roland Hieber)
ad72350360
2020-06-18 18:01:44 -04:00
Jan Edmund Lazo
954aed886e
vim-patch:8.2.0980: raku file extension not recognized
Problem:    Raku file extension not recognized. (Steven Penny)
Solution:   Recognize .raku and .rakumod. (closes vim/vim#6255)
a65d8b5bb9
2020-06-18 18:01:44 -04:00
Jan Edmund Lazo
abadb687fb
vim-patch:8.2.0954: not all desktop files are recognized
Problem:    Not all desktop files are recognized.
Solution:   Add the *.directory pattern. (Eisuke Kawashima, closes vim/vim#3317)
f1f0ff9557
2020-06-18 18:01:43 -04:00
Jan Edmund Lazo
44535d39e9
vim-patch:8.1.1977: terminal debugger plugin may hang
Problem:    Terminal debugger plugin may hang.
Solution:   Wait longer when still reading symbols.
19c8fe1925
2020-06-18 18:01:43 -04:00
Jan Edmund Lazo
9d565c5ba3
vim-patch:8.2.0930: script filetype detection trips over env -S argument
Problem:    Script filetype detection trips over env -S argument.
Solution:   Remove "-S" and "--ignore-environment". (closes vim/vim#5013)
            Add tests.
b5e18f29fa
2020-06-18 18:01:42 -04:00
Jan Edmund Lazo
150168b881
vim-patch:8.2.0927: some sshconfig and ssdhconfig files are not recognized
Problem:    Some sshconfig and ssdhconfig files are not recognized.
Solution:   Add filetype patterns.
da84ac2a6f
2020-06-18 18:01:41 -04:00
Jan Edmund Lazo
a5bde56b37
vim-patch:8.0.1554: custom plugins loaded with --clean
Problem:    Custom plugins loaded with --clean.
Solution:   Do not include the home directory in 'runtimepath'.
0726870326
2020-06-18 18:01:41 -04:00
francisco souza
70d4b31b83
lsp: Add new highlight groups used in show_line_diagnostics (#12473)
* 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>
2020-06-18 08:04:49 -04:00
Manuel Krebs
8498c40fcf tex.vim: patch runtime/indent to 388a5d4f20b4
vim/vim@388a5d4f20
2020-06-17 12:52:39 +02:00
Manuel Krebs
ad42ac4618 tex.vim: patch runtime to 65e0d77a66b7
vim/vim@65e0d77a66
2020-06-16 19:57:41 +02:00
Manuel Krebs
db756fca52 tex.vim: patch runtime to 388a5d4f20b4
vim/vim@388a5d4f20
2020-06-16 19:56:14 +02:00
Manuel Krebs
78f37f6a35 tex.vim: patch runtime to 1d9215b9aaa1
vim/vim@1d9215b9aa
2020-06-16 19:53:35 +02:00
Hirokazu Hata
e628a05b51
Merge pull request #12342 from h-michael/fix-doc 2020-06-15 18:08:34 +09:00
Hirokazu Hata
52cd8bf507
doc: fix vim.api.nvim_buf_attach callback arguments 2020-06-15 12:30:13 +09:00
Hirokazu Hata
6613ab6bca
Merge pull request #12469 from h-michael/request
lsp: even if contents before change is 0 byte, request to server
2020-06-15 11:11:42 +09:00
Kevin Fleming
8daefe2f04
Fix highlight group names in LSP documentation (#12427)
LspDiagnosticInformation -> LspDiagnosticsInformation
LspDiagnosticInformationSign -> LspDiagnosticsInformationSign
LspDiagnosticHint -> LspDiagnosticsHint
LspDiagnosticHintSign -> LspDiagnosticsHintSign
2020-06-14 15:25:39 -04:00
Andreas Johansson
44fe8828f0
lsp: Fix text edits with the same start position (#12434)
According to the LSP spec[1], multiple edits can have the same starting
position, and if that is the case, they should be applied in the order
as they come in the array.

The implementation uses a reverse sort to not interfere with non applied
edits, but failed to take into account the spec.

[1] https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textedit
2020-06-14 15:23:16 -04:00
Anmol Sethi
e8ccd0f234
man.vim: Remove unnecessary code
Not sure why this was added in 94f4469638

It doesn't seem to do anything and I can't reproduce the linked issue
with this patch so I think it's all working now.

cc @justinmk
2020-06-13 02:55:40 -04:00
Anmol Sethi
adc3425a37
man.vim: Fix tagfunc to respect b:man_default_sects
Also, kudos to @zsugabubus for fixing a related issue in #12417

This also prevents any sorting of the paths from man. We need to
respect the order we get from it otherwise you end up loading

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man/man1/ls.1

on MacOS instead of /usr/share/man/man1/ls.1
2020-06-13 02:55:40 -04:00
Anmol Sethi
4aaffc5f33
man.vim: Refactor verify_exists to unset $MANSECT as needed
Also cleaned it up a little and made it faster.

Closes #9159 and #9271

Also changes man#extract_sect_and_name_ref to only return a single
section at a time. This fixes a bug in its usage in man#goto_tag
where get_paths would be called with multiple sections and it does
not support that.

I noticed that our tagfunc doesn't obey b:man_default_sects and
I'll fix that next.
2020-06-12 23:44:31 -04:00
Dheepak Krishnamurthy
a0a84fc9e0
lsp: Add BufLeave to close_preview_autocmd function call (#12477)
else popup window remains open when switching buffer.
2020-06-12 20:38:33 +02:00
Stephan Seitz
b751d16cad
lsp: Fix #12449 textDocumentSync.save can be boolean. Access textDocumentSync.save.includeText only if table. (#12450) 2020-06-11 15:47:03 -04:00
Hirokazu Hata
e39ec50d73
lsp: even if contents before change is 0 byte, request to server
fix: https://github.com/neovim/neovim/issues/12414
2020-06-11 13:09:05 +09:00
erw7
d17e38e482 Add overlapped option to jobstart
When UV_OVERLAPPED_PIPE was used for the pipe passed to the child process, a
problem occurred with the standard input of the .Net Framework application
(#11809). Therefore, add the overlapped option to jobstart() and change it so
that it is set only when necessary
2020-06-10 22:21:14 +09:00
Matthieu Coudron
dbc8ec9446
Merge pull request #12321 from vigoux/treesitter-runtime
treesitter: update runtime
2020-06-06 15:37:51 +02:00
Matthieu Coudron
33dafc4f0f
Merge pull request #12413 from janlazo/vim-8.2.0089
[RDY]vim-patch:8.0.1564,8.1.{917,1895,2018,2335},8.2.{89,491,873,892,905}
2020-06-06 02:05:49 +02:00
Matthieu Coudron
fca471d8e2
Merge pull request #12411 from kuuote/fix-remote-plugin-command
runtime: fix remote plugin command fails at some case
2020-06-06 01:39:12 +02:00
Jan Edmund Lazo
909af2f3f1
vim-patch:8.2.0491: cannot recognize a <script> mapping using maparg()
Problem:    Cannot recognize a <script> mapping using maparg().
Solution:   Add the "script" key. (closes vim/vim#5873)
2da0f0c445
2020-06-04 20:52:53 -04:00
Jan Edmund Lazo
f85bf6ec37
vim-patch:8.2.0873: a .jl file can be sawfish (lisp) or Julia
Problem:    A .jl file can be sawfish (lisp) or Julia.
Solution:   Do not recognize *.jl as lisp, since it might be Julia.
            (closes vim/vim#6178)
2891459b81
2020-06-04 20:52:52 -04:00
TJ DeVries
dd4018947c
lsp: do not process diagnostics for unloaded buffers (#12440) 2020-06-04 19:37:38 -04:00
Christian Clason
b7f3f11049
lsp: compute height of floating preview correctly for wrapped lines (#12380)
* take wrapping into account when computing float height

* factor out size calculation

* add test

* accept and pass through opts.wrap_at in floating_preview

* make padding configurable

* slightly refactor fancy_floating_markdown to make use of make_position

* padding using string.format

* move trim and pad to separate function

* nit

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>

* remove mention of backward compat

* make lint happy

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
2020-06-04 14:23:03 -04:00
Dheepak Krishnamurthy
6f4f38cd54
lsp: Add check for declaration and typeDefinition support in vim lsp server before making request (#12421)
* Add check for typeDefinition support in vim lsp server

* Check for typeDefinitionProvider in server

* Check for declarationProvider in server

* Add check for client support

* Fix typo
2020-06-04 08:52:44 -04:00
notomo
ac5a3f2c56
lua: fix behavior when split empty string (#12429)
* lua: fix behavior when split empty string

* test: lsp.util.apply_text_edits with an empty edit
2020-06-04 08:48:48 -04:00
Hirokazu Hata
96568d5b07
Merge pull request #12343 from ndreas/fix/lsp-multibyte-indexing
Fix LSP multibyte indexing
2020-06-04 12:16:42 +09:00
Thomas Vigouroux
6a93077475 treesitter: fix tests 2020-06-03 19:58:02 +02:00
Christian Clason
8a1276005a
Add v:event.visual during TextYankPost (#12382)
* propagate visual selection to textyankpost event

* adapt tests

* add docs

* also adapt oldtest
2020-06-03 10:51:25 -04:00
notomo
60c581b35d
lua: fix infinite loop for vim.split on empty string (#12420) 2020-06-02 19:31:43 -04:00
Christian Clason
91e41c8576
lua: add vim.highlight.range (#12401) 2020-05-31 14:56:00 -04:00
kuuote
7124c0e5ac runtime: fix remote plugin command fails at some case
fixes #12410
2020-05-31 20:21:58 +09:00
Jan Edmund Lazo
4b87248285
vim-patch:8.2.0843: filetype elm not detected (#12403)
Problem:    Filetype elm not detected.
Solution:   Recognize *.elm files. (closes vim/vim#6157)
0016fd2e29
2020-05-30 18:06:23 -04:00
TJ DeVries
be662fe5c7 lua: vim.wait implementation 2020-05-30 12:01:32 -04:00
BusyBruce
7d8dc4c331
provider: Fix ruby checkhealth error for Windows (#12400)
Plaform: Windows 10

run `cmd /c gem list -ra ^^neovim$`

*** REMOTE GEMS ***

minitest-neovim (0.1.0)
neovim (0.7.1, 0.7.0, 0.6.2, 0.6.1, 0.6.0, 0.5.1, 0.5.0, 0.4.0, 0.3.3, 0.3.2, 0.3.1, 0.3.0, 0.2.5, 0.2.4, 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.0, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1)

run `cmd /c gem list -ra "^^neovim$"`

*** REMOTE GEMS ***
neovim (0.7.1, 0.7.0, 0.6.2, 0.6.1, 0.6.0, 0.5.1, 0.5.0, 0.4.0, 0.3.3, 0.3.2, 0.3.1, 0.3.0, 0.2.5, 0.2.4, 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.0, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1)
2020-05-30 14:29:24 +02:00
Viktor Kojouharov
5a9226c800
lua: simple snippet support in the completion items (#12118)
Old behavior is: foo(${placeholder: bar, ...)

with lots of random garbage you'd never want inserted.

New behavior is: foo(bar, baz) 

(which maybe is good, maybe is bad [depends on user], but definitely better than it was).

-----

* Implement rudimentary snippet parsing

Add support for parsing and discarding snippet tokens from the completion items.

Fixes #11982

* Enable snippet support

* Functional tests for snippet parsing

Add simplified real-world snippet text examples to the completion items
test

* Add a test for nested snippet tokens

* Remove TODO comment

* Return the unmodified item if the format is plain text

* Add a plain text completion item
2020-05-28 08:31:56 -04:00
Christian Clason
2ca8f02a64
lsp: add preview_location util function (#12368)
* add preview_location

* add doc stub

* doc style; return bufnr&winnr of preview

* doc: function may return nil

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>

* doc: fixup

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
2020-05-26 09:07:10 -04:00
Hirokazu Hata
15b762761a
lsp: make the command error message more detailed (#11633)
* lsp.lua: make the error message more detailed

* test: add lsp._cmd_part test
2020-05-26 08:55:45 -04:00
Hirokazu Hata
b996205969
Merge pull request #12367 from h-michael/lsp-log 2020-05-25 11:56:42 +09:00
Jan Edmund Lazo
37ee95504e
vim-patch:8.0.1668: terminal debugger: can't re-open source code window (#12329)
Problem:    Terminal debugger: can't re-open source code window.
Solution:   Add the :Source command.  Also create the window if needed when
            gdb stops at a source line.
c4b533e1e9
2020-05-24 20:46:41 +02:00
kuuote
e89462d985
vim-patch:8.1.2233: cannot get the Vim command line arguments (#12117)
Problem:    Cannot get the Vim command line arguments.
Solution:   Add v:argv. (Dmitri Vereshchagin, closes vim/vim#1322)
69bf634858
2020-05-24 20:45:25 +02:00
Hirokazu Hata
e0e5ada2bf
lsp: change log name to "lsp.log" from "vim-lsp.log"
It's confusing because vim-lsp already has the same name as the plugin name that predates this built-in lsp.
Also, since "vim.fn.stdpath" is used, adding the prefix "nvim-" is redundant, so just "lsp.log" will suffice.
2020-05-23 15:02:38 +09:00
Austin Traver
ef8f965c64
doc: Add optional d for :lcd and :tcd (#12359)
The `:lcd -` command, and `:tcd -` which returns to a previous directory, can be done with `:lc -` and `:tc -` respectively. 

Basically, the d is optional, so I updated the documentation to indicate this in the traditional format.
2020-05-22 21:35:40 -04:00
Mathias Fußenegger
04a0486c66
Change uri_to_fname to not convert non-file URIs (#12351)
* Change uri_to_fname to not convert non-file URIs

A URI with a scheme other than file doesn't have a local file path.

* fixup! Change uri_to_fname to not convert non-file URIs

* fixup! fixup! Change uri_to_fname to not convert non-file URIs
2020-05-22 01:17:21 +09:00
Mathias Fußenegger
044eb56ed2
LSP: Don't swallow bufnr argument from callbacks (#12350)
The callbacks for `textDocument/documentSymbol` and `workspace/symbol`
never received the `bufnr` argument because the logic that adds error
validation and logging swallowed the argument.
2020-05-20 21:18:35 -04:00
Faris A Chugthai
7116105d66
provider: Add python3.9 to autoload/provider/pythonx.vim (#12344)
3.9's scheduled for beta release today.
https://www.python.org/dev/peps/pep-0596/
2020-05-20 13:57:46 +02:00
Andreas Johansson
0aca34e0a9 Use get_line_byte_from_position in jump_to_location 2020-05-19 08:50:31 +02:00
Andreas Johansson
131063e08f Refactor fetching the line byte
Takes the entire LSP position instead of line/col
2020-05-19 08:49:13 +02:00
Mike Hartington
5126546ed7
lsp: fix get diagnositcs 2020-05-19 10:06:30 +09:00
Christian Clason
f2894bffb0
lua: Add highlight.on_yank (#12279)
* add lua function to highlight yanked region

* extract namespace, better naming, default values

* add default for event argument

* free timer

* factor out mark to position calculation

* d'oh

* make sure timer stops before callback (cf. luv example)

* factor out timer, more documentation

* fixup

* validate function argument for schedule

* fix block selection past eol

* correct handling of multibyte characters

* move arguments around, some cleanup

* move utility functions to vim.lua

* use anonymous namespaces, avoid local api

* rename function

* add test for schedule_fn

* fix indent

* turn hl-yank into proper (hightlight) module

* factor out position-to-region function

mark extraction now part of highlight.on_yank

* rename schedule_fn to defer_fn

* add test for vim.region

* todo: handle double-width characters

* remove debug printout

* do not shadow arguments

* defer also callable table

* whitespace change

* move highlight to vim/highlight.lua

* add documentation

* add @return documentation

* test: add check before vim.defer fires

* doc: fixup
2020-05-18 09:49:50 -04:00
TJ DeVries
a6be7a9180
doc: Vim internal variables & options in lua (#12302)
* doc: Add info about vim dicts in lua

* doc: preamble and info

* doc: remove weird spacing

* fixup
2020-05-17 23:29:34 -04:00
Eisuke Kawashima
a91ce497b4
lsp: Fix timezone format of LSP log (ISO 8601) (#12332) 2020-05-17 20:12:22 -04:00
Andreas Johansson
4fbbe1c957
lsp: Handle end lines in apply_text_edits (#12314)
If the LSP sends an end line that is larger than what nvim considers to be the
last line, you get an Index out of bounds error when fetching the line from
nvim, a change that was introduced in #12223. This change removes the strict
indexing and checks the return value from nvim_buf_get_lines.
2020-05-17 13:47:14 -04:00
Hirokazu Hata
ae5bd0454e
lua: add tbl_deep_extend (#11969) 2020-05-17 13:24:34 -04:00
Shougo
d7d69fed18
vim-patch:8.1.1084: cannot delete a match from another window (#12325)
Problem:    Cannot delete a match from another window. (Paul Jolly)
Solution:   Add window ID argument to matchdelete(), clearmatches(),
            getmatches() and setmatches(). (Andy Massimino, closes vim/vim#4178)
aff749145e
2020-05-16 15:25:51 +02:00
Andy Lindeman
986bed2329 Check for nil before checking for empty table
At least the `gopls` language server seems to return nil/null if no code
actions are available. Currently this results in an error:

> Error executing vim.schedule lua callback: shared.lua:199: Expected table, got nil
2020-05-15 21:34:28 -04:00
Jesse
f559e5249e
LSP: Add textDocument/codeAction support (#11607)
* Add textDocument/codeAction

* Add callback for workspace/executeCommand
* Escape newlines in codeAction titles
* Return empty list in get_line_diagnostics if no buffer diagnostics
* Add stub documentation
* Validate context parameter in code_action
* Add support for edit in CodeAction responses
* Group diagnostics by line in vim.lsp.util.get_line_diagnostics()
* Advertise code action literal support
2020-05-16 01:18:59 +02:00
James McCoy
e2a33a6622
Merge pull request #12259 from janlazo/vim-8.1.1186 2020-05-15 10:36:32 -04:00
Mathias Fußenegger
da6f38ab3c
LSP: Add workspace.applyEdit client capabilities (#12313)
applyEdit is supported by the built-in client.
2020-05-14 18:56:33 +02:00
landerlo
02155f5c10
lsp: fix bug when documentEdit version=null for unattached buffer (#12272) 2020-05-13 23:14:52 -04:00
Jan Edmund Lazo
076b0949d0
vim-patch:8.2.0736: some files not recognized as pamenv
Problem:    Some files not recognized as pamenv.
Solution:   Add pam_inv.conf. (closes vim/vim#6065)
aacc6afdb8
2020-05-11 23:57:29 -04:00
Jan Edmund Lazo
393dc2b0f5
vim-patch:8.2.0713: the pam_environment file is not recognized
Problem:    The pam_environment file is not recognized.
Solution:   Add a filetype pattern for pamenv. (closes vim/vim#6051)
6115481053
2020-05-11 22:30:24 -04:00
Jan Edmund Lazo
03cc818fdc
vim-patch:8.2.0705: indent tests don't run on CI for FreeBSD
Problem:    Indent tests don't run on CI for FreeBSD.
Solution:   Set modeline. (Ozaki Kiichi, closes vim/vim#6048)
3657686a0e
2020-05-11 22:30:24 -04:00
Mathias Fußenegger
55b62a937c
LSP: Make applyEdit return a response (#12270)
According to the specification workspace/applyEdit needs to respond with
a `ApplyWorkspaceEditResponse`

See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit

This is a subset of https://github.com/neovim/neovim/pull/11607
2020-05-11 16:56:35 +02:00
Felipe Morales
2f818eb9ee
runtime/tutor: fix broken inline spans #12282
* runtime/syntax/tutor: fix broken inline spans

Also, conceal the ends of code blocks.

Re: #11401 and #12273

* fixup
2020-05-08 09:48:25 -07:00
Christian Clason
281e44f7bb
lsp: Make apply_text_edits non-ASCII safe (#12223)
* Make apply_text_edits non-ASCII safe

Use `vim.str_byteindex` to correct starting and ending positions for text edits if the line contains non-ASCII characters.

Fixes #12221

* text_edit may be applied to other buffers

* make sure the buffer is loaded

* add comments

* add test for non-ASCII edits
2020-05-08 10:04:41 -04:00
Hirokazu Hata
9a67b030d9
lsp: Handle unknown CompletionItemKind and SymbolKind (#12257)
* lsp: handle kinds not specified in protocol

fix: #12200
If the client set "symbolKind.valueSet",
the client must handle it properly even if it receives a value outside the specification.

* test: add lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} test case

* lsp: make lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} private
2020-05-07 16:23:25 -04:00
Gabriel Sanches
7432b3ca4c
lsp: set buflisted when jumping to location (#12253) 2020-05-07 09:30:42 -04:00
Justin M. Keyes
f04a9a2c9a
Merge #12203 from janlazo/vim-8.2.0648
vim-patch:8.1.{800,868,1581},8.2.{648,649,663,678,681,688,691,692}
2020-05-05 23:38:15 -04:00
Hennadii Chernyshchyk
d2766b06c8
vim-patch:8.1.1120: cannot easily get directory entry matches #12222
Problem:    Cannot easily get directory entry matches.
Solution:   Add the readdir() function. (Yasuhiro Matsumoto, closes vim/vim#2439)
543c9b1921

closes #12212
2020-05-05 08:15:45 -07:00
Justin M. Keyes
7b764bb43d terminal: disable 'scrolloff' (fixes flicker)
Besides the special-case in get_scrolloff_value(), it makes sense for
'scrolloff' and 'sidescrolloff' to reflect the correct values (for
plugins, scripts, …).

ref 53d607af9c53accfd634435908fb79061f1212b9
ref #11915
ref #12230
2020-05-04 21:21:33 -07:00
Gabriel Sanches
f605eeec65
lsp: fix tagstack for location jump #12248 2020-05-04 20:12:35 -07:00
Mathias Fußenegger
2c40a38b39
LSP: Avoid URI-to-fname conversion for non-file URIs #12243
Fixes https://github.com/neovim/neovim/issues/12210
2020-05-04 20:06:40 -07:00
Booome
ebee77e73c
checkhealth/ruby: fix off-by-one error #12245
Co-authored-by: BodongLiKolmostar <bodong.li@kolmostar.com>
2020-05-04 19:58:45 -07:00
Matthieu Coudron
496b668ad1
Merge pull request #12237 from h-michael/vim-nil
lsp: text_document.version may be vim.NIL not nil
2020-05-04 09:53:00 +02:00
Jan Edmund Lazo
88f4650114
vim-patch:8.2.0688: output clobbered if setting 'verbose' to see shell commands
Problem:    Output clobbered if setting 'verbose' to see shell commands.
Solution:   Only output "Searching for" when 'verbose' is 11 or higher.
647a530b33
2020-05-03 13:40:25 -04:00
Jan Edmund Lazo
560ce25359
vim-patch:8.2.0663: not all systemd temp files are recognized
Problem:    Not all systemd temp files are recognized.
Solution:   Add two more patterns. (Jamie Macdonald, closes vim/vim#6003)
512fe833c3
2020-05-03 13:16:38 -04:00
Christian Clason
501ef95298
lsp: fixup workspace symbol capabilities (#12233)
use workspace.symbol instead of workspaceSymbol to mimic the lsp spec.
2020-05-03 18:01:04 +02:00
Matthieu Coudron
d13c1642ae
Merge pull request #12228 from h-michael/fix-docsyms-to-items
lsp: fix lsp.util.symbols_to_items with DocumentSymbol has children
2020-05-02 18:42:10 +02:00
Christian Clason
ea347b18d8
lsp: add workspace/symbol (#12224)
* lsp: add workspace/symbol
* refactor symbol callback
* set hierarchical symbol support to true
* add documentation and default mapping

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
2020-05-02 17:56:05 +02:00
Christian Clason
2f42e4d0c8
LSP: Support LocationLink (#12231)
* support LocationLink in callbacks
* announce linkSupport in client capabilities
2020-05-02 15:21:07 +02:00
Hirokazu Hata
d0af0f5c9e
lsp: fix lsp.util.symbols_to_items
fix: https://github.com/neovim/neovim/pull/11931#issuecomment-622422581

There was an error in the process of flattening the hierarchical structure.
So when DocumentSymbol has children, our client can't handle it correctly.
2020-05-02 15:16:35 +09:00
ckipp01
6dc8398944 [LSP] check for vim.NIL and add apply_text_document_edit tests 2020-05-01 17:40:03 +02:00
Ghjuvan Lacambre
fe4383216b
doc/UI: mode_info_set: mention colors should be swapped #12211
When attr_id is 0, the cursor's colors should be swapped, otherwise the
cursor might be invisible.

Closes #12198
2020-05-01 07:34:28 -07:00
Thomas Vigouroux
e5022c61ed
treesitter: unknown predicates always match #12173 2020-04-30 22:43:30 -07:00
Matthieu Coudron
42b441738d
Merge pull request #12204 from archseer/lsp-user-data
lsp/completion: Expose completion_item under completed_items.user_data + vim-patch:8.2.0084
2020-04-30 15:25:15 +02:00
Ghjuvan Lacambre
f9055c585f
LSP: enable using different highlighting rules for LSP signs (#12176)
This commit creates 4 new highlight groups:
- LspDiagnosticsErrorSign
- LspDiagnosticsWarningSign
- LspDiagnosticsInformationSign
- LspDiagnosticsHintSign

These highlight groups are linked to their corresponding LspDiagnostics
highlight groups by default.

This lets users choose a different color for their sign columns and
virtualtext diagnostics.
2020-04-29 16:53:13 +02:00
Blaž Hrastnik
e4a1be779b lsp/completion: Expose completion_item under completed_items.user_data.
By passing through completion_item it's now possible for snippet plugins
to add LSP snippet support.
2020-04-29 13:26:56 +09:00
Blaž Hrastnik
c477b19bdc vim-patch:8.2.0084: complete item "user_data" can only be a string
Problem:    Complete item "user_data" can only be a string.
Solution:   Accept any type of variable. (closes vim/vim#5412)
0892832bb6
2020-04-29 11:15:49 +09:00
Yen3
e9cc383614
LSP: support tagstack #12096 2020-04-28 07:47:22 -07:00
Hirokazu Hata
4e6531ddbd
lsp: use vim.tbl_isempty to check sign (#12190)
ref: #12164
fix #12201
sign_getdefined() returns a list, {} if the sign is not defined.
2020-04-28 07:41:39 -07:00
Yatao Li
9c85caa390 ui_pum_get_pos: return internal pum position if external pum pos not found 2020-04-28 01:52:01 +08:00
Yatao Li
630ec6cfb8 API/UI: Allow UI to set PUM position and size, and pass the position to CompleteChanged 2020-04-28 01:52:02 +08:00
Justin M. Keyes
34ad1ea366
Merge #12155 ':ls filter by terminal, lastused' 2020-04-26 23:57:37 -04:00
jakbyte
5f41717838
LSP: don't redefine LspDiagnostics signs #12164
fix #12162
2020-04-26 15:36:40 -07:00
Mathias Fußenegger
50ff37308a
LSP: Fix show_line_diagnostics #12186
Messed this up in ef0398fe88
2020-04-26 14:56:30 -07:00
Chris Kipp
663b83814d
LSP: Add a check for null version in VersionedTextDocumentIdentifier (#12185)
According to the spec there is the possibility that when a
VersionedTextDocumentIdentifier is used in a TextEdit the value may be
null. Currently we don't check for this and always assume that it's set.
So currently if a TextEdit comes in for a rename for example with the
version null, it fails as we are comparing the bufnumber with nil.

https://microsoft.github.io/language-server-protocol/specification#versionedTextDocumentIdentifier
2020-04-26 16:51:41 +02:00
Thore Weilbier
68511924d0
LSP: remove obsolete "peek definition" code #12178
The method with the name 'textDocument/peekDefinition' is not part of
the official language server protocol specification. Therefore no
language server can/will support this. Thereby all related code and
documentation as been removed.
2020-04-25 21:47:48 -07:00
Mathias Fußenegger
ef0398fe88
LSP: Expose diagnostics grouped by bufnr (#11932)
Expose `vim.lsp.buf.diagnostics_by_buf`

This makes it easier to customize the diagnostics behavior. For example
to defer the update they can override the
`textDocument/publishDiagnostics` callback to only call
`buf_diagnostics_save_positions` and then defer the other actions to a
autocmd event.
2020-04-25 15:46:58 +02:00
Hirokazu Hata
78d58eaf61
lsp: remove buffer version on buffer_detach (#12029)
When we save the buffer, the buffer is detached and attached again.
So the client also needs to remove the buffer version once.
2020-04-25 14:58:35 +02:00
Thore Weilbier
deb4566cab
lsp: callback for references now opens qf (#12171)
In contrast to other callbacks for LSP requests like
`textDocument/documentSymbols`, does the one for references not open the
quickfix window after the quickfix list was filled. This left the user
in a situation he don't know what or if something had happen.

Related to: neovim/neovim#12170
2020-04-23 13:36:19 +02:00
Rob Pilling
978a6bcaf2 vim-patch:8.1.2225: the "last used" info of a buffer is under used
Problem:    The "last used" info of a buffer is under used.
Solution:   Add "lastused" to getbufinfo(). List buffers sorted by last-used
            field. (Andi Massimino, closes vim/vim#4722)
52410575be
2020-04-21 21:40:22 +01:00
Hirokazu Hata
633322a020
lsp: do not assert even if the code does not exist in ErrorCodes (#11981)
There is ErrorCodes in the LSP specification, but in ResponseError.code
it is not used and the actual type is number.
Some language servers response original error cods and this is valid spec.
So we shouldn't assert even if the code does not exist in ErrorCodes.

ref: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#responseMessage
2020-04-21 15:42:48 +02:00
Khangal
0c637898f9
lsp: textDocument/definition can return Location or Location[] (#12014)
* https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition

Co-authored-by: Khangal Jargalsaikhan <khangal.j@irbis.sg>
2020-04-21 15:16:58 +02:00
Hirokazu Hata
2a5d766581
doc: fix vim.lsp.stop_all_clients doc (#12055) 2020-04-21 14:51:51 +02:00
Matthieu Coudron
9678fe4cfb
Merge pull request #11989 from Weypare/textEdit
LSP/completion: add textEdit support
2020-04-20 21:31:19 +02:00
Andrey Avramenko
e6cfc1b158 LSP/completion: Add completion text helper function 2020-04-20 14:09:13 +03:00
Hirokazu Hata
adec9fb444
lsp: export convert_signature_help_to_markdown_lines (#11950)
This function is also useful for users to create their own `textDocument/signatureHelp` callback function.
2020-04-19 23:40:54 +02:00
Rob Pilling
9d59f066cb vim-patch:8.0.1651: cannot filter :ls output for terminal buffers
Problem:    Cannot filter :ls output for terminal buffers.
Solution:   Add flags for terminal buffers. (Marcin Szamotulski, closes vim/vim#2751)
0751f51a5b
2020-04-19 20:18:41 +01:00
Tristan Konolige
bf0f745861
lua: allow deepcopy of functions (#12136) 2020-04-19 01:04:37 +02:00
Hirokazu Hata
c5466ba6ef
lsp: replace the event that closes the signature help preview window from InsertCharPre to CursolMovedI (#11954)
In the case of InsertCharPre, it is inconvenient because the signature help is displayed
when backspaced in insert mode, so change it to CursolMovedI.
2020-04-18 19:04:47 +02:00
Ghjuvan Lacambre
7d4451c657
LSP: fix breakage when severity isn't specified (#12027)
Before this commit, the LSP client would throw errors when messages
without severity would be sent by the server. We make severity default
to `Error` as a kludge before proper heuristics to discover the severity
of a message are found.
2020-04-18 18:21:08 +02:00
Matthieu Coudron
9ac5bc4b0b
Merge pull request #12141 from vigoux/treesitter_fix
[RFC] Update treesitter runtime
Get rid of our utf8proc dependency

Note that we unconditionnally escape treesitter queries, might need to be revisited.
2020-04-18 16:05:16 +02:00
Thomas Vigouroux
1fb44ba835 treesitter: escape backslashes in queries
Treesitter changed their decoders and apparently thus causing this
change.

This decoder change happened on
ee9a3c0ebb218990cf391ed987be7f2448c54a73.
2020-04-18 09:20:13 +02:00
Jan Edmund Lazo
b3d669b40b
vim-patch:8.2.0589: .bsd file type not recognized
Problem:    .bsd file type not recognized.
Solution:   Recognize .bsd as BSDL. (Daniel Kho, closes vim/vim#5945)
0fc1288aef
2020-04-17 21:14:26 -04:00
Micah Halter
a5818204b1
doc:Fix incorrect nvim config paths in documentation (#12134)
Updates  remaining  ~/.vim with ~/.config/nvim
2020-04-16 20:49:05 +02:00
George Zhao
51b4fc4778
lsp: provide a default for missing reference kind (#12127)
Fix #12122

>Error executing vim.schedule lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp/util.lua:560: Expected lua string

Some lsp server(e.g. https://github.com/bash-lsp/bash-language-server) not have kind in reference, reference["kind"] is nil
2020-04-16 18:30:03 +02:00
erw7
e8269a3ab5
win,runtime: Fix problem when win32yank was a symbolic link in WSL [skip ci] (#12124)
On some versions of Windows, WSL is unable to execute symbolic links to
Windows executables (microsoft/WSL#3999). As a workaround for that problem
this changes to use resolve() on WSL if win32yank was a symbolic link.

fixes #12113.
2020-04-15 14:54:23 +02:00
Jan Edmund Lazo
cf223e7d78
vim-patch:8.2.0549: user systemd files not recognized
Problem:    User systemd files not recognized.
Solution:   Add filetype patterns. (Kevin Locke, closes vim/vim#5914)
3b922f1138
2020-04-13 12:00:34 -04:00
Jan Edmund Lazo
dfb8dc8b45
vim-patch:8.2.0415: bsdl filetype is not detected
Problem:    Bsdl filetype is not detected.
Solution:   Add an entry in the filetype list. (Daniel Kho, closes vim/vim#5810)
40d235e730
2020-04-13 12:00:32 -04:00
Santos Gallegos
1f56f9a4b3
netrw.vim: gx should ignore terminal buffers #12091
netrw thinks it's a remote file due the name of a terminal buffer (term://),
but a terminal buffer isn't a file.

Fixes https://github.com/neovim/neovim/issues/4612#issuecomment-600321171
2020-04-08 08:57:32 -07:00
Björn Linse
1fe0b329fe api/ui: win_viewport event for visible range and cursor position in window 2020-04-01 19:43:55 +02:00
Hirokazu Hata
4139678f97
vim.uri: fix uri_to_fname (#12059)
fix: #12056
If the colon of the drive letter of windows is URI encoded,
it doesn't match the expected pattern, so decode it first.
2020-03-30 14:30:24 +02:00
Matthieu Coudron
e700a88bb6
Merge pull request #11746 from Billy4195/add_wildmenu_key
[RFC] Wildmenu support C-E and C-Y as popupmenu
2020-03-28 14:25:54 +01:00
Zantox
4d53bdccc6 doc: Fix wildmenu doc inconsistencies and typos
Fix typos, capitalization to match block, and remove the angle brackets
on the CTRL keys to match other documentation.
2020-03-28 14:07:59 +08:00
Will Eccles
87d892afa0
vim-patch:8.1.0864 Make 'scrolloff' and 'sidescrolloff' options window local (#11854)
Problem: cannot have a local value for 'scrolloff' and 'sidescrolloff'

Author: Bram Moolenar

375e339007
2020-03-17 20:05:34 +01:00
Björn Linse
5a5c2f0290
Merge pull request #11927 from Jesse-Bakker/lsp-buf-version
LSP: Use buffer version instead of changedtick for edits
2020-03-16 21:57:51 +01:00
Jan Edmund Lazo
716bebad48
vim-patch:8.2.0360: yaml files are only recognized by the file extension
Problem:    Yaml files are only recognized by the file extension.
Solution:   Check for a line starting with "%YAML". (Jason Franklin)
8eab731328
2020-03-07 23:14:43 -05:00
Andrey Avramenko
ccb038dc6a LSP/completion: add textEdit support
According to lsp specification, value of insertText should be ignored if
textEdit is provided.
2020-03-06 19:40:46 +02:00
Hirokazu Hata
fbc4c4fd36
lsp: make showMessage and logMessage callbacks different (#11942)
According to the LSP specification, showMessage is what is displayed and logMessage is what is stored.
Since these are different things, I devide the callback into those that match.
2020-03-02 14:27:30 +01:00
Matthieu Coudron
d22fd58629
Merge pull request #11716 from teto/folds_auto_backup
[RFC] foldcolumn autowidth
2020-03-02 13:56:27 +01:00
Matthieu Coudron
6f261d2394 updating doc 2020-03-02 12:59:35 +01:00
Hirokazu Hata
e35ff7371f
lua: add vim.tbl_len() #11889 2020-03-01 23:38:43 -08:00
Jan Edmund Lazo
1caa85b677
vim-patch:8.1.1466: not updating priority on existing sign
Problem:    Not updating priority on existing sign.
Solution:   Set the sign priority.  Add a test. (Yegappan Lakshmanan)
58a7f87c86
2020-03-01 20:02:09 -05:00
Jan Edmund Lazo
d846f47cc8
vim-patch:8.1.0881: can execute shell commands in rvim through interfaces
Problem:    Can execute shell commands in rvim through interfaces.
Solution:   Disable using interfaces in restricted mode. Allow for writing
            file with writefile(), histadd() and a few others.
8c62a08faf
2020-03-01 20:02:09 -05:00
Jan Edmund Lazo
eba8a9ca1d
vim-patch:8.1.1510: a plugin cannot easily expand a command like done internally
Problem:    A plugin cannot easily expand a command like done internally.
Solution:   Add the expandcmd() function. (Yegappan Lakshmanan, closes vim/vim#4514)
80dad48c50
2020-03-01 03:57:58 -05:00
Rob Pilling
5e0c435ca1 man.vim: Handle man errors when looking for man-paths
Fallback to simply globbing the tag we're given. This matches the
original behaviour of `man.vim`, prior to c6afad78d3.

fixes #11794
closes #11918
2020-02-29 23:44:43 -08:00
Justin M. Keyes
1b0a770340 Merge #11805 'vim-patch:8.1.0619' 2020-02-29 17:37:15 -08:00
Hirokazu Hata
16262472cd
lsp: add 'textDocument/documentSymbol’ callback
Spec: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol
2020-03-01 09:10:02 +09:00
Jan Edmund Lazo
3c12ee333a
vim-patch:8.1.0619: :echomsg and :echoerr do not handle List and Dict
Problem:    :echomsg and :echoerr do not handle List and Dict like :echo does.
            (Daniel Hahler)
Solution:   Be more tolerant about the expression result type.
461a7fcfce

Add lua functional tests for :echo,:echon,:echomsg,:echoerr
because nvim did not port "test_" functions from Vim
that modify internal state.

Testing :echoerr via try/catch is sufficient.
2020-02-29 17:40:00 -05:00
Hirokazu Hata
f157fdef7e
lsp: add bufnr to callback function arguments
DocumentSymbol type doesn't have location field.
So when we'll add 'textDocument/documentSymbol’ handler, we can't decide which file have we jump to.
2020-02-28 09:03:17 +09:00
Jesse Bakker
1fe01b36de Use buffer version instead of changedtick for edits 2020-02-27 14:53:11 +01:00
Mathias Fussenegger
38201650cd LSP: Remove diagnostic message handling in locations_to_items
`locations_to_items` is for turning `Location[]` into items, not for
`Diagnostic[]`
2020-02-27 12:50:12 +01:00
Mathias Fussenegger
220a2b05c6 LSP/references: Add context to locations returned by server
This changes the `textDocument/references' callback to annotate the
locations returned by the server with the content present at the
locations range.

The quickfix list then looks as follows:

    cr8/insert_fake_data.py|17 col 32| from .misc import parse_table, parse_version
    cr8/insert_fake_data.py|43 col 15| version = parse_version(r['rows'][0][0])
    cr8/java_magic.py|8 col 22| from cr8.misc import parse_version
    cr8/java_magic.py|30 col 19| version = parse_version(fst)
    cr8/java_magic.py|33 col 16| return parse_version(version_str)

Instead of:

    cr8/insert_fake_data.py|17 col 32|
    cr8/insert_fake_data.py|43 col 15|
    cr8/java_magic.py|8 col 22|
    cr8/java_magic.py|30 col 19|
    cr8/java_magic.py|33 col 16|
2020-02-27 12:49:49 +01:00
Björn Linse
52124f286c
Merge pull request #11880 from bfredl/tree-sitter-regex
add regex support in treesitter queries
2020-02-27 12:28:47 +01:00
Alvaro Muñoz
83add102cf
Add signs for Lsp diagnostics (#11668)
* Add signs for Lsp diagnostics
* defer sign definition until init.vim is loaded
2020-02-27 12:12:53 +01:00
Mathias Fußenegger
cb8b9428ca
LSP/hover: Do not throw away contents if first line is empty (#11939)
haskell-ide-engine sends `hover` payloads as follows:

    {
      contents = {
        kind = "markdown",
        value = "\n```haskell\nfoo :: Either String (Integer, Text)\n```\n`foo` *local*"
      },
      range = {
        end = {
          character = 5,
          line = 57
        },
        start = {
          character = 2,
          line = 57
        }
      }
    }

`value` starts with `\n`. The logic in `convert_input_to_markdown_lines`
threw away the whole information.
2020-02-27 00:00:06 +01:00
Alvaro Muñoz
ad745f9da2
add support to show diagnostics count in statusline (#11641)
* add support to show diagnostics count in statusline
* documentation
2020-02-26 20:22:14 +01:00
Alvaro Muñoz
ca8699378c
LSP: implement documentHighlight (#11638)
* implement documentHighlight
* fix bug
* document highlight groups
* use uppercase for help section title
* documentation
2020-02-26 20:10:16 +01:00
Björn Linse
9c00fea585 lua: add regex support, and @match support in treesitter queries 2020-02-26 19:39:02 +01:00
Björn Linse
08af82b9cb treesitter: redraw on changed query 2020-02-26 19:39:02 +01:00
Mathias Fußenegger
ff1730373c
lsp/completion: show duplicates in completion popup #11920
Allow duplicates so that in languages with overloaded functions it will
show all signatures.

E.g. instead of having a single (last one wins)

    add(int index, String element)

It shows all signatures:

    add(String e) : boolean
    add(int index, String element) : void
2020-02-21 00:34:07 -08:00
Jan Edmund Lazo
7ed4837298
vim-patch:8.1.1122: char2nr() does not handle composing characters
Problem:    char2nr() does not handle composing characters.
Solution:   Add str2list() and list2str(). (Ozaki Kiichi, closes vim/vim#4190)
9d40128afd

'utf8' optional param is noop unlike Vim.
2020-02-20 23:39:17 -05:00
Hirokazu Hata
f3d4ddd0f8
lsp: make functions private and use filter function 2020-02-19 07:39:56 +09:00
Hirokazu Hata
c1bfc8093f
lsp: respect the sort order if there is sortText 2020-02-19 07:27:35 +09:00
Hirokazu Hata
4ac376740c
lsp: fix textDocument/completion handling
fix: #11826
Some lanuguage servers return complementary candidates whose prefixes do not match are also returned.
So we exclude completion candidates whose prefix does not match.
ex) Microsoft python-language-server, rust-analyzer
2020-02-19 07:27:29 +09:00
Billy Su
dd5d00aaa9 doc: C-Y and C-E in wildmenu completion
Add description of C-Y and C-E in wildmenu completion
2020-02-18 17:10:29 +08:00
Hirokazu Hata
e2ed8053bf
lua: move test helper function, map and filter, to vim.shared module 2020-02-18 17:43:10 +09:00
Justin M. Keyes
a446fbc8fa lsp/rpc.lua: fix env application function
Env vars must be merged with the current env.
2020-02-16 22:09:28 -08:00
Justin M. Keyes
1eb0f5371a LSP: fix validate_client_config
- `cmd_env` is a table not a function.
- tests: Set $NVIM_LOG_FILE for fake LSP server.
2020-02-16 17:53:33 -08:00
Jan Edmund Lazo
a1d6c2f5c9
checkhealth: allow 'sudo install' of 'Neovim::Ext' #11874
cpanm cannot look for Perl modules from root directories
without sudo so it creates '~/perl5/' and look for Perl modules in there.
Whether this directory existed before running cpanm or not,
cpanm returns a warning to advice the user to setup local::lib
in order to use modules in '~/perl5/' and exits with error code 0.
Each line in the warning always starts with '!'.

Display this warning to the user.
Continue parsing the version number if the warning can be ignored
because lines that are not prefixed with '!' are valid output.

Fix #11858
2020-02-15 16:02:52 -08:00