Commit Graph

2452 Commits

Author SHA1 Message Date
micbou
b0f18804f3
Update sign place regex pattern for newer versions 2018-12-25 14:35:51 +01:00
zzbot
a53ccefca9
Auto merge of #3275 - micbou:complete-done-omnifunc, r=bstaletic
[READY] Do not apply fixits for omnifunc completion

Fixes #3274.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3275)
<!-- Reviewable:end -->
2018-12-21 07:46:11 -08:00
micbou
9091454d18
Do not apply fixits for omnifunc completion 2018-12-21 15:56:31 +01:00
zzbot
0790dc99b4
Auto merge of #3266 - micbou:fix-run_tests-dependencies, r=micbou
[READY] Fix run_tests.py dependencies

The dependencies are now explicitly added to `PYTHONPATH` in the `run_tests.py` script. Adding the `argparse` module to `sys.path` is not needed anymore.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3266)
<!-- Reviewable:end -->
2018-12-11 16:59:43 -08:00
zzbot
5083c8be22
Auto merge of #3265 - micbou:omnifunc-adjust-candidate-insertion-text, r=bstaletic
[READY] Fix insertion adjustment for omnifunc candidates

The assumption that the `abbr` field always exist does not hold when candidates are from Vim's omnifunc.

Fixes #3264.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3265)
<!-- Reviewable:end -->
2018-12-11 13:38:08 -08:00
zzbot
272c72e1f1
Auto merge of #3269 - micbou:undefined-symbol-fixit, r=micbou
[READY] Update FAQ entry about outdated libclang

The FAQ entry about libclang being too old is not relevant anymore. Replace it with the `undefined symbol: clang_getCompletionFixIt` error that occurs when ycmd loads a libclang older than 7.0.0.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3269)
<!-- Reviewable:end -->
2018-12-11 12:48:40 -08:00
micbou
ee6756bdf4
Update FAQ entry about outdated libclang 2018-12-11 20:19:32 +01:00
micbou
6425e1d96f
Fix run_tests.py dependencies 2018-12-11 07:39:57 +01:00
zzbot
51b6335b24
Auto merge of #3263 - bstaletic:requests_move, r=micbou
[READY] Do not use ycmd/third_party

See Valloric/ycmd#1143

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3263)
<!-- Reviewable:end -->
2018-12-10 17:26:51 -08:00
micbou
6b8349ba8e
Fix insertion adjustment for omnifunc candidates
The abbr field may not be present for candidates returned by Vim's
omnifunc.
2018-12-11 02:15:24 +01:00
Boris Staletic
5c12f5e357 Separate YCM/ycmd submodules 2018-12-11 00:42:39 +01:00
zzbot
80246aa9a2
Auto merge of #3258 - micbou:fix-candidate-insertion-adjustment, r=micbou
[READY] Fix candidate insertion adjustment

PR https://github.com/Valloric/YouCompleteMe/pull/3208 changed the way completion items are built by always defining all fields and in particular the `abbr` field. This caused a regression with the  `AdjustCandidateInsertionText` function because that function checks if the `abbr` field exist which is now always the case. The function should instead check if the `abbr` field is empty.

I changed the order of the fields in the tests to follow the Vim documentation (`word` is defined before `abbr`) and I removed one of the tests since PR https://github.com/Valloric/YouCompleteMe/pull/3104 made it irrelevant.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3258)
<!-- Reviewable:end -->
2018-12-07 03:31:55 -08:00
micbou
94e70b394e
Fix candidate insertion adjustment
The abbr field is always defined so we need to check its emptiness when
adjusting the candidates insertion text.
2018-12-01 23:59:36 +01:00
zzbot
75bf1738dc
Auto merge of #3247 - micbou:diagnostic-matches-current-window, r=puremourning
[READY] Update diagnostic matches only in current window

Unfortunately, switching windows when updating the diagnostic matches causes too many side-effects like issues #3228 and #3242. Revert PRs https://github.com/Valloric/YouCompleteMe/pull/3024 and https://github.com/Valloric/YouCompleteMe/pull/3229 and only update matches in the current window.

Fixes #3242.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3247)
<!-- Reviewable:end -->
2018-11-27 12:11:50 -08:00
micbou
3151820ff5
Update diagnostic matches only in current window 2018-11-27 15:44:55 +01:00
zzbot
8216dec954
Auto merge of #3243 - micbou:remove-user-options-store-dependency, r=bstaletic
[READY] Remove user_options_store dependency

A small step in decoupling YCM and ycmd. Instead of loading the default settings from ycmd, define them directly in the `plugin/youcompleteme.vim` file along the other options. This removes the `frozendict` and `user_options_store` dependencies.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3243)
<!-- Reviewable:end -->
2018-11-26 19:58:59 -08:00
zzbot
9e0e660bee
Auto merge of #3241 - bstaletic:flakes, r=Valloric
[READY] Run flake8 on scripts in root

