Commit Graph

930 Commits

Author SHA1 Message Date
mergify-bot
8ac7e2b2f2 Merge branch 'master' into 'diagnostic-match-positive-position' 2019-05-08 20:56:47 +00:00
micbou
168c0a334e
Ensure positive position for diagnostic matches 2019-05-07 22:50:58 +02:00
Boris Staletic
065246160d Update coverage.py 2019-05-07 21:32:38 +02:00
micbou
5e3dd1d9b8
Ignore case when comparing paths on Windows and macOS 2019-05-04 16:32:06 +02:00
micbou
93fd392ea2
Disable Vim filtering
Disable Vim filtering by setting the 'equal' field of completions to 1.
This should speed up completion and reduce flickering.
2019-04-09 16:50:52 +02:00
Boris Staletic
54f5a9b1c1 Drop python 3.4 2019-04-05 22:04:15 +02:00
micbou
98117cab69
Ensure only loclist or quickfix windows are closed 2019-03-05 23:36:00 +01:00
micbou
eaa53f25c0
Relax regexp in DebugInfo test 2019-01-30 14:12:24 +01:00
zzbot
c209cdbbfc
Auto merge of #3279 - micbou:fix-signs, r=puremourning
[READY] Update sign place regex pattern for newer versions

Among other things, [Vim 8.1.0614](162b71479b) changed the output of the `sign place` command by adding the `priority` field:
```
--- Signs ---
Signs for test.cpp:
    line=4  id=100000000  name=YcmError priority=10
    line=5  id=100000001  name=YcmError priority=10
```
This breaks [the `GetSignsForBuffer` function](7997fc5536/python/ycm/vimsupport.py (L204-L215)) which extract the signs from the output of that command. We need to update the regex pattern used to match the lines of `sign place` for Vim 8.1.0614 or later.

<!-- 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/3279)
<!-- Reviewable:end -->
2018-12-28 00:50:29 -08:00
zzbot
1e37efe648
Auto merge of #3273 - micbou:remove-server-utils-dependency, r=puremourning
[READY] Remove server_utils dependency

<!-- 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/3273)
<!-- Reviewable:end -->
2018-12-28 00:32:59 -08:00
micbou
b0f18804f3
Update sign place regex pattern for newer versions 2018-12-25 14:35:51 +01:00
micbou
9091454d18
Do not apply fixits for omnifunc completion 2018-12-21 15:56:31 +01:00
micbou
88504eb44a
Remove server_utils dependency 2018-12-19 13:54:23 +01: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
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
micbou
3151820ff5
Update diagnostic matches only in current window 2018-11-27 15:44:55 +01: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
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
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
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
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
88bdfc01f9
Fix Flake8 errors
Fix invalid escape sequences in string literals. Ignore E301 and W504.
2018-10-26 23:07:38 +02: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
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
micbou
bdc3a66488
Ignore ft= argument from YcmCompleter command
Only the "ycm:ident" value of the ft= argument in the YcmCompleter
command is working. This value forces the use of the identifier
completer which serve no purpose because this completer doesn't define
commands. Ignore completely the ft= argument and move the logic to the
Python layer.
2018-09-28 01:12:23 +02:00
micbou
5e46cdfbbf
Reduce logging verbosity when a connection error occurs 2018-09-24 11:08:07 +02:00
micbou
4524d4bfd1
Include extra data when getting the logs
Include the extra conf data to the debug info request when getting the
logfiles.
2018-09-19 21:30:04 +02:00
zzbot
487b8ab2b4
Auto merge of #3134 - micbou:fitting-height-wrap, r=micbou
[READY] Set window height according to the wrap option

The height of the quickfix and location list windows is set to fit all entries by assuming that the lines of the entries are always wrapped if they are longer than the window width. This assumption is wrong if `nowrap` is set. In that case, the height should be set to the number of entries.

<!-- 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/3134)
<!-- Reviewable:end -->
2018-09-09 06:39:05 -07:00
zzbot
c3b4884cd3
Auto merge of #3126 - micbou:fix-cursor-position-replace-chunk, r=micbou
[READY] Fix cursor position when replacing chunk

When replacing an area of the buffer with `ReplaceChunk`, we are replacing the whole last line of that area because the Python interface doesn't allow changing only some part of a line. If the cursor is positioned on that line just after the ending column of the replaced area, we expect the cursor to be moved depending on the amount of text replaced. However, since the whole line is replaced, Vim cannot figure where the cursor should be positioned and so the cursor is not moved. This leads to the cursor ending in an unexpected position after a FixIt is applied. Here's an illustration of the issue in TypeScript where an import statement is automatically inserted after selecting a completion:

![fixit-cursor-position-before](https://user-images.githubusercontent.com/10026824/44363871-be1ec400-a4c5-11e8-949b-14ada91bdc5e.gif)

The solution is to manually move the cursor in that case:

![fixit-cursor-position-after](https://user-images.githubusercontent.com/10026824/44364038-3a190c00-a4c6-11e8-8aca-4bc8ccb98edc.gif)

<!-- 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/3126)
<!-- Reviewable:end -->
2018-09-09 05:36:16 -07:00
micbou
d215342f2f
Fix cursor position when replacing chunk
Vim doesn't move the cursor accordingly when its position is on the last line
of the replaced area after its ending column because the whole line is
replaced. The cursor must be manually moved in that case.
2018-09-09 12:38:44 +02:00
micbou
eac2232c22
Improve omnifunc compliance when start column is invalid
Contrarily to what the docs say, Vim only stops completion if the value
returned by the omnifunc is -3 or -2. In other cases, if the value is negative
or greater than the current column, the start column is set to the current
column; otherwise, the value is used as the start column.
2018-09-09 12:34:07 +02:00
micbou
b6583623a0
Set window height according to the wrap option 2018-08-29 22:04:47 +02:00
micbou
24ab8ca941
Restore cursor position after omnifunc calls
An omnifunc may move the cursor position even on the first call.
2018-08-19 21:16:52 +02:00
zzbot
a688da3b96
Auto merge of #3120 - micbou:goto-modifiers-version, r=micbou
[READY] Only use command modifiers if available

Command modifiers (see `:h mods`) were added in [Vim 7.4.1898](63a60ded3f (diff-28587d36c24b61c33d4d01601f5974ee)) while we support 7.4.1578 and later.

Fixes https://github.com/Valloric/YouCompleteMe/issues/3105.

<!-- 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/3120)
<!-- Reviewable:end -->
2018-08-19 11:34:44 -07:00
micbou
dca5682e21
Move cursor to start column before calling again omnifunc
Vim internally moves the cursor to the start column before calling again the
omnifunc. Some omnifuncs like the one defined by the LanguageClient-neovim
plugin depend on this behavior to compute the list of candidates.
2018-08-16 18:33:36 +02:00
micbou
959d0c4c5f
Only use command modifiers if available
Command modifiers were added in Vim 7.4.1898.
2018-08-14 13:52:25 +02:00
zzbot
15362d9cb8
Auto merge of #3089 - micbou:tsserver-javascript, r=Valloric
[READY] Update JavaScript support and documentation

This updates the documentation with the proposed changes in https://github.com/Valloric/ycmd/pull/1036#issuecomment-397234687. The Tern instructions are moved to [this wiki page](https://github.com/Valloric/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern). JavaScript is added to the list of supported filetypes for diagnostics and completion fixits.

<!-- 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/3089)
<!-- Reviewable:end -->
2018-07-25 14:02:12 -07:00
micbou
4e3ae95e9f
Update JavaScript support and documentation 2018-07-25 22:15:01 +02:00
micbou
87702559f3
Support modifiers for GoTo commands 2018-07-24 18:07:41 +02:00
micbou
115f360092
Update matches for all windows 2018-06-03 18:58:09 +02:00
zzbot
2dcb3e91ad
Auto merge of #3045 - micbou:flake8-ycm, r=puremourning
[READY] Enforce YCM coding style

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

<!-- 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/3045)
<!-- Reviewable:end -->
2018-06-02 07:46:13 -07:00
zzbot
470518075d
Auto merge of #3035 - micbou:show-detailed-diagnostic-none, r=puremourning
[READY] Fix YcmShowDetailedDiagnostic command on line without diagnostic

The `YcmShowDetailedDiagnostic` command raises a `NoneType` exception on a line with no diagnostic;
```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "YouCompleteMe/autoload\..\python\ycm\youcompleteme.py", line 663, in ShowDetailedDiagnostic
    if 'message' in detailed_diagnostic:
TypeError: argument of type 'NoneType' is not iterable
```

<!-- 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/3035)
<!-- Reviewable:end -->
2018-06-02 07:21:43 -07:00
zzbot
bdfcb660eb
Auto merge of #3027 - micbou:fix-debug-info-test, r=puremourning
[READY] Fix debug info test on Python 2 with Clang support

Since PR https://github.com/Valloric/ycmd/pull/925, the list of flags returned by ycmd are prefixed with `u` on Python 2.

<!-- 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/3027)
<!-- Reviewable:end -->
2018-06-02 06:06:35 -07:00
micbou
29717194fc
Do not ignore E211 rule from Flake8 2018-05-30 09:21:20 +02:00