Commit Graph

85 Commits

Author SHA1 Message Date
Daniel Hahler
6cc76194b2
tests: use runtime from build for doc/tags with :help (#10479)
This is better practice in general, and allows to remove the "helptags
ALL" hacks.

Ref: https://github.com/neovim/neovim/issues/8824
Ref: https://github.com/neovim/neovim/commit/f1b67c3453c

* Makefile: fix dependencies with regard to helptags

- use the file as the main target to avoid unnecessary triggering
- use "make oldtest" on Travis to ensure it gets built
2019-08-28 22:47:54 +02:00
Björn Linse
48b43352b0 pyxversion: fix logic error #10759
Do not incorrectly prefer python2 if python3 is working.
fixes #10758
2019-08-14 22:36:43 +02:00
Justin M. Keyes
2141dc2262 provider: check #Call() if g:loaded_xx_provider=2 2019-08-04 13:23:46 +02:00
Justin M. Keyes
5e6a08f2e6 provider: skip non-provider has() feature-names
We don't want to retry autoload sourcing (slow) for every random has()
query that finds it way to eval_call_provider().
2019-08-04 13:23:46 +02:00
Justin M. Keyes
66938b928c provider: decide status by g:loaded_xx_provider 2019-08-04 13:23:46 +02:00
Rui Abreu Ferreira
2cfe4748e5 provider: let providers decide their status
Instead of deciding provider status in eval_has_provider, move the
decision to the provider Vim scripts.

Previously, provider loading worked as follows:

1. eval_has_provider() verified provider availability by searching for
   the provider#providername#Call function and cached this verificaion as a static
   variable for some providers
2. providers short-circuited on loading to prevent the definition of the
   Call function (with the exception of the node provider that did not)

This commit changes the expected interface between nvim and its
providers to facilitate provider reloading, by splitting the
verification of the provider from the availability of the Call function.

eval_has_provider() now checks for a provider#providername#enabled
variable. It is up to the provider script to set this to 0 or 1
accordingly. eval_call_provider() remains unchanged.

All providers hosting a Call function were updated to respect this.

The clipboard provider now has a Reload function to reload the
provider.
2019-08-04 13:23:46 +02:00
Björn Linse
8ed54bbec3 messages: use proper multiline error message for rpcrequest and API wrappers 2019-05-26 15:42:16 +02:00
Justin M. Keyes
4b65a0059a test: cleanup
Avoid hyper-granularity. Don't need subdirectories for every little
thing.
2019-05-05 23:01:35 +02:00
Marco Hinz
db3c797c6b
provider: improve error message if provider is missing (#9487)
Move `has_eval_provider()` check to `eval_call_provider()` to make sure that
every code path calls it first.

Previously we would, when pynvim was missing, get a nice error message for
`:python3 1`, but not for `:py3file blah`.

Fixes https://github.com/neovim/neovim/issues/9485
2019-01-12 00:52:12 +01:00
Marco Hinz
315769ae6d
test: :ruby reports E319 if provider is missing 2018-12-12 22:11:00 +01:00
Justin M. Keyes
61d0dfee32 provider: repurpose E319
In Vim (and some vestigial parts of Nvim) E319 was a placeholder for
ex_ni commands, i.e. commands that are only available in certain builds
of Vim.  That is obviously counter to Nvim's goals: all Nvim commands
are available on all platforms and build types (the remaining ex_ni
commands are actually just missing providers).

We need an error id for "missing provider", so it makes sense to use
E319 for that purpose.

ref #9344
ref #3577
2018-12-12 01:26:21 +01:00
Jan Edmund Lazo
f274b84e1e test: give more time for nodejs
Link neovim package to project root directory.
Increase delay to 3 seconds.
Reduce the total lines in temporary node scripts.
2018-06-04 19:42:28 -04:00
Justin M. Keyes
efb6caa39b test: nodejs_spec: fix test after upstream API change
closes https://github.com/neovim/node-client/issues/72
2018-05-15 00:03:21 +02:00
Justin M. Keyes
1dc497398e test: nodejs_spec: allow more time for nodejs init 2018-04-18 09:42:56 +02:00
Justin M. Keyes
189c5abeba provider/RPC: apply_autocmds_group(): fix double-free
During provider dispatch, eval_call_provider() saves global
state--including pointers, such as `autocmd_fname`--into
`provider_caller_scope` which is later restored by f_rpcrequest().

But `autocmd_fname` is special-cased in eval_vars(), for performance
(see Vim patch 7.2.021; this is also the singular purpose of the
`autocmd_fname_full` global. Yay!)

If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias
becomes a problem.

Solution: Don't free autocmd_fname in eval_vars(), just copy into it.

closes #5245
closes #5617

Reference
------------------------------------------------------------------------

Vim patch 7.2.021
f6dad43c98
Problem:    When executing autocommands getting the full file name may be
            slow. (David Kotchan)
Solution:   Postpone calling FullName_save() until autocmd_fname is used.

vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when
Editing Files on a Remote WIndows Share"
https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
2018-03-24 11:01:24 +01:00
Justin M. Keyes
0f1bc5ddce test/python: less-noisy Python skip-message
Developer can use :checkhealth to get more details, don't need to blast
the details in the skip-message every time.
2018-02-12 13:24:48 +01:00
Justin M. Keyes
103ff26c0a provider/nodejs: check version in Detect() 2017-12-17 16:09:18 +01:00
Jan Edmund Lazo
5b692124cc test: remove inspect test; set NODE_PATH in nodejs_spec.lua
provider#node#can_inspect will fail on some systems because it is common
to have old node versions in OS (any Linux OS that has LTS releases)
and CI (Travis, Appveyor).

NODE_PATH can be trivially set with VimL.
Build scripts don't have to set it for the nodejs tests to work.
NODE_PATH is optional to begin with and is used only as a workaround
for the neovim node.js host.
2017-12-17 16:09:18 +01:00
Jan Edmund Lazo
a1adfdc7d5 ci: nodejs client acceptance-test #7706
ci: install nodejs 8 in Appveyor, Travis

provider: check node version for debug support
Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix.

provider: test if nodejs in ci supports --inspect-brk

nodejs host for neovim requires nodejs 6+ to work properly.
nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`.

provider: run cli.js of nodejs host directly

npm shims are useless because the user cannot set node to debug mode via
--inspect-brk. This is problematic on Windows which use batchfiles and
shell scripts to compensate for not supporting shebang.

The patch uses `npm root -g` to get the absolute path of the global npm
modules. If that fails, then the user did not install neovim npm package
globally. Use that absolute path to find `neovim/bin/cli.js`, which is
what the npm shim actually runs with node. glob() is for a simple file
check in case bin/ is removed because the npm shims are ignored now.
2017-12-17 16:09:18 +01:00
Justin M. Keyes
d214df4e9b doc: replace ":CheckHealth" with ":checkhealth" 2017-10-17 01:51:21 +02:00
ZyX
19d38c4d0f functests: Replace check_provider -> missing_provider with err report 2017-05-13 03:06:50 +03:00
ZyX
8b171b8c50 functests: Test invalid behaviour
Test correctly fail for oneline ruby, python and python3.
2017-05-13 03:06:30 +03:00
Sander Bosma
5c9860a0a2 api: Do not truncate errors <1 MB. #6237
Closes #5984
2017-04-23 23:44:29 +02:00
Justin M. Keyes
d1afd434f3 rplugin: Call s:LoadRemotePlugins() on startup.
Dispense with the FuncUndefined/CmdUndefined quasi-optimization.
If there are no rplugins, plugin/rplugin.vim takes less than 1ms.

Closes #5821
Closes #6250

Helped-by: Qiming zhao <chemzqm@gmail.com>
2017-03-11 12:26:22 +01:00
Justin M. Keyes
c7d84c5550 Merge #4980 'Support legacy :ruby commands'. 2016-07-10 14:16:12 -04:00
Alex Genco
0a3c0205c5 Add :ruby, :rubyfile, and :rubydo ex commands 2016-07-02 21:45:48 -07:00
ZyX
ff470bb853 functests: Check logs in lua code
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
2016-06-10 21:50:49 +03:00
ZyX
5758432be2 eval: Stop executing *eval() function at error
Fixes #4822
Closes #4823
2016-05-27 15:11:53 +03:00
Justin M. Keyes
a347b29aa3 test: remote/define.vim: Add some spice. 2016-04-18 05:42:27 -04:00
Case Nelson
c4117d4b2f test: format 2016-04-18 05:40:24 -04:00
Case Nelson
4a200ceafa test: remote/define.vim: range 2016-04-18 05:40:15 -04:00
Marco Hinz
4a69e55f39 test/functional: clean up according to luacheck (part 1) 2015-11-23 13:57:21 +01:00
John Szakmeister
690df9333a Ensure a session is running before attempting to do Python detection. 2015-11-04 05:01:22 -05:00
Florian Walch
54596396bc test: Check for installed Python module with Vimscript function.
Use the existing Vimscript function provider#pythonx#Detect()
to determine whether the Neovim Python module is installed and
Python 2/3 tests can be run.
2015-09-27 00:03:06 +02:00
Justin M. Keyes
62c53c404b test: move runtime/autoload/* to provider/
- Organize tests by logical function, not the literal impl location.
- Avoid deep nesting / hyper-hierarchy.
2015-08-09 22:33:28 -04:00