Commit Graph

15646 Commits

Author SHA1 Message Date
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
Justin M. Keyes
9816173fb3
Merge #12275 from erw7/profile-fix-use-after-free
viml/profile: fix missing fixes when merging vim-patch:8.1.0130

Fix #12255

### Steps to reproduce using `nvim -u NORC`

```
nvim -u NORC
:function Test()
:endfunction
:profile start log1
:profile func Test
:call Test()
:profile stop
:profile start log2
:profile func Test
:call Test()
:profile stop
```

### Actual behaviour

#### log1
```
FUNCTION Test()
Called 1 times
...
```

#### log2
```
FUNCTION Test()
Called 2 times
...
```

### Expected behaviour

#### log1
```
FUNCTION Test()
Called 1 times
...
```

#### log2
```
FUNCTION Test()
Called 1 times
...
```
2020-05-09 17:22:08 -04:00
erw7
7872877ce5 test: add more profile tests
- Add a test to make sure that 'profile dump' does not reset the profile.
- Add a test to make sure that 'profile stop' does reset the profile.
2020-05-10 03:16:30 +09:00
erw7
949783fdfa viml/profile: fix issue where profile is not reset on stop 2020-05-09 11:21:52 +09:00
erw7
861aade680 viml/profile: fix use after free
fixes #12255.
2020-05-09 11:21:52 +09: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
TJ DeVries
1407899c32
lua: Add buffer, window and tab accessors (#12268)
* Add buffer, window and tab accessors

* Fix deletion and add tests
2020-05-07 15:22:24 -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
Jesse
48c2198297
paste: support replace mode (#11945)
* paste: support replace mode
* Clean up

Co-authored-by: Jesse Bakker <git@jessebakker.com>
2020-05-05 13:18:41 +02:00
erw7
a467f3f665
tag: fix problem when tagfunc return value is v:null (#12251)
fixes #12250.
2020-05-05 10:33:48 +02:00
Justin M. Keyes
fdd328d568
Merge #12230 'fix :terminal flicker with scrolloff' 2020-05-05 00:32:23 -04: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
LawAbidingCactus
edd5b233d8 terminal: always return zero from get_scrolloff_value() #12230
Fixes flicker

fix #11072
fix #11915
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
erw7
d46c4003cf
funcs: Fix a memory leak in f_expand (#12227)
:echo expand('%', v:false, v:true)

==423== 28 bytes in 1 blocks are definitely lost in loss record 124 of 420
==423==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==423==    by 0x2AD09C: try_malloc (memory.c:71)
==423==    by 0x2AD0B8: xmalloc (memory.c:105)
==423==    by 0x2AE05D: xmallocz (memory.c:182)
==423==    by 0x1F7CF4: vim_strnsave (strings.c:68)
==423==    by 0x318813: eval_vars (ex_docmd.c:8885)
==423==    by 0x34F5FC: f_expand (funcs.c:2058)
==423==    by 0x36D023: call_func (eval.c:6419)
==423==    by 0x370C28: get_func_tv.lto_priv.707 (eval.c:6150)
==423==    by 0x372748: eval7 (eval.c:4326)
==423==    by 0x37291A: eval6 (eval.c:4036)
==423==    by 0x372BF6: eval5 (eval.c:3884)
2020-05-04 10:50:54 +02: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
Hirokazu Hata
67634da714
lsp: add a lsp.util.apply_text_edits test(pending)
We don't handle non-ASCII characters well in UTF-16.
So I add a non-ASCII characters test case.
2020-05-04 09:05:16 +09:00
Hirokazu Hata
0107a194fa
lsp: fix apply_text_document_edit test
lsp.util.buf_versions must be set in advance.
Use helper.insert to create an anonymous buffer,
so create a named buffer for testing without using insert.
2020-05-04 08:10:27 +09:00
Jan Edmund Lazo
ed4df85f6b
vim-patch:8.2.0692: startup test fails on MS-Windows
Problem:    Startup test fails on MS-Windows.
Solution:   Allow for any path.
4515bcdec8
2020-05-03 13:44:13 -04:00
Jan Edmund Lazo
cd16e036d1
vim-patch:8.2.0691: startup test fails
Problem:    Startup test fails.
Solution:   Adjust expected output from -V2 argument.
7779ee30d9
2020-05-03 13:43:08 -04: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
5a0744e446
vim-patch:8.2.0681: pattern for 'hlsearch' highlighting may leak
Problem:    Pattern for 'hlsearch' highlighting may leak. (Dominique Pelle)
Solution:   Call end_search_hl() to make sure the previous pattern is freed.
            (closes vim/vim#6028)
0b6849e9e3
2020-05-03 13:16:38 -04:00
Jan Edmund Lazo
bc29283f20
vim-patch:8.2.0678: rare crash for popup menu
Problem:    Rare crash for popup menu.
Solution:   Check for NULL pointer. (Nobuhiro Takasaki, closes vim/vim#6027)
d58a662f44
2020-05-03 13:16:38 -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
Jan Edmund Lazo
a89d64b687
vim-patch:8.1.0868: crash if triggering garbage collector after a function call
Problem:    Crash if triggering garbage collector after a function call.
            (Michael Henry)
Solution:   Don't call the garbage collector right away, do it later.
            (closes vim/vim#3894)
889da2f243
2020-05-03 13:16:38 -04:00
Jan Edmund Lazo
66369cd9d0
vim-patch:8.1.0800: may use a lot of memory when a function refers itself
Problem:    May use a lot of memory when a function creates a cyclic
            reference.
Solution:   After saving a funccal many times, invoke the garbage collector.
            (closes vim/vim#3835)
4456ab527a
2020-05-03 13:16:37 -04:00
Jan Edmund Lazo
5058b07122
vim-patch:8.1.1581: shared functions for testing are disorganised
Problem:    Shared functions for testing are disorganised.
Solution:   Group finctions in script files. (Ozaki Kiichi, closes vim/vim#4573)
7a39dd7f00
2020-05-03 13:16:37 -04:00
Jan Edmund Lazo
cf9887c838
vim-patch:8.2.0649: undo problem whn an InsertLeave autocommand resets undo
Problem:    Undo problem whn an InsertLeave autocommand resets undo. (Kutsan
            Kaplan)
Solution:   Do not create a new undo block when leaving Insert mode.
db93495d27
2020-05-03 13:16:37 -04:00
Jan Edmund Lazo
a576bf6196
vim-patch:8.2.0648: semicolon search does not work in first line
Problem:    Semicolon search does not work in first line.
Solution:   Allow the cursor to be in line zero. (Christian Brabandt,
            closes vim/vim#5996)
0e71704b77
2020-05-03 13:16:37 -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
Matthieu Coudron
5951ed5d74
Merge pull request #12229 from Billy4195/vim-8.1.0814
[RFC] vim-patch:8.1.{814,816}
2020-05-02 18:29:50 +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
Billy Su
a0a433dffc vim-patch:8.1.0816: test for 'runtimepath' in session fails on MS-Windows
Problem:    Test for 'runtimepath' in session fails on MS-Windows.
Solution:   Skip the test for now.
681b6bc86c
2020-05-02 17:43:25 +08:00
Billy Su
2f27d37517 vim-patch:8.1.0814: :mksession cannot handle a very long 'runtimepath'
Problem:    :mksession cannot handle a very long 'runtimepath'. (Timothy
            Madden)
Solution:   Expand each part separately, instead of the whole option at once.
            (Christian Brabandt, closes vim/vim#3466)
ed18f2c03a
2020-05-02 17:36:48 +08:00
Hirokazu Hata
3eae7d52c5
lsp: add lsp.util.symbols_to_items test 2020-05-02 15:16:43 +09: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
Marvim the Paranoid Android
a6071ac04d
version.c: update [ci skip] #12196
vim-patch:8.2.0621: after running tests asan files may remain
vim-patch:8.2.0622: Haiku: GUI does not compile
vim-patch:8.2.0630: "make tags" does not cover Haiku GUI file
vim-patch:8.2.0631: Haiku file formatted with wrong tabstop
vim-patch:8.2.0632: crash when using Haiku
vim-patch:8.2.0636: :messages does not show the maintainer when $LANG is unset
vim-patch:8.2.0642: Vim9: using invalid index
vim-patch:8.2.0643: terminal uses brown instead of dark yellow
vim-patch:8.2.0645: MS-Windows terminal: CTRL-C does not get to child job
vim-patch:8.2.0651: old style benchmark test still in list of distributed files
vim-patch:8.2.0654: building with Python fails
vim-patch:8.2.0664: included undesired changes in Makefile
vim-patch:8.2.0667: cannot install Haiku version from source
vim-patch:8.2.0671: Haiku: compiler warnings
2020-05-01 08:08:27 -07:00
Eisuke Kawashima
250e4e699f
build: Inherit -n and -jN flags if Ninja #12219 2020-05-01 07:36:56 -07: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