Commit Graph

15384 Commits

Author SHA1 Message Date
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
cyy
1656367b90
win/l10n: add zh-* locale aliases #11963 2020-02-29 14:11:57 -08:00
erw7
78f1eccc86
deps: Fix luv-static build issues #11961
- Fix an issue where CMAKE_BUILD_TYPE was not reflected during
  construction.
- Remove the switch that uses the static library(-MTd, -MT) because it was
  specified in the CMakeLists.txt of luv when building on MSVC.

related: https://github.com/luvit/luv/pull/461
2020-02-29 13:47:56 -08:00
Matthieu Coudron
49cd750d6a
Merge pull request #11910 from mfussenegger/references-ctx
LSP/references: Add context to locations returned by server
2020-02-27 15:59:48 +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
78ec95ce7d
Merge pull request #11946 from bfredl/ts-sync
treesitter: update vendored tree-sitter runtime
2020-02-26 19:39:56 +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
Björn Linse
3ce9b05653 treesitter: update vendored tree-sitter runtime
tree-sitter/tree-sitter commit 6cb8d24de2d99c4c50c9a0fd1e719ca5b3abc87f

Included files are:
lib/include/tree-sitter/*.h
lib/src/*.[ch]
lib/src/unicode/*
LICENSE
2020-02-25 22:20:23 +01:00
Jakub Łuczyński
96059d72e5
TUI: reset background color before scroll #11909
fixes #11893
2020-02-23 17:59:37 -08:00
Björn Linse
c036e24f39
Merge pull request #11890 from cryptomilk/master-gcc10-fno-common
Fix issues revealed by gcc10 setting -fno-common by default
2020-02-23 16:03:24 +01:00
Björn Linse
7591fafd76
Merge pull request #11934 from h-michael/restore
clang/scan-build: restore required code
2020-02-23 11:02:21 +01:00
Andreas Schneider
0504f2f88d cmake: Check for -fno-common and use it if available 2020-02-23 09:49:33 +01:00
Andreas Schneider
823b2104c3 nvim: Correctly setup global channels
As gcc10 uses -fno-common by default, global variables declared with the
same name more than once is not allowed anymore revealing this issue.

We need to define it as extern to access it.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
2020-02-23 09:49:33 +01:00
Andreas Schneider
517bf15603 nvim:msgpack: Correctly set up global ch_before_blocking_events
gcc10 builds with -fno-common by default. This mean you can't define
a global variable with the same name twice.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
2020-02-23 09:49:33 +01:00
Andreas Schneider
986db1adb4 nvim: Fix enum declaration of RemapValues
Instead of declaring an enum, this creates a global variable. As gcc10
uses -fno-common by default, global variables declared with the same
name more than once is not allowed anymore revealing this issue.

Each time this header is included, we define the enum name as a global
variable.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
2020-02-23 09:49:33 +01:00
Andreas Schneider
b87b4a6147 nvim:viml: Fix enum declaration of ExprParserFlags
Instead of declaring an enum, this creates a global variable. As gcc10
uses -fno-common by default, global variables declared with the same
name more than once is not allowed anymore revealing this issue.

Each time this header is included, we define the enum name as a global
variable.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
2020-02-23 09:49:33 +01:00
Andreas Schneider
ebcde1de42 nvim:eval: Fix enum declaration for ListLenSpecials
Instead of declaring an enum, this creates a global variable. As gcc10
uses -fno-common by default, global variables declared with the same
name more than once is not allowed anymore revealing this issue.

Each time this header is included, we define the enum name as a global
variable.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
2020-02-23 09:49:33 +01:00
Hirokazu Hata
599a12e316
clang/scan-build: restore required code
ref: https://github.com/neovim/neovim/pull/11900#discussion_r381860165
2020-02-23 10:14:05 +09:00
Justin M. Keyes
38cda18626 CI/travis: workaround broken homebrew
6.70s$ rvm $brew_ruby do brew bundle --verbose --global
    /usr/local/bin/brew tap homebrew/bundle
    ==> Tapping homebrew/bundle
    Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
    Tapped (102 files, 251.1KB).
    Error: Unknown command: bundle

https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/10
https://twitter.com/AJenbo/status/1175976531480457216
2020-02-22 14:15:08 -08:00
Justin M. Keyes
93c6eb4a66
PVS/V618: fix printf-style args #11888
We intentionally do not translate API errors. 
ref: https://github.com/neovim/neovim/issues/6150
2020-02-22 12:59:39 -08: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
Jakub Łuczyński
82936c3b9a doc: LOG_CALLSTACK: mention "-no-pie" [ci skip]
close #11898
2020-02-21 00:08:26 -08:00
Justin M. Keyes
c8ea09248b
Merge #11914 'vim-patch:8.1.{1122,1868}' 2020-02-20 23:50:44 -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
Jan Edmund Lazo
13b6f7a806
vim-patch:8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Problem:    Multibyte characters in 'listchars' don't work correctly if
            'linebreak' is also enabled. (Martin Tournoij)
Solution:   Make it work correctly. (Christian Brabandt, closes vim/vim#4822,
            closes vim/vim#4812)
69cbbecf54
2020-02-20 22:07:18 -05:00
cballam
9897ad3606
quickfix.c: Fix vimgrep regression #11907
Fix ex_vimgrep to properly ignore filetype when running vimgrep.
This restores vimgrep to behaviour before function refactoring.

fix #9842
fix #11856
2020-02-19 22:53:58 -08:00
Björn Linse
ab12a22941
Merge pull request #11908 from bfredl/qf_msg-fixup
test: always use "set more" with :digraph test
2020-02-19 19:33:29 +01:00
Björn Linse
a380526c0f test: always use "set more" with :digraph test
otherwise we risk the same issue as with ex_cmds/digraphs_spec.lua
2020-02-19 13:08:12 +01:00
Justin M. Keyes
e8f160c82f
Merge #11895 'lsp: fix textDocument/completion handling' 2020-02-18 23:38:52 -08:00
Hirokazu Hata
521b79c0f8
clang/scan-build: fix dead stores #11900 2020-02-18 20:54:19 -08:00
Justin M. Keyes
ce15977d70
Merge #11887 'loop_close: close all handles' 2020-02-18 20:34:07 -08: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
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
ceac76daa5 loop_close: close all handles
- Move uv_stop(), it still causes a "leak" on exit somehow.
- Tenatively restore `UV_RUN_DEFAULT`.  It shouldn't hang since we
  clobber the handles via `uv_walk((h)=>uv_close(h))`. Although this
  still "leaks" on exit, it's faster than the 2-second timeout.

fix #11820
fix #7376
2020-02-17 23:50:59 -08:00
Justin M. Keyes
6d48d0bd15 loop_close: call uv_stop(), fix bug
- Call uv_stop().
- Restore `uv_loop_close` condition (braindead cosmetic change from
  a2efc9cf8b that caused uv_loop_close *not* to be called if
  wait=false, sorry).

Not doing `uv_walk(() => uv_close)`: see source comment for explanation.

fix #11820
fix #7376

Q: Should we restore use of `UV_RUN_DEFAULT`/`UV_RUN_ONCE` (removed in
   a2efc9cf8b)?
A: The while-loop (hopefully) achieves the same purpose while avoiding
   a hang.
2020-02-17 22:41:13 -08:00
Justin M. Keyes
a2efc9cf8b
loop_close: timout after 2 seconds #11821
never UV_RUN_DEFAULT
ref #11820
ref #7376
2020-02-16 23:54:24 -08:00
Justin M. Keyes
b353a5c05f
test: always dump logs on failure #11886
Whenever `eq()`, `ok()`, etc. fails, include log tail in the failure
message. This helps to correlate log messages with a particular test
failure.
2020-02-16 23:30:24 -08:00
Justin M. Keyes
03f245c0b8
Merge #11873 from janlazo/vim-8.1.0786
vim-patch:8.0.1660,8.1.{43,786,1201,2129,2131,2187,2223,2259},8.2.{241,267}
2020-02-16 23:18:24 -08:00
Justin M. Keyes
0c5d2ffebe
Merge #11837 'LSP: fixes, improve test visibility' 2020-02-16 23:02:23 -08:00
Justin M. Keyes
6e13b9d261 test/LSP: assert contents of log file 2020-02-16 22:09:28 -08: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