See https://github.com/Valloric/ycmd/pull/1135 for reference.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3241)
<!-- Reviewable:end -->
2018-11-26 17:32:43 -08:00
micbou
f6ec5557c0
Add g:ycm_filter_diagnostics to list of options 2018-11-26 12:51:26 +01:00
micbou
e651d970ed
Remove user_options_store dependency
Directly define the ycmd options in the plugin.
2018-11-26 12:51:01 +01:00
Boris Staletic
24a01864fd Run flake8 on scripts in root 2018-11-23 12:04:49 +01:00
zzbot
8e33c3c644
Auto merge of #3237 - micbou:increase-clang-requirement, r=bstaletic
[READY] Increase libclang version requirement in docs

We need to increase the version requirement to 7.0.0 because of PR https://github.com/Valloric/ycmd/pull/1121.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3237)
<!-- Reviewable:end -->
2018-11-21 07:08:45 -08:00
micbou
17c9da60f6
Increase libclang version requirement in docs 2018-11-19 19:08:45 +01:00
zzbot
f2d999bbb1
Auto merge of #3229 - micbou:keep-previous-window, r=puremourning
[READY] Preserve previous window when updating matches

Ensure `<c-w>p` still go to the previous window after updating matches for the current buffer.

Fixes #3228.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3229)
<!-- Reviewable:end -->
2018-11-18 05:48:57 -08:00
zzbot
ff0a62bd15
Auto merge of #3174 - micbou:clang-fixit-completion, r=bstaletic
[READY] Update ycmd

Include the following changes:

 - PR Valloric/ycmd#1080: replace Boost canonical function with our own implementation;
 - PR Valloric/ycmd#1104: improve filename completer;
 - PR Valloric/ycmd#1121: support completion FixIts for C-family languages;
 - PR Valloric/ycmd#1122: update jdt.ls to 0.26.0;
 - PR Valloric/ycmd#1123: install fixed version of TypeScript in third-party folder;
 - PR Valloric/ycmd#1124: only add the necessary directories to Python path.

Fixes #3173.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3174)
<!-- Reviewable:end -->
2018-11-17 21:41:09 -08:00
micbou
76aa22886f
Update TypeScript instructions in docs 2018-11-17 14:29:01 +01:00
micbou
4b4f678bef
Support completion FixIts for C-family languages 2018-11-17 14:29:00 +01:00
zzbot
95efbc8766
Auto merge of #3208 - micbou:null-character-completion, r=micbou
[READY] Handle null characters in completion response

The `detailed_info` field may contain null characters e.g. `\x00` in Python docstrings (though it doesn't make sense to use such characters in a docstring). Since these characters cannot be evaluated through `pyeval` (and `py3eval`), we replace them with the symbol used by Vim to display them (`^@`).

This PR also rewrites the `_ConvertCompletionDataToVimData` function by relying on two things:
 - [the `insertion_text` field is always defined](600f54de20/ycmd/responses.py (L109));
 - [Vim ignores fields with an empty string](833e5dab14/src/edit.c (L2748-L2755)).

I did some measurements and the performance hit is negligible.

Fixes #3207.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3208)
<!-- Reviewable:end -->
2018-11-17 05:23:42 -08:00
micbou
d8d021537b
Update ycmd
Include the following changes:
 - replace Boost canonical function with our own implementation;
 - improve filename completer;
 - support completion FixIts for C-family languages;
 - update jdt.ls to 0.26.0;
 - install fixed version of TypeScript in third-party folder;
 - only add the necessary directories to Python path.
2018-11-17 13:03:26 +01:00
micbou
39c06c42e3
Handle null characters in completion response
The completion info field may contain null characters e.g. \x00 in
Python docstrings. These characters cannot be evaluated so they are
removed.
Rewrite the function that convert ycmd completion to Vim completion.
2018-11-17 01:42:05 +01:00
micbou
d08be52c62
Preserve previous window when updating matches
Ensure <c-w>p still go to the previous window after updating matches for
the current buffer.
2018-11-17 01:41:37 +01:00
zzbot
b668ed6405
Auto merge of #3192 - micbou:auto-wrap, r=micbou
[READY] Recompute starting column on auto-wrapping

When auto-wrapping is enabled (`t` or `c` are present in `formatoptions`), Vim wraps the current line after the completion request is sent but before calling the completefunc. The column where the completion starts is invalid in that case and must be recomputed.

Fixes #2789.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3192)
<!-- Reviewable:end -->
2018-11-16 16:39:33 -08:00
micbou
eba717553f
Recompute starting column on auto-wrapping
When auto-wrapping is enabled, Vim wraps the current line after the
completion request is sent but before calling the completefunc. The
starting column returned by the server is invalid in that case and must
be recomputed.
2018-11-17 01:07:02 +01:00
zzbot
e412ee465b
Auto merge of #3204 - micbou:fix-flake8, r=bstaletic
[READY] Fix Flake8 errors

See PR https://github.com/Valloric/ycmd/pull/1126.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3204)
<!-- Reviewable:end -->
2018-11-16 10:15:37 -08:00
micbou
faa019aa53
Merge pull request #3209 from santosh/docs
removes repetitive line
2018-11-01 17:49:24 +01:00
Santosh Kumar
a6f0fb2cbd removes 'below' from text to reduce confusion 2018-11-01 21:34:46 +05:30
micbou
88bdfc01f9
Fix Flake8 errors
Fix invalid escape sequences in string literals. Ignore E301 and W504.
2018-10-26 23:07:38 +02:00
zzbot
f67e5ff27b
Auto merge of #3104 - micbou:omnifunc-convert-strings-dictionaries, r=bstaletic
[READY] Convert strings from omnifunc into dictionaries

Vim allows each item of the list returned by an omnifunc to be either a string
or a dictionary (see `:h complete-items`) but ycmd only supports lists where items are all strings or all
dictionaries. Convert all strings into dictionaries.

Fixes https://github.com/Valloric/YouCompleteMe/issues/3103.
Fixes https://github.com/Valloric/YouCompleteMe/issues/3179

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3104)
<!-- Reviewable:end -->
2018-10-14 10:58:41 -07:00
zzbot
75c3bb6928
Auto merge of #3124 - hackaugusto:type_check_blacklist, r=micbou
added type check for g:ycm_filetype_blacklist

