Commit Graph

2771 Commits

Author SHA1 Message Date
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
Björn Linse
dc0e534a91
Merge pull request #11864 from h-michael/deepcopy
lua: vim.deepcopy() and vim.tbl_extend() should preserve vim.empty_dict()
2020-02-15 18:10:48 +01:00
Hirokazu Hata
c230c7d1a6
lua: if second argument is vim.empty_dict(), vim.tbl_extend uses empty_dict() instead of {} 2020-02-14 19:35:46 +09:00
Jan Edmund Lazo
1b200d9936
checkhealth: ignore cpamn "!" output #11869
cpanm outputs a warning that suggest to use 'sudo' or use local::lib.
cpanm exits with 0 so nvim thinks that the command worked.

cpanm output that starts with "!"  is likely an error.

Close #11858
2020-02-14 00:43:28 -08:00
Mathias Fußenegger
d9657b3ae2
doc/lsp: start_client config cmd must be a list (#11866)
doc/lsp: start_client config cmd must be a list

After the merge of https://github.com/neovim/neovim/pull/11847 cmd can
no longer be a string but must be a list.
2020-02-13 20:38:47 +01:00
Hirokazu Hata
417fc6ccf7
lua: vim.deepcopy uses empty_dict() instead of {} for empty_dict()
fix: https://github.com/neovim/nvim-lsp/issues/94
2020-02-13 11:55:43 +09:00
erw7
aec3d7915c vim-patch:8.1.0091: MS-Windows: Cannot interrupt gdb when program is running
Problem:    MS-Windows: Cannot interrupt gdb when program is running.
Solution:   Add debugbreak() and use it in the terminal debugger.
            Respect 'modified' in a prompt buffer.
4551c0a9fc
2020-02-12 16:03:45 +09:00
erw7
b015c4741c vim-patch:8.1.0071: terminal debugger only works with the terminal feature
Problem:    Terminal debugger only works with the terminal feature.
Solution:   Make it also work with a prompt buffer.  Makes it possible to use
            on MS-Windows. Various other improvements. (closes vim/vim#3012)
b3307b5e7e
2020-02-12 15:30:17 +09:00
erw7
fe395ae210 vim-patch:8.1.0069: cannot handle pressing CTRL-C in a prompt buffer
Problem:    Cannot handle pressing CTRL-C in a prompt buffer.
Solution:   Add prompt_setinterrupt().
0e5979a6d4
2020-02-12 15:30:06 +09:00
erw7
4813ad48cd vim-patch:8.1.0027: difficult to make a plugin that feeds a line to a job
Problem:    Difficult to make a plugin that feeds a line to a job.
Solution:   Add the nitial code for the "prompt" buftype.
f273245f64
2020-02-12 15:16:32 +09:00
Matthieu Coudron
58ec72f9fd
LSP: rename validate_command to _cmd_parts #11847
and now only accepts a list of strings (instead of string or list).
2020-02-11 21:48:25 -08:00
Jesse-Bakker
5d5b068d5b
LSP: Refine formatting tabSize #11834
Use the logic explained in the softtabstop help section for defining
the tabSize parameter in formatting requests. This means that:

 - if softtabstop is 0, tabstop is used
 - if softtabstop < 0, shiftwidth is used
 - if softtabstop > 0, softtabstop is used

When inserting spaces instead of tabs, softtabstop is used in vim.
Therefor it would be more logical to use it when formatting instead
of the current tabstop.
2020-02-10 22:53:14 -08:00
Björn Linse
95fd28f4a1 treesitter: use internal "decorations" buffer 2020-02-10 13:10:15 +01:00
Mathias Fußenegger
174f7a2980 lsp: Support text edit on inactive buffer (#11843)
Using `vim.lsp.buf.rename()` can result in receiving a TextEdit that
affects a file for which there is no active or loaded buffer.

In that case `api.nvim_buf_get_lines(...)` returned an empty result,
leading to an error.

Closes https://github.com/neovim/neovim/issues/11790
2020-02-10 09:05:42 +09:00
Hirokazu Hata
dd8b29cfe2
LSP: set InitializeParams.rootPath value #11838
InitializeParams.rootPath is deprecated now. But some language servers still use it.
2020-02-08 22:51:02 -08:00
Björn Linse
00c57c98df treesitter: add standard &rtp/parser/ search path for parsers 2020-02-07 09:22:55 +01:00
Ramiro Morales
405f49a9b1
doc: Fix {spell,mlang}.txt files text encoding #11814
These had broken encodings, set it to UTF-8. All remianing Neovim
non-ASCII documentation files are UTF-8 encoded. And so are their Vim
original versions.
2020-02-05 01:07:01 -08:00
Justin M. Keyes
983086f42e checkhealth: fix accidental change [ci skip] 2020-02-02 18:34:22 -08:00
Justin M. Keyes
c8abe931db checkhealth: avoid irrelevant virtualenv executables 2020-02-02 18:25:17 -08:00
Justin M. Keyes
3cd5a8d149 checkhealth: cleanup, brevity 2020-02-02 18:25:17 -08:00
David Lukes
370a33a85d checkhealth: bin directory is Scripts/ on Windows 2020-02-02 16:22:07 -08:00
David Lukes
1b20014972 checkhealth: print -> sys.stdout.write
Co-Authored-By: Peter Lithammer <peter.lithammer@gmail.com>
2020-02-02 16:21:55 -08:00
David Lukes
bf85cc0909 checkhealth: better $VIRTUAL_ENV validation #11781
fix #11753
close #11781

The virtualenv troubleshooting in the Python provider health checks is
supposed to help the user determine whether running Python from Neovim
(as in `system('python')` or `system(exepath('python'))`) will use the
correct executable when a virtualenv is active. Currently however, it
issues spurious warnings in legitimate setups, and conversely, fails to
warn about potentially problematic ones.

See https://github.com/neovim/neovim/issues/11753#issuecomment-578715584
for a more detailed analysis, but at a high level, this is due to two
things:

- the virtualenv check is part of the Python provider check defined in
`s:check_python`, which uses a roundabout and sometimes erroneous way of
determining the Python executable
- more generally, it shouldn't be part of the provider check at all,
because it's not really related to the Python *provider*, i.e. the
Python executable which can communicate with Neovim via `pynvim`, but to
the Python the user is editing source files for, which typically
shouldn't even have `pynvim` installed

This patch reimplements the virtualenv check and factors it out into its
own separate function, which is however still kept in
`health/provider.vim` alongside the rest of the Python troubleshooting,
since troubleshooting all Python-related stuff in one place is probably
a good idea in order to alleviate any potential confusion (e.g. users
who run only provider checks might be left wondering whether their
virtualenv Python was properly detected if the report only shows their
global Python as the provider used by Neovim).
2020-02-02 16:21:55 -08:00
Jan Edmund Lazo
9c1a31927d
vim-patch:8.2.0161: not recognizing .gv file as dot filetype
Problem:    Not recognizing .gv file as dot filetype.
Solution:   Add *.gv to dot pattern. (closes vim/vim#5544)
f8ddb25789
2020-02-01 18:06:34 -05:00
Alkeryn
26199fedca
vim-patch:8.2.0190: detect Kotlin files [ci skip] #11796
Problem:    Kotlin files are not recognized.
Solution:   Detect Kotlin files. (Alkeryn, closes vim/vim#5560)
ab067a21b9
2020-02-01 14:15:36 -08:00
Jan Edmund Lazo
31f31b40a8
vim-patch:8.2.0077: settagstack() cannot truncate at current index
Problem:    settagstack() cannot truncate at current index.
Solution:   Add the "t" action. (Yegappan Lakshmanan, closes vim/vim#5417)
271fa08a35
2020-01-29 21:00:11 -05:00
Matthieu Coudron
e956ea7672 LSP: show diagnostic in qf/loclist #11777
instead of the content of the file at this line.

ref https://github.com/neovim/nvim-lsp/issues/69
2020-01-28 01:45:25 -08:00
Justin M. Keyes
d3a9d75c04
Merge #11772 from janlazo/vim-8.2.0152
vim-patch:8.2.{152,158}
2020-01-26 19:54:26 -08:00
Jan Edmund Lazo
5ede2766c8
vim-patch:8.2.0158: triggering CompleteDone earlier is not backwards compatible
Problem:    Triggering CompleteDone earlier is not backwards compatible.
            (Daniel Hahler)
Solution:   Add CompleteDonePre instead.
3f169ce17e
2020-01-26 21:50:37 -05:00
Justin M. Keyes
1c3ca4f18f mksession: always unix slashes "/" for filepaths 2020-01-26 17:30:47 -08:00
Chris LaRose
c6ff23d7a0 terminal: absolute CWD in term:// URI #11289
This makes it possible to restore the working directory of :terminal
buffers when reading those buffers from a session file.

Fixes #11288

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2020-01-26 00:24:42 -08:00
Jan Edmund Lazo
71ee46accf vim-patch:8.2.0141: no swift filetype detection (#11747)
Problem:    No swift filetype detection.
Solution:   Add swift, swiftgyb and sil. (Emir Sarı, closes vim/vim#5517)
0d76683e09
2020-01-23 02:21:05 +01:00
Björn Linse
91bd1ddf3b
Merge pull request #11740 from Billy4195/fix_jobstop
make jobstop() return 0 instead of throw error for already stopped job
2020-01-22 19:23:29 +01:00
Billy Su
041ec8997a Fix f_jobstop() failed loudly
The return value of jobstop()
@return 1 for valid job id
        0 for invalid id, including jobs have exited or stopped
2020-01-22 17:30:43 +08:00
Jan Edmund Lazo
670a14a2a6
provider/perl: add latest version health check 2020-01-20 19:44:00 -05:00
Jan Edmund Lazo
da0cd5436b
doc: provider-perl
Enable 'has("perl")' as an alias for 'g:loaded_perl_provider'.

TODO:
- +perl interface
2020-01-20 19:43:59 -05:00
Jan Edmund Lazo
2063af3c94
provider/perl: add health check 2020-01-20 19:43:59 -05:00
Jan Edmund Lazo
ef3e610138
provider/perl: simplify detection 2020-01-20 19:43:59 -05:00
Jacques Germishuys
c25b5a1576
remote plugins: add support for perl hosts 2020-01-20 19:43:59 -05:00
Justin M. Keyes
b648b38bb1 doc: autocmd.txt 2020-01-18 21:32:14 -08:00
Justin M. Keyes
156c25e498 WinClosed: sort auevents.lua; improve tests
- test: reduce verbosity, condense redundancy, improve readability
- auevents.lua: keep events sorted by name. ref afd1d412fa
2020-01-18 21:32:14 -08:00
Marcos ALMEIDA
757aad92e8 autocmd: add WinClosed event
- only fire once, just before freeing mem
- trigger when on a different buffer
- avoid recursive calls in another tab
2020-01-18 17:06:03 -08:00
Jan Edmund Lazo
ad35cbca76
vim-patch:8.2.0123: complete_info() does not work when CompleteDone is triggered
Problem:    complete_info() does not work when CompleteDone is triggered.
Solution:   Trigger CompleteDone before clearing the info.
17e04781f2
2020-01-17 23:46:00 -05:00
Justin M. Keyes
9231684986
doc [ci skip] #11656 2020-01-12 23:41:55 -08:00
Matthieu Coudron
05ea3c1997 defaults: set fillchars "foldsep" to box line #11702
"│" U+2502 BOX DRAWINGS LIGHT VERTICAL

Fallback to old default | if 'ambiwidth' is set.
2020-01-11 16:36:11 -08:00
Justin M. Keyes
0a1c6d9a37 LSP: highlight groups test, doc 2020-01-08 22:18:18 -08:00
Alvaro Muñoz
e616ec4394 LSP: differentiate diagnostic underline by severity 2020-01-08 08:50:02 -08:00
Rob Pilling
4a7d84ae60 man.vim: workaround for 'cscopetag' #11679
The old `:Man` implementation would take either the word under
the cursor, or the argument passed in, and load that as a man page.

Since we now use 'tagfunc' and look for all relevant man-pages, if
your system has several (i.e. same name, different sections), we return
several, giving the user an option.

This works for most tag commands except `:tjump`, which will
fail if there's multiple tags to choose from. This just happens to
be what the cscope code uses (it actually attempts to prompt the
user, but this fails).
2020-01-06 21:57:36 -08:00
Jan Edmund Lazo
3c764aabb5
vim-patch:8.1.1308: the Normal highlight is not defined when compiled with GUI
Problem:    The Normal highlight is not defined when compiled with GUI.
Solution:   Always define Normal. (Christian Brabandt, closes vim/vim#4072)
f90b6e03a9
2020-01-06 00:18:02 -05:00
Ville Hakulinen
c241395b3d LSP: place hover window by vertical space #11657
Make the hover window position itself vertically wherever is the most
space available.
2020-01-03 04:39:25 -08:00
Björn Linse
6e3793bf11 clipboard: do not close stderr together with stdout (fixup #11617)
stderr is needed to get error messages in case of failure, and
job handler expects it to be open.
2020-01-02 19:27:55 +01:00
butwerenotthereyet
cbc8d72fde tabpage: track last-used tabpage #11626
In a multi-window scenario, it is possible to return focus to the last
accessed window via n_CTRL-W_p.  However, in the case of a multi-tab
scenario, there was previously no way to return focus to the last
accessed *tab*.  Here, that ability is added via n_g<tab>.

Additionally, the index of the previous tab is exposed via
tabpagenr('#'), mirroring the existing functionality of winnr('#').
2020-01-02 06:06:11 -08:00
Jan Edmund Lazo
67d7906652 clipboard: close stdout when copying via xclip #11617
test_registers.vim can fail even if a clipboard manager is running.
If a clipboard manager is not running, this test always fails with xclip.
Use xsel as a workaround.
https://github.com/astrand/xclip/issues/20 suggests closing stdout
when sending input via stdin.

Environment
- Ubuntu Xenial
- Vim 7.4 (any app with broken clipboard code will do)
- Neovim nightly

Steps to reproduce:
0. Start the clipboard manager.
1. Open a file in Vim on Linux.
   Vim should have +clipboard enabled.
   'set clipboard='
2. Yank some text to the clipboard register.
3. Quit Vim.
4. Run 'cd /path/to/neovim/repo/'
5. Run 'make oldtest'.
   Do not run any individual tests.
   They likely pass with or without this fix.

Before fix: test_registers.vim can fail.
After fix: test_registers.vim always passes.

Close https://github.com/neovim/neovim/issues/7958

https://wiki.ubuntu.com/ClipboardPersistence#The_state_of_things
2020-01-02 00:41:36 -08:00
William Chargin
3917064504 doc: mention *_host_prog ordering sensitivity #11639
Any uses of `has("python3")` will cause the `g:loaded_python3_provider`
variable to be set if the system path does not have a Python with Neovim
support. Subsequent assignments to `g:python3_host_program` will
therefore not cause the provider to be activated.
2020-01-02 00:38:49 -08:00
Björn Linse
8645d480bd
Merge pull request #11470 from bfredl/emptytable
metatable for empty dict value
2020-01-01 21:03:08 +01:00
Björn Linse
ea4127e9a7 lua: metatable for empty dict value 2020-01-01 19:26:29 +01:00
Jan Edmund Lazo
abaabd1d03
vim-patch:8.2.0074: Python 3 unicode test someitmes fails
Problem:    Python 3 unicode test someitmes fails.
Solution:   Make 'termencoding' empty.  Correct number of error message.
4b7cdca230
2020-01-01 13:11:54 -05:00
Justin M. Keyes
a251b588ac
Merge #11642 'CI: test powershell core' 2020-01-01 06:36:10 -08:00
Jan Edmund Lazo
0da7774cf0
doc: powershell is 'pwsh' on non-Windows OS 2019-12-31 22:29:40 -05:00
Justin M. Keyes
ac6ebfcc1d LSP: eliminate lsp.print_debug_info…()
Reduce API surface.  We should not add functions unless they are really
needed.  Users should be nudged to use vim.inspect() directly.
2019-12-31 15:39:17 -08:00
Justin M. Keyes
8b84119650 LSP: eliminate lsp.stop_all_clients()
Reduce API surface.  We don't need so many variations of functions. Too
many functions means verbose, largely redundant documentation, tests,
and cognitive burden.
2019-12-31 15:39:17 -08:00
Justin M. Keyes
b112fe828f gen_vimdoc.py: generate LSP docs 2019-12-31 08:06:48 -08:00
Justin M. Keyes
d839c35871 doc: LSP 2019-12-31 02:55:12 -08:00
Justin M. Keyes
93e7c7e3bd doc [ci skip] 2019-12-31 02:25:10 -08:00
Justin M. Keyes
c24f8f46b4 gen_vimdoc.py: sort by name 2019-12-30 03:31:32 -08:00
Justin M. Keyes
b81547ce6d gen_vimdoc.py: better handling of inline (non-block) nodes 2019-12-30 03:12:24 -08:00
Jan Edmund Lazo
6c606c1191
vim-patch:8.1.1875: cannot get size and position of the popup menu
Problem:    Cannot get size and position of the popup menu.
Solution:   Add pum_getpos(). (Ben Jackson, closes vim/vim#4827)
e9bd57286a

https://github.com/neovim/neovim/pull/11562 backported the vim patch.
This patch only updates the runtime/doc/ files to match Vim.
2019-12-29 18:34:05 -05:00
Jan Edmund Lazo
1e693ac97d
vim-patch:8.1.1303: not possible to hide a balloon
Problem:    Not possible to hide a balloon.
Solution:   Hide the balloon when balloon_show() is called with an empty
            string or list.  Add balloon_gettext().
be0a2597ae
2019-12-29 18:34:04 -05:00
Jan Edmund Lazo
669d675ef3
vim-patch:8.0.1495: having 'pumwidth' default to zero has no merit
Problem:    Having 'pumwidth' default to zero has no merit.
Solution:   Make the default 15, as the actual default value.
42443c7d7f

Includes 'pumwidth' documentation changes from 8.0.1531.
Sort 'pum*' option in alphabetical order.
2019-12-29 18:31:04 -05:00
Jan Edmund Lazo
703ed11c97
vim-patch:8.0.1491: the minimum width of the popup menu is hard coded
Problem:    The minimum width of the popup menu is hard coded.
Solution:   Add the 'pumwidth' option. (Christian Brabandt, James McCoy,
            closes vim/vim#2314)
a8f04aa275
2019-12-29 18:15:46 -05:00
Ashkan Kiani
34a59242a0 Revert "runtime: Add vim.lsp.get_client_by_name" #11623
reverts 680693e263 #11603
2019-12-29 09:05:32 +01:00
artem-nefedov
ddffd31737 netrw.vim: do not save +/* registers p.2 #11625
remove last place where system clipboard was used by netrw
(extends 6c22c7ab97)

fix #11592
2019-12-29 08:57:28 +01:00
Hirokazu Hata
680693e263 runtime: Add vim.lsp.get_client_by_name (#11603)
Since the client name is more obvious than the client id for the user, add an
API to get the lsp client by the client name.
2019-12-28 09:28:00 -08:00
Rafik Draoui
4f4c06a7a4 doc: update 'cpoptions' default value #11619
Since version 0.2, the `_` compatibility option is turned on by default.

ref 1743df82f9
ref b0196586de/src/nvim/option_defs.h (L135)
2019-12-28 08:07:27 +01:00
Justin M. Keyes
b0196586de
Merge #11568 'fillchars: foldopen, foldsep, foldclose' 2019-12-26 07:06:43 +01:00
Matthieu Coudron
bbad324b17 fillchars: adding foldopen, foldsep, foldclose
You can try it with
set fillchars+=foldopen:▾,foldsep:│,foldclose:▸
2019-12-25 14:28:36 +01:00
Ashkan Kiani
07a2260e1d
LSP: Handle rpc RequestCancelled specifically. (#11606)
This was creating extra noise in errors that we should've been handling
internally.

Fixes #11515
2019-12-24 14:28:09 -08:00
Daniel Hahler
b3686b1597 system(), jobstart(): raise error on non-executable #11234
* tv_to_argv: error when cmd is not executable
  Callers always assume that emsg was emitted:
  - https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L12509
  - https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L17923
  - https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L18202
* test/functional/provider: display reason from missing_provider
* provider#node#Detect: skip / handle non-existing node executable
2019-12-24 07:53:56 +01:00
Björn Linse
440695c296 tree-sitter: implement query functionality and highlighting prototype [skip.lint] 2019-12-22 12:51:46 +01:00
Jelte Fennema
c60f656839 termdebug.vim: Comment out Winbar related things #11552 2019-12-22 04:45:11 +01:00
Ashkan Kiani
ee7ac469c6
LSP: Use async completion for omnifunc. (#11578) 2019-12-20 22:49:29 -08:00
Jan Edmund Lazo
a115f23143
vim-patch:8.2.0024: filetype Rego not recognized
Problem:    Filetype Rego not recognized.
Solution:   Add *.rego. (Matt Dunford, closes vim/vim#5376)
a4ce82fe2e
2019-12-20 08:14:54 -05:00
Jan Edmund Lazo
c147806e23
vim-patch:8.2.0019: cannot number of lines of another buffer
Problem:    Cannot number of lines of another buffer.
Solution:   Add "linecount" to getbufinfo(). (Yasuhiro Matsumoto,
            closes vim/vim#5370)
a9e9679de3
2019-12-20 08:14:54 -05:00
Ashkan Kiani
026ba804d1
LSP: Improve the display of the default hover callback. (#11576)
Strips the code blocks from markdown and does syntax highlighting.
2019-12-20 02:50:37 -08:00
Mike Hartington
d00c624ba4 LSP: fix omnifunc findstart (#11522) 2019-12-20 02:46:47 -08:00
Matthieu Coudron
65aca4d857 TUI: can make the cursor transparent #11519
when setting 'guicursor' highlight blend=100.
2019-12-19 12:27:21 -08:00
Seth Fowler
251b20e533 Add support for the pum_getpos() API (#11562)
Add support for the pum_getpos() API
2019-12-16 20:08:55 +01:00
James McCoy
9f3d483c79
Merge pull request #7202 from teto/jobstart_env
[RFC] override environment for jobstart
2019-12-13 06:52:48 -05:00
Matthieu Coudron
19b6237087
jobstart now supports env/clear_env
to modify the environment of the launched job.
2019-12-11 21:07:13 -05:00
butwerenotthereyet
39094b3fae jumplist: browser-style (or 'tagstack') navigation #11530
Traditionally, when navigating to a specific location from the middle of
the jumplist results in shifting the current location to the bottom of
the list and adding the new location after it.  This behavior is not
desireable to all users--see, for example
https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior.

Here, another jumplist behavior is introduced.  When jumpoptions (a new
option set added here) includes stack, the jumplist behaves like the
tagstack or like history in a web browser.  That is, when navigating to
a location from the middle of the jumplist

    2 first
    1 second
    0 third <-- current location
    1 fourth
    2 fifth

to a new location the locations after the current location in the jump
list are discarded

    2 first
    1 second
    0 third
            <-- current location

The result is that when moving forward from that location, the new
location will be appended to the jumplist:

    3 first
    2 second
    1 third
    0 new

If the new location is the same

  new == second

as some previous (but not immediately prior) entry in the jumplist,

    2 first
    1 second
    0 third <-- current location
    1 fourth
    2 fifth

both occurrences preserved

    3 first
    2 second
    1 third
    0 second (new)

when moving forward from that location.

It would be desireable to go farther and, when the new location is the
same as the location that is currently next in the jumplist,

    new == fourth

make the result of navigating to the new location by jumping (e.g. 50gg)
be the same as moving forward in the jumplist

    2 first
    1 second
    0 third
    1 new <-- current location
    2 fifth

and simply increment the jumplist index.  That change is NOT part of
this patch because it would require passing the new cursor location to
the function (setpcmark) from all of its callees.  That in turn would
require those callees to know *before* calling what the new cursor
location is, which do they do not currently.
2019-12-10 00:56:56 -08:00
Justin M. Keyes
6c22c7ab97 netrw.vim: do not save +/* registers
netrw shouldn't be touching these in the first place.

fix #11089
ref #6892
ref #6695
2019-12-10 00:46:04 -08:00
Justin M. Keyes
7111fe9459
doc: LSP [ci skip] #11524 2019-12-10 00:29:39 -08:00
Jan Edmund Lazo
6a4bdeb572
vim-patch:8.1.2408: syntax menu and build instructions outdated
Problem:    Syntax menu and build instructions outdated.
Solution:   Update build instructions and syntax menu.
bfd3433330
2019-12-07 17:39:43 -05:00
Jakub Łuczyński
30ed245d00 LSP: Add jump when calling gotodef (#11521) 2019-12-07 03:34:22 -08:00
Matthieu Coudron
fbae9f8541 runtime/syntax/vim.vim: highlight "blend" keyword #11520 2019-12-05 22:14:54 -08:00
Justin M. Keyes
3aa95ef27e
defaults: set nostartofline (#11135)
Having the cursor change column can be surprising.

Force startofline in functional and old tests.
Remove the functional breakindent test, as it's a subset of the oldtest one.
2019-12-03 20:58:03 -08:00
Matthieu Coudron
3beef8ee1c defaults: set nostartofline
Having the cursor change column can be surprising.

Force startofline in functional and old tests.
Remove the functional breakindent test, as it's a subset of the oldtest one.
2019-12-03 13:31:17 +01:00
Justin M. Keyes
a3b6c2a3dc API: rename nvim_execute_lua => nvim_exec_lua
- We already find ourselves renaming nvim_execute_lua in tests and
  scripts, which suggests "exec" is the verb we actually want.
- Add "exec" verb to `:help dev-api`.
2019-12-02 22:06:42 -08:00
Justin M. Keyes
c34130d13a API: deprecate nvim_command_output 2019-12-02 20:52:06 -08:00
Ashkan Kiani
70b6061666
Add vim.startswith and vim.endswith (#11248) 2019-12-01 05:32:55 -08:00
Jan Edmund Lazo
6c6afbcddd
doc: mention OS pseudo-features in :h feature-list 2019-11-30 16:21:33 -05:00
Daniel Hahler
0a9ecf460a vim-patch:8.1.2315: switchbuf=uselast #11480
Problem:    Not always using the right window when jumping to an error.
Solution:   Add the "uselast" flag in 'switchbuf'. (closes vim/vim#1652)
539aa6b25e
2019-11-29 09:57:27 -08:00
Daniel Hahler
f33371c03f vim-patch:8.1.2017: cannot execute commands after closing cmdline window #11479
Problem:    Cannot execute commands after closing the cmdline window.
Solution:   Also trigger BufEnter and WinEnter. (closes vim/vim#4762)
96e38a86a7

Fixes https://github.com/neovim/neovim/issues/11279.
2019-11-29 09:51:25 -08:00
Björn Linse
e138c4c874
Merge pull request #11469 from bfredl/lspdiag
lsp: allow the user to config LspDiagnosticError like any hl group
2019-11-29 12:38:07 +01:00
Rob Pilling
ee1199eaba man.vim: remove K mapping #11472
Since #11457 this mapping is no longer necessary.
'keywordprg' defaults to :Man in options.lua
2019-11-28 14:04:40 -08:00
Björn Linse
950690e48a lsp: allow the user to config LspDiagnosticError etc by standard means 2019-11-28 18:48:18 +01:00
Von Random
7fef0f8db4 runtime: russian-jcukenwintype.vim keymap #11461
Author: Denis Proskurin <danwerspb@gmail.com>
2019-11-27 22:57:11 -08:00
Brian Wignall
001e69cd46 doc: fix typos
close #11459
2019-11-27 22:47:25 -08:00
Justin M. Keyes
86c4a87fe9
Merge #11467 from janlazo/vim-8.1.2345
vim-patch:8.1.{1252,1253,1254,1268,2345,2348,2349}
2019-11-27 22:06:31 -08:00
Rob Pilling
33beeed4d9 man.vim: Improve ft=man 'iskeyword' #11457
This addresses a minor quality problem with the recent `'tagfunc'`
changes for `man.vim` (see [link]).

Currently, with the cursor on a parenthese, hitting `K` will jump us to
the man page of the next mentioned entry, instead of the one to which
the parenthese (or section number) belongs.

```
pcrepattern(3), terminfo(5), glob(7), regex(7).
       e.g. ^        e.g. ^
```

Adding the parentheses to `'iskeyword'` means we correctly handle these cases too.

[link]: https://github.com/neovim/neovim/pull/11280#discussion_r348342357
2019-11-27 21:01:04 -08:00
Jan Edmund Lazo
d697690e24
vim-patch:8.1.2345: .cjs files are not recognized as Javascript
Problem:    .cjs files are not recognized as Javascript.
Solution:   Add the *.cjs pattern. (closes vim/vim#5268)
c1faf3dc38
2019-11-26 20:01:16 -05:00
Björn Linse
5f9209389b
Merge pull request #11445 from bfredl/fcslcs
options: make 'fillchars' and 'listchars' global-local instead of local-only
2019-11-26 22:10:13 +01:00
Björn Linse
49a40f425d options: make 'fillchars' and 'listchars' global-local
These options were previously global. A global-local window option
behaves closer to a global option "per default" (i e with :set),
but still supports local behavior via :setl

Also this restores back-compat for nvim_set_option("fcs", ...)
which are currently broken on 0.4.x but worked in earlier versions
2019-11-26 19:14:54 +01:00
Ashkan Kiani
6e8c5779cf
LSP: Move default buf callbacks to vim.lsp.callbacks (#11452)
- In the process, refactored focusable_preview to a util function.
- Add text for locations_to_items of the current line.
- Improve location callback to handle multiple return values by using
set_qflist.
- Remove update_tagstack and leave note for future travelers.
2019-11-26 05:59:40 -08:00
Justin M. Keyes
36d1335a66
UI: emit mouse_on/mouse_off on attach #11455
closes #11372
2019-11-25 08:56:42 -08:00
Justin M. Keyes
fd5710ae9a
doc + extmarks tweaks #11421
- nvim_buf_get_extmarks: rename "amount" => "limit"
- rename `set_extmark_index_from_obj`
2019-11-25 01:08:02 -08:00
Justin M. Keyes
f460bae441 release.sh [ci skip] 2019-11-24 17:53:33 -08:00
Justin M. Keyes
544eeeb0d6
Merge #11451 'man.vim: Fixes' 2019-11-24 17:37:47 -08:00
Anmol Sethi
afaa062643
man.vim: Update maintainer email 2019-11-24 20:31:46 -05:00
Anmol Sethi
4ce96e4979
man.vim: Hard wrap by default
Closes #11436
2019-11-24 20:31:46 -05:00
Anmol Sethi
078f279691
man.vim: Document how to disable bold highlighting
Closes #11435
2019-11-24 20:31:18 -05:00
Anmol Sethi
526798a941 man.vim: Ensure 'modifiable' in man#init_pager #11450 2019-11-24 17:30:04 -08:00
Ashkan Kiani
a9036502dc Bring vim into local scope 2019-11-24 03:14:03 -08:00
Ashkan Kiani
b35f6aa9dd Add support for textDocument/references.
Add set_qflist and set_loclist.
- Also add locations_to_items, which calculates byte offsets for
character positions in files and avoids unnecessary operations.
2019-11-24 03:01:18 -08:00
Ashkan Kiani
b78fdd7ce5 Merge branch 'master' into lsp-followup 2019-11-24 02:29:23 -08:00
Ashkan Kiani
d0d38fc36e Lua: vim.env, vim.{g,v,w,bo,wo} #11442
- Add vim variable meta accessors: vim.env, vim.{g,v,w,bo,wo}
- Redo gen_char_blob to generate multiple blobs instead of just one
  so that multiple Lua modules can be inlined.
- Reorder vim.lua inclusion so that it can use previously defined C
  functions and utility functions like vim.shared and vim.inspect things.
- Inline shared.lua into nvim, but also keep it available in runtime.
2019-11-24 02:28:48 -08:00
Ashkan Kiani
d410812311 UI tweaks.
- Hide diagnostics on client exit
- Stop insert on popup focus.
- Hide popup on insertchar (for signature_help)
2019-11-23 16:14:24 -08:00
Ashkan Kiani
42c53d266a Merge remote-tracking branch 'origin/master' into lsp-followup 2019-11-23 14:28:54 -08:00
Dennis B
d5f14b8372 Clear 'cc' in nvim_open_win 'minimal' style #11361 (#11427)
* Clear 'cc' in nvim_open_win 'minimal' style #11361

Add 'colorcolumn' to the list of options that should be cleared when creating
a 'minimal'-style floating window.
2019-11-22 10:55:04 +01:00
Ashkan Kiani
73487f4130 Improve the character_offset code. 2019-11-22 00:31:10 -08:00
Ashkan Kiani
78991ffbf4 Improve performance of util.set_lines + bugfix
Also permit character_offset for col past the end of line (useful in
range formatting).
2019-11-22 00:02:04 -08:00
Ashkan Kiani
a3d67dac5f Fix encoding translation in other places. 2019-11-21 16:23:12 -08:00
Ashkan Kiani
c055ca00ce Remove comments. 2019-11-21 15:55:45 -08:00
Ashkan Kiani
43d73ee884 Fix position params for encoding. 2019-11-21 15:41:32 -08:00
Ashkan Kiani
da07e71b18 Account for character length in jump position. 2019-11-21 15:34:28 -08:00
Ashkan Kiani
b27965538d Fix hovers staying on bufhidden 2019-11-21 15:20:32 -08:00
Ashkan Kiani
bcae04f6c6 Updates
- Use correct implementation of text_edits.
- Send indent options to rangeFormatting and formatting.
- Remove references to vim bindings and filetype from lsp.txt
- Add more examples to docs.
- Add before_init to allow changing initialize_params.
2019-11-21 15:19:06 -08:00
Ashkan Kiani
6a51401378 Merge remote-tracking branch 'origin/master' into lsp-followup 2019-11-21 10:04:32 -08:00
Björn Linse
76e0a8bd93 lsp: transmit "\n" after last line when 'eol' is set
Otherwise some servers like clangd will emit spurious
"no newline at end of file" warnings.
2019-11-21 11:12:57 +01:00
Ashkan Kiani
b7170f2d72 Remove resolve_bufnr/lualint 2019-11-20 20:59:52 -08:00
Ashkan Kiani
7bf766ad09 Use the apply_text_edits from util. 2019-11-20 20:59:12 -08:00
Ashkan Kiani
6d9f48ddcf Fix reference in rename. 2019-11-20 20:57:21 -08:00
Ashkan Kiani
6fc409d593 Add full text_edit implementation.
- Implements textDocument/formatting, textDocument/rangeFormatting,
workspace/applyEdit.
TODO:
- still has edge cases around replacement probably. Only tested with
inserts on the same position.
2019-11-20 20:51:44 -08:00
Ashkan Kiani
b984f613c1 Extend list_extend to take start/finish. 2019-11-20 17:09:21 -08:00
Ashkan Kiani
9b7f956715 Use err_message in default_callbacks 2019-11-20 16:39:45 -08:00
Ashkan Kiani
4c7ef3754a Satisfy lualint. 2019-11-20 16:37:23 -08:00
Ashkan Kiani
93beae4f31 Fix rename support. 2019-11-20 16:35:11 -08:00
Ashkan Kiani
1e16b3cf28 Spaces not tabs. 2019-11-20 16:16:36 -08:00
Ashkan Kiani
c40f8600d2 Change error writer to not be annoying. 2019-11-20 16:16:13 -08:00
Ashkan Kiani
03eb88848c Change callback resolution to be dynamic.
This allows default_callbacks to be specified after client creation to
be considered. Also it simplifies the code.
2019-11-20 16:09:03 -08:00
Ashkan Kiani
a4b7004f48 Move everything to buf & default_callbacks
- Rename builtin_callbacks to default_callbacks and slightly change its
semantics:
  - No longer contains the default implementations. Instead, any
  default_callbacks will be used in preference for our .buf methods.
  - Add this to the docs.
2019-11-20 16:03:32 -08:00
Ashkan Kiani
2d580756ca Add everything to lsp.buf and get rid of autoload. 2019-11-20 15:35:18 -08:00
Ashkan Kiani
c83380cf80 Add lsp.buf and hover implementation. 2019-11-20 14:21:57 -08:00
Ashkan Kiani
ff65cc990a Bugfix. Don't use nvim.lua that doesn't exist :) 2019-11-20 11:41:45 -08:00
Ashkan Kiani
568b454088 Add vim.uri_to_bufnr 2019-11-20 11:39:54 -08:00
Ashkan Kiani
0904ffe387 Bugfixes.
- Return after an error in RPC.
- Use an empty vim table for serialization.
2019-11-20 11:36:50 -08:00
Ashkan Kiani
3ae9b3781e Bugfix for floating_preview
Don't modify your inputs.
2019-11-20 11:34:10 -08:00
Ashkan Kiani
69a0712a9c Reduce code blocks in markdown previews.
If the preview is just a code block, then use the language as the
filetype instead of using markdown.
This reduces the size of the preview.
2019-11-20 11:23:50 -08:00
Justin M. Keyes
525bb1b55d Merge #11280 "man.vim: implement 'tagfunc'" 2019-11-20 00:31:22 -08:00
Joe Hermaszewski
1ff5b60cb9 vim-patch:8.1.0251: support full paths for 'backupdir' #11269
Problem:    Using a full path is supported for 'directory' but not for
            'backupdir'. (Mikolaj Machowski)
Solution:   Support 'backupdir' as well. (Christian Brabandt, closes vim/vim#179)
b782ba475a
2019-11-17 23:38:27 -08:00
Justin M. Keyes
af53a0c012
doc: Lua [ci skip] #11378
- Rework :help lua-commands
- Rename if_lua.txt => lua.txt
2019-11-17 19:06:59 -08:00
Marco Hinz
97f1222005
provider/python: add python3.8 executable (#11402)
Python 3.8 was released 2019-10-14:

  https://www.python.org/dev/peps/pep-0569
2019-11-17 14:23:17 +01:00
Justin M. Keyes
a45890e82e
Merge #11406 from janlazo/vim-8.1.1922
vim-patch:8.1.{1922,2289,2305}
2019-11-16 18:43:03 -08:00
Nikolay Shebanov
7116a41e30 tutor: change arrows (--->) to symbols ✗ and ✓ #11404
* Display ✓ or ✗ based on the line user sees
* Add vim-tutor-mode expectations to the lines marked with an arrow.
* Fix some existing expectations to behave predictably.
2019-11-16 15:35:32 -08:00
Jan Edmund Lazo
b83027858a
vim-patch:8.1.2289: after :diffsplit closing the window does not disable diff
Problem:    After :diffsplit closing the window does not disable diff.
Solution:   Add "closeoff" to 'diffopt' and add it to the default.
c823477979
2019-11-16 16:40:25 -05:00
Björn Linse
dab40f43b1 Add v:lua.func() vimL syntax for calling lua
Also simplify error messages when calling lua from vimL.
2019-11-16 22:33:21 +01:00
Jan Edmund Lazo
6989ac05f4
vim-patch:8.1.0927: USE_CR is never defined
Problem:    USE_CR is never defined.
Solution:   Remove usage of USE_CR. (Ken Takata, closes vim/vim#3958)
0059074008
2019-11-13 19:25:39 -05:00
Rob Pilling
807e4039cb Sort man pages by relevance during goto_tag() 2019-11-13 22:00:11 +00:00
Rob Pilling
18c5f6ab9f Don't attempt swapfiles for man pages
This is because we now use :tag to open a man page, which attempts
to open a swap file for a path under man://...
2019-11-13 21:57:17 +00:00
Rob Pilling
aeee41192b Remove eventignore - :Man now uses :tag to populate the page 2019-11-13 21:56:28 +00:00
Ashkan Kiani
00dc12c5d8 lua LSP client: initial implementation (#11336)
Mainly configuration and RPC infrastructure can be considered "done". Specific requests and their callbacks will be improved later (and also served by plugins). There are also some TODO:s for the client itself, like incremental updates.

Co-authored by at-tjdevries and at-h-michael, with many review/suggestion contributions.
2019-11-13 21:55:26 +01:00
Justin M. Keyes
54473e9a67 doc [ci skip] 2019-11-11 22:12:59 -08:00
Justin M. Keyes
0190de9aab
Merge #11307 'Lua: vim.validate()' 2019-11-11 21:25:16 -08:00
Björn Linse
18a8b702c0 extmark: review changes 2019-11-11 20:18:15 +01:00
timeyyy
a9065a5051 nsmarks: initial commit 2019-11-11 19:43:15 +01:00
Justin M. Keyes
a0d992785f Lua: Use vim.validate() instead of assert() 2019-11-10 23:43:49 -08:00
Justin M. Keyes
7aa4042d3b Lua: vim.validate() 2019-11-10 23:43:49 -08:00
Hirokazu Hata
678a51b1da Lua: vim.validate()
We often want to do type checking of public function arguments.

- test: Rename utility_function_spec.lua to vim_spec.lua
- .luacov: Map lua module names
2019-11-10 22:50:24 -08:00
Justin M. Keyes
b9c9283f72 spellfile.vim: improve error message for missing spellfile
Problem:  If spellfile is missing, then "set spell" in modeline/sandbox
          fails with a non-obvious error.
Solution: Check for sandbox early and give a meaningful error.
          Fixes #11359

Test case:
    # test.latex has `% vim: set spelllang=hu:`
    # no spell file for `hu` yet!
    nvim -u NORC --cmd 'autocmd FileType tex setlocal spell' --cmd 'set modeline' test.latex

Before:
    No spell file for "hu" in utf-8
    Download it?
    Downloading hu.utf-8.spl...
    Error detected while processing /usr/local/share/nvim/runtime/autoload/netrw.vim:
    line  583:
    E12: Command not allowed from exrc/vimrc in current dir or tag search: au WinEnter *^Iif &ft == "netrw"|call s:NetrwInsureWinVars()|endif
    Error detected while processing function spellfile#LoadFile[60]..spellfile#Nread[13]..netrw#NetRead[4]..<SNR>67_NetrwOptionsSave:
    line   66:
    E171: Missing :endif
    Error detected while processing function spellfile#LoadFile[60]..spellfile#Nread:
    line   13:
    E171: Missing :endif
    Error detected while processing function spellfile#LoadFile:
    line   60:
    E171: Missing :endif
    Error detected while processing modelines:
    line    1:
    E12: Command not allowed from exrc/vimrc in current dir or tag search

After:
    Error detected while processing function spellfile#LoadFile:
    line    5:
    E605: Exception not caught: Cannot download spellfile in sandbox/modeline. Try ":set spell" from the cmdline.
    Error detected while processing modelines:
    line    1:
    E12: Command not allowed from exrc/vimrc in current dir or tag search
2019-11-10 12:35:45 -08:00
Marco Hinz
1cb4674547
api: add nvim_buf_get_virtual_text() (#11354)
This adds the missing partner function of nvim_buf_set_virtual_text().
2019-11-10 16:38:04 +01:00
Björn Linse
474d0bcbf7 lua: vim.rpcrequest, vim.rpcnotify, vim.NIL 2019-11-10 13:08:05 +01:00
Justin M. Keyes
9ef16a1628 doc: vim.fn, vim.call(), vim.api [ci skip] 2019-11-06 01:37:50 -08:00
Ashkan Kiani
c66297452c doc: file-change-detect [ci skip] 2019-11-05 21:50:48 -08:00
Marco Hinz
610755ff62
Merge PR #11291 from shanesmith/vim-8.1.1256-take2 2019-11-04 12:28:31 +01:00
Jan Edmund Lazo
471427d045 vim-patch:8.1.2231: introduce gM command #11321
Problem:    Not easy to move to the middle of a text line.
Solution:   Add the gM command. (Yasuhiro Matsumoto, closes vim/vim#2070)
8b530c1ff9
2019-11-01 13:43:20 +09:00
Rob Pilling
c6afad78d3 man.vim: remove push_tag and simplify man#open_page 2019-10-29 18:41:30 +00:00
Jelte Fennema
83b6d9f197 termdebug.vim: reset evalFromBalloonExprResult #11309
The value is used again in case of a pointer and it will cause errors then.
2019-10-28 21:05:49 -07:00
Shane Smith
a4d48d37c1 vim-patch:8.1.1256: cannot navigate through errors relative to the cursor
Problem:    Cannot navigate through errors relative to the cursor.
Solution:   Add :cabove, :cbelow, :labove and :lbelow. (Yegappan Lakshmanan,
            closes vim/vim#4316)
3ff33114d7
2019-10-27 23:43:47 -04:00
Justin M. Keyes
5a212a96a6
Merge #11276 from h-michael/module-pattern
Use module pattern with vim/shared.lua
2019-10-27 15:43:38 -07:00
supermomonga
31536ae003 provider/pythonx: don't assume CWD (empty string) is in path #11304
sys.path.remove("") raises ValueError if the item is missing.

https://docs.python.org/3/library/functions.html#filter:
> filter(function, iterable) is equivalent to the generator expression (item
> for item in iterable if function(item))

fixes #11293
2019-10-27 14:27:22 -07:00
Björn Linse
8ee7c94a92 lua: add vim.fn.{func} for direct access to vimL function
compared to vim.api.|nvim_call_function|, this fixes some typing issues
due to the indirect conversion via the API. float values are preserved
as such (fixes #9389) as well as empty dicts/arrays.

Ref https://github.com/norcalli/nvim.lua for the call syntax
2019-10-27 17:23:17 +01:00
Hirokazu Hata
996a057fb9 lua/stdlib: adjust some validation messages #11271
close #11271
2019-10-26 00:27:01 -07:00
Joshua Rubin
99aa166cb1 man.vim: never switch to non-man window #11286
In order to find if there was already an open man page, the :Man command
would cycle through each window to see if &ft=='man'. This triggers
autocmds, e.g. BufEnter, unnecessarily and can have unexpected
side-effects.

Change the logic to check each window's ft without switching to it
unless it is actually a man window.

Signed-off-by: Joshua Rubin <me@jawa.dev>
2019-10-25 09:41:22 -07:00
Rob Pilling
0173bdf98b man.vim: parse the section from the tag 2019-10-24 22:15:57 +01:00
Rob Pilling
2f0412e61d man.vim: :Man preserves the tag stack 2019-10-24 22:15:57 +01:00
Rob Pilling
63f0ca3263 man.vim: use 'tagfunc' instead of remapping
man#pop_tag() is also no longer used
2019-10-24 21:15:18 +01:00
Rob Pilling
ed72d9597d man.vim: pull out s:get_paths() 2019-10-24 21:15:16 +01:00
Jan Edmund Lazo
f3d6d8750b
vim-patch:8.1.0345: cannot get the window id associated with the location list
Problem:    Cannot get the window id associated with the location list.
Solution:   Add the "filewinid" argument to getloclist(). (Yegappan
            Lakshmanan, closes vim/vim#3202)
c9cc9c78f2
2019-10-23 01:33:16 -04:00
Justin M. Keyes
9e4db2ef50
Merge #11199 from bobrippling/vim-8.1.1228
vim-patch:8.1.{1099,1228,1962} add 'tagfunc'
2019-10-22 20:27:35 -07:00
Hirokazu Hata
c2fc4255f9
runtime: Use module pattern with vim/shared.lua
It's a bit cumbersome for us to add an export target every time we define a new function.
It's also cumbersome to care about the order of definition when creating a new function by referring to other functions in the module.
2019-10-23 10:50:42 +09:00
Rob Pilling
194f7bface vim-patch:8.1.1228: not possible to process tags with a function
Problem:    Not possible to process tags with a function.
Solution:   Add tagfunc() (Christian Brabandt, Andy Massimino, closes vim/vim#4010)
45e18cbdc4
2019-10-22 20:13:02 +01:00