Commit Graph

15546 Commits

Author SHA1 Message Date
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
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
Justin M. Keyes
4cf48dc329 test/LSP: dump logs on error
This will help debug CI flakey failures.

TODO: helpers.assert_log()  -- Explicitly check contents of the logfile.
2020-02-16 19:04:40 -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
Justin M. Keyes
c15bd6cd27 test/LSP: use less-generic exit code
- os.exit(1) is too generic, since code 1 may be caused by Nvim exiting
  for some other reason.  Change it to os.exit(101).
- style: de-architect json_encode/json_decode calls.

Failure seen in travis macOS job:
https://travis-ci.org/neovim/neovim/jobs/647849133

    [  FAILED  ] test/functional/plugin/lsp_spec.lua@ 266 SP basic_init test should not send didOpen if the buffer closes before init
    test/functional/plugin/lsp_spec.lua:297: exit code
    Expected objects to be the same.
    Passed in:
    (number) 1
    Expected:
    (number) 0
    stack traceback:
      test/functional/plugin/lsp_spec.lua:297: in function 'on_exit'
      test/functional/plugin/lsp_spec.lua💯 in function 'test_rpc_server'
      test/functional/plugin/lsp_spec.lua:272: in function <test/functional/plugin/lsp_spec.lua:266>
2020-02-16 17:52:48 -08:00
Justin M. Keyes
b04165859d test: style 2020-02-16 17:24:21 -08:00
Justin M. Keyes
322b2731ed deps: lua-client 0.2.2-1 2020-02-16 17:24:21 -08:00
Jan Edmund Lazo
1ce4b3c9a7
vim-patch:8.2.0267: no check for a following cmd when calling a function fails
Problem:    No check for a following command when calling a function fails.
Solution:   Also check for a following command when inside a try block.
            (closes vim/vim#5642)
e51bb17dd0
2020-02-16 18:04:44 -05:00
Jan Edmund Lazo
acc5fd9fac
vim-patch:8.1.0043: ++bad argument of :edit does not work properly
Problem:    ++bad argument of :edit does not work properly.
Solution:   Return FAIL from get_bad_opt() only when there is no valid
            argument. (Dominique Pelle, Christian Brabandt, closes vim/vim#2966,
            closes vim/vim#2947)
7580849df9
2020-02-16 09:38:15 -05:00
Jan Edmund Lazo
18d86283b0
vim-patch:8.0.1660: the terminal API "drop" command doesn't support options
Problem:    The terminal API "drop" command doesn't support options.
Solution:   Implement the options.
333b80acf3
2020-02-16 09:38:14 -05:00
Jan Edmund Lazo
7955c05acc
vim-patch:8.1.1201: output of :command is hard to read
Problem:    Output of :command is hard to read.
Solution:   Make some columns wider, some narrower.  Truncate the command when
            listing all.
725310d89e
2020-02-16 07:49:44 -05:00
Jan Edmund Lazo
986eafce47
vim-patch:8.1.2187: error for bad regexp even though regexp is not used
Problem:    Error for bad regexp even though regexp is not used when writing
            a file. (Arseny Nasokin)
Solution:   Ignore regexp errors. (closes vim/vim#5059)
b40c2576d4
2020-02-16 07:49:44 -05:00
Jan Edmund Lazo
5e38516a46
vim-patch:8.2.0241: crash when setting 'buftype' to "quickfix"
Problem:    Crash when setting 'buftype' to "quickfix".
Solution:   Check that error list is not NULL. (closes vim/vim#5613)
99234f29aa
2020-02-16 07:49:44 -05:00
Jan Edmund Lazo
bde4f47eb2
vim-patch:8.1.2223: cannot see what buffer an ml_get error is for
Problem:    Cannot see what buffer an ml_get error is for.
Solution:   Add the buffer number and name in the message
cb86893114
2020-02-16 07:49:44 -05:00
Jan Edmund Lazo
0f5bb9faf1
vim-patch:8.1.0786: ml_get error when updating the status line
Problem:    ml_get error when updating the status line and a terminal had its
            scrollback cleared.  (Chris Patuzzo)
Solution:   Check the cursor position when drawing the status line.
            (closes vim/vim#3830)
10772307c4
2020-02-16 07:49:43 -05:00
Jan Edmund Lazo
4907bc2626
vim-patch:8.1.2259: running tests may leave XfakeHOME behind
Problem:    Running tests may leave XfakeHOME behind.
Solution:   Source summarize.vim without using setup.vim. (closes vim/vim#5177)
            Also fix that on MS-Windows the test log isn't echoed.
7d2320414f
2020-02-16 07:49:43 -05:00
Jan Edmund Lazo
e52c22d63c
vim-patch:8.1.2131: MSVC tests fail
Problem:    MSVC tests fail.
Solution:   Replace backslashes with slashes.
c25e702dee
2020-02-16 07:49:43 -05:00
Jan Edmund Lazo
e5aeb2e193
vim-patch:8.1.2129: using hard coded executable path in test
Problem:    Using hard coded executable path in test.
Solution:   Use v:progpath. Use $VIMRUNTIME instead of "runtime". (James
            McCoy, closes vim/vim#5025)
1ac41a5c13
2020-02-16 07:49:43 -05: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
Matthieu Coudron
bb331a9b31
mouse.c: can click on multibyte foldopen/foldclose (#11863)
would previously only work with ascii fillchars.

Added a test.
2020-02-14 16:42:00 +01:00
Björn Linse
61c98a1cf2
Merge pull request #11870 from QnJ1c2kNCg/master
clang analyzer: Dead assignment `ns_id` in nvim_buf_add_highlight
2020-02-14 16:00:49 +01:00
Hirokazu Hata
cdb729b746
lua: add vim.tbl_extend and vim.deepcopy test 2020-02-14 22:36:21 +09: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
erw7
146598efcc
build: Fix MSVC build failure on CI #11865
clean-shared-libraries does nothing useful in MSVC build. Nevertheless,
it deletes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll and causes build
failure in CI.
2020-02-14 00:45:41 -08: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
Bruno Roy
a26943e9b3 clang bug: Dead assignment ns_id
Remove a dead assignment of the `ns_id` variable in the
`src/nvim/api/buffer.c` file.

Refer: https://neovim.io/doc/reports/clang/report-f279da.html#EndPath
2020-02-13 23:09:42 -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
Björn Linse
a73d8ace0b
Merge pull request #11859 from h-michael/empty-dict
check json_encode behavior for vim.empty_dict()
2020-02-12 21:16:42 +01:00
Hirokazu Hata
032ede0203
test: add json_encode test for vim.empty_dict() 2020-02-12 21:08:12 +09:00
Justin M. Keyes
68de6b17b8
Merge #10433 from erw7/vim-8.1.0027
vim-patch:8.1.{27,32,36,69,70,71,91,92}
2020-02-12 00:24:50 -08:00
erw7
d54b5997b7 Fix issue where callbacks are garbage collected
Import necessary part of vim-patch:8.1.1575.
75a1a9415b
2020-02-12 16:03:54 +09:00
erw7
3557757a3c vim-patch:8.1.0092: prompt buffer test fails
Problem:    Prompt buffer test fails.
Solution:   Set 'nomodified' before closing the window. (Ozaki Kiichi,
            closes vim/vim#3051
71ef1ba5e9
2020-02-12 16:03:54 +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
f320db3450 vim-patch:8.1.0070: missing part of the changes for prompt_setinterrupt()
Problem:    Missing part of the changes for prompt_setinterrupt().
Solution:   Add the missing changes.
222cd20e26
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
783aecd501 vim-patch:8.1.0036: not restoring Insert mode if leaving prompt buffer with mouse
Problem:    Not restoring Insert mode if leaving a prompt buffer by using a
            mouse click.
Solution:   Set b_prompt_insert appropriately. Also correct cursor position
            when moving cursor to last line.
891e1fd894
2020-02-12 15:16:32 +09:00
erw7
3ca0343fb9 vim-patch:8.1.0032: BS in prompt buffer starts new line
Problem:    BS in prompt buffer starts new line.
Solution:   Do not allows BS over the prompt.  Make term_sendkeys() handle
            special keys. Add a test.
6b810d92a9
2020-02-12 15:16:32 +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