# PR Prelude

- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.
- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
- [x] I have included tests for the changes in my PR. If not, I have included a
  rationale for why I haven't.
- [x] **I understand my PR may be closed if it becomes obvious I didn't
  actually perform all of these steps.**

# Why this change is necessary and useful

I made a mistake while configuring ycm and used a list instead of a ditionary for the blacklist, like so:

```vim
let g:ycm_filetype_blacklist = ['python']
```

If the `CursorMoved` autocmd is installed while the configuration is not a dictionary, an error message is raised after every keystroke, this makes fixing the configuration error a bit painful. Error message:

```
Error detected while processing function <SNR>78_OnCursorMovedNormalMode[1]..<SNR>78_AllowedToCompleteInCurrentBuffer[1]..<SNR>78_AllowedToCompleteInBuffer:
line   15:
E715: Dictionary required
```

This PR just adds a check for the type of the variable `g:ycm_filetype_blacklist`, if it's  the wrong type a message is printed and the autocmd is not installed. The check was done inside `Enable` to ensure the init.vim had fully executed.

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3124)
<!-- Reviewable:end -->
2018-10-14 09:20:07 -07:00
micbou
926e32d6e5
Simplify AdjustCandidateInsertionText function
Candidates are always dictionaries containing the 'word' key.
2018-10-14 18:07:55 +02:00
micbou
73fea03d78
Convert strings from omnifunc into dictionaries
Vim allows each item of the list returned by an omnifunc to be either a string
or a dictionary but ycmd only supports lists where items are all strings or all
dictionaries. Convert all strings into dictionaries.
2018-10-14 18:07:54 +02:00
zzbot
34dee0ebcb
Auto merge of #3163 - micbou:python-path, r=puremourning
[READY] Add minimal dependencies to Python path

Ideally, we shouldn't add anything to the Python path because it can break other plugins written in Python but since the alternative is to tell users to manually install our dependencies, we don't really have a choice (the last thing we want are reports about pip failing to install packages). Still, we can at least only add the dependencies we need:
 - [requests](https://github.com/requests/requests);
 - [pythonfutures](https://github.com/agronholm/pythonfutures) in Python 2;
 - [requests-futures](https://github.com/ross/requests-futures);
 - [frozendict](https://github.com/slezica/python-frozendict);
 - [python-future](https://github.com/PythonCharmers/python-future).

Fixes #3162.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3163)
<!-- Reviewable:end -->
2018-10-14 07:52:27 -07:00
micbou
040582c107
Add minimal dependencies to Python path
Only add pythonfutures on Python 2. The concurrent.futures module is
part of the standard library on Python 3.
2018-10-14 16:39:01 +02:00
zzbot
a98bc72668
Auto merge of #3176 - micbou:python-docs, r=bstaletic
[READY] Update docs about the default version of Python used for completion

The behavior of `get_default_environment` has been changed in the latest version of Jedi. Instead of picking the latest version of Python available on the system, it now uses the one it's running on i.e. the one running ycmd in our case. See https://github.com/davidhalter/jedi/issues/1196. Update the docs accordingly.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3176)
<!-- Reviewable:end -->
2018-10-08 08:48:47 -07:00
micbou
0ac80ab619
Update docs about the default version of Python used for completion
Jedi now picks the version of Python running the ycmd server.
2018-10-08 00:05:22 +02:00
zzbot
5c722bbfbb
Auto merge of #3161 - micbou:completer-command-ignore-ft-option, r=puremourning
[READY] Ignore ft= argument from YcmCompleter command

The `ft=` argument of the `YcmCompleter` command is supposed to allow users to specify a completer when running a command. However, this was broken a long time ago in commit 29bb90a6b4. Only the `ycm:ident` value is still supported but it serves no purpose because the identifier completer doesn't define commands. Ignore completely the `ft=` argument and move the logic to the Python layer. Remove the argument from the documentation.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3161)
<!-- Reviewable:end -->
2018-10-07 12:21:39 -07:00
zzbot
738668319f
Auto merge of #3154 - micbou:reduce-logging-verbosity-connection-error, r=puremourning
[READY] Reduce logging verbosity when a connection error occurs

Logging `ConnectionError` as an exception results in writing a Python traceback of 64 lines in the logs. Not only this messes up the logs, this also considerably increases their size for no good reason. Instead, we should log the exception as an error. This gives us something like
```
2018-09-24 11:19:27,487 - ERROR - HTTPConnectionPool(host='127.0.0.1', port=27810): Max retries exceeded with url: /ready (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.HTTPConnection object at 0x0000000005CC7B70>, 'Connection to 127.0.0.1 timed out. (connect timeout=0.01)'))
```
which is much more reasonable.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3154)
<!-- Reviewable:end -->
2018-10-07 11:47:52 -07:00
zzbot
40ff89e8d0
Auto merge of #3175 - micbou:update-ycmd, r=puremourning
[READY] Update ycmd

Include the following changes:
 - PR Valloric/ycmd#1075: remove Node.js workaround for Debian-based distributions;
 - PR Valloric/ycmd#1077: update Boost to 1.68;
 - PR Valloric/ycmd#1078: add semantic trigger for Julia;
 - PR Valloric/ycmd#1081: improve type information on C++ member functions;
 - PR Valloric/ycmd#1086: check if Python headers are installed before building;
 - PR Valloric/ycmd#1088: raise proper exception for commands when file is still being parsed in C-family languages;
 - PR Valloric/ycmd#1098: update Go completer;
 - PR Valloric/ycmd#1099: update regex submodule;
 - PR Valloric/ycmd#1100: add Python path to debugging information;
 - PR Valloric/ycmd#1103: support framework headers completion and code navigation in C-family languages;
 - PR Valloric/ycmd#1107: update Clang to 7.0.0;
 - PR Valloric/ycmd#1109: update jdt.ls to 0.25.0;
 - PR Valloric/ycmd#1110: handle null hover response from language servers;
 - PR Valloric/ycmd#1111: update list of completion kinds defined by LSP;
 - PR Valloric/ycmd#1113: send completion item kinds capability to language servers;
 - PR Valloric/ycmd#1116: update Parso to 0.3.1 and Jedi to 0.13.1.

Closes https://github.com/Valloric/YouCompleteMe/issues/3138.
Closes https://github.com/Valloric/YouCompleteMe/issues/3145.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3175)
<!-- Reviewable:end -->
2018-10-07 11:16:31 -07:00
micbou
d2ee69d521
Remove ncurses-compat-libs dependency for Fedora
The downloaded libclang on Linux does not depend on terminfo anymore.
2018-10-07 03:24:33 +02:00
micbou
9957e7ba0a
Update semantic triggers in documentation 2018-10-07 03:24:32 +02:00
micbou
6caa49f859
Update ycmd
Include the following changes:
 - remove Node.js workaround for Debian-based distributions;
 - update Boost to 1.68;
 - add semantic trigger for Julia;
 - improve type information on C++ member functions;
 - check if Python headers are installed before building;
 - raise proper exception for commands when file is still being parsed
   in C-family languages;
 - update Go completer;
 - update regex submodule;
 - add Python path to debugging information;
 - support framework headers completion and code navigation in C-family
   languages;
 - update Clang to 7.0.0;
 - update jdt.ls to 0.25.0;
 - handle null hover response from language servers;
 - update list of completion kinds defined by LSP;
 - send completion item kinds capability to language servers;
 - update Parso to 0.3.1 and Jedi to 0.13.1.
2018-10-07 03:15:47 +02:00