Commit Graph

2421 Commits

Author SHA1 Message Date
micbou
d01c8ac83b
Update Java and TypeScript features in docs 2018-04-25 05:08:23 +02:00
micbou
5981809681
Support FixIts in TypeScript completions 2018-04-25 05:08:23 +02:00
micbou
1df76bbb39
Fix debug info test when ycmd is compiled with C-family support 2018-04-25 05:08:23 +02:00
micbou
d4cddbcc7f
Update Omnifunc completer Unicode tests 2018-04-25 05:08:23 +02:00
micbou
002500347e
Update ycmd
Include the following changes:
 - add Unicode support to the filter and sort algorithm;
 - replace Boost.Python with pybind11;
 - expand environment variables in extra conf options;
 - make GoTo and GoToImprecise subcommands jump to declaration if cursor on
   definition;
 - reset prefix when setting the start column;
 - send the full query to the language server completer when forced;
 - improve caching behavior;
 - add OrganizeImports command to Java completer;
 - add Scheme identifier regex;
 - update jdt.ls to 0.15.0;
 - fix TypeScript diagnostics;
 - optimize lines splitting for current file;
 - improve TypeScript completion data;
 - add GoTo and GoToDeclaration commands to TypeScript completer;
 - add TSServer version to debug info;
 - replace re module with regex;
 - add smart diacritic matching;
 - add FixIt command to TypeScript completer;
 - add Format command to TypeScript completer;
 - add OrganizeImports command to TypeScript completer;
 - improve Java project detection heuristics;
 - allow the user to manually specify a Java project path;
 - improve TeX identifier regex;
 - always return detailed completions in TypeScript completer;
 - support FixIts in TypeScript completions;
 - improve message when regex module installation fails;
 - update Boost to 1.67.0;
 - update godef;
 - add Ctags filetype mapping for PuppetManifest.
2018-04-25 05:08:22 +02:00
zzbot
5d4ec1504a
Auto merge of #2998 - micbou:2.7.1, r=puremourning
[READY] Increase Python 2 requirement to 2.7.1

Issues https://github.com/Valloric/YouCompleteMe/issues/2525 and https://github.com/Valloric/YouCompleteMe/issues/2992 are due to YCM being incompatible with Python 2.7.0 for the reason mentioned in our Travis script:
> Tests are failing on Python 2.7.0 with the exception "TypeError: argument can't be <type 'unicode'>"

Increase the Python 2 requirement to 2.7.1.

Closes https://github.com/Valloric/YouCompleteMe/issues/2525.
Closes https://github.com/Valloric/YouCompleteMe/issues/2992.

<!-- 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/2998)
<!-- Reviewable:end -->
2018-04-24 16:48:36 -07:00
micbou
06bd763bf0
Increase Python 2 requirement to 2.7.1
Tests are failing on Python 2.7.0 with the exception "TypeError: argument can't
be <type 'unicode'>"
2018-04-25 01:43:46 +02:00
micbou
40d0303405
Fix shutdown request initialization 2018-04-24 15:49:50 +02:00
zzbot
84554d2194
Auto merge of #2994 - micbou:fix-should-resend, r=puremourning
[READY] Fix resending request when buffer is not yet parsed

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

<!-- 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/2994)
<!-- Reviewable:end -->
2018-04-23 14:35:42 -07:00
micbou
f44723689c
Fix resending request when buffer is not yet parsed 2018-04-23 11:03:13 +02:00
zzbot
e4c6750a4b
Auto merge of #2988 - micbou:extra-conf-resend-request, r=micbou
[READY] Resend request when extra conf is loaded or ignored

When the client sends a request to the server, if an extra conf file is found that is not already white/blacklisted, the server stops processing the request and tells the client that an unknown extra conf file has been found. The client then asks the user if that file should be loaded or not. Depending on the
user's answer, the client sends a request to the server to load or ignore the extra conf file. Finally, the server loads the file or adds it to the blacklist. However, the initial request was not processed by the server and should be sent again.

Here's a demo illustrating the current situation:

![extra-conf-request-not-resent](https://user-images.githubusercontent.com/10026824/38840090-2d700936-41de-11e8-8b76-87c3eab960cc.gif)

As you can see, the file is not parsed after loading the extra conf file. With the proposed changes:

![extra-conf-request-resent](https://user-images.githubusercontent.com/10026824/38840137-67126670-41de-11e8-8707-88441ab35ac3.gif)

Fixes #2962.

<!-- 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/2988)
<!-- Reviewable:end -->
2018-04-22 16:19:59 -07:00
micbou
a24d97ca6b
Resend request when extra conf is loaded or ignored
When the client sends a request to the server, if an extra conf file is found
that is not already white/blacklisted, the server stops processing the request
and tells the client that an unknown extra conf file has been found. The client
then asks the user if that file should be loaded or not. Depending on the
user's answer, the client sends a request to the server to load or ignore the
extra conf file. Finally, the server loads the file or adds it to the
blacklist. However, the initial request was not processed by the server and
should be sent again.
2018-04-22 22:10:14 +02:00
zzbot
e7772347cd
Auto merge of #2989 - micbou:no-omnifunc-suggestions-if-server-crashed, r=puremourning
[READY] Do not return omnifunc suggestions if server crashed

We currently return unfiltered and unsorted suggestions from the omnifunc if the `filter_and_sort_candidates` request failed (generally because the server crashed). This behavior is confusing as it may let the user thinks that YCM is working (in a bad way) while in fact it doesn't. No suggestions should be returned in that case.

<!-- 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/2989)
<!-- Reviewable:end -->
2018-04-22 09:31:14 -07:00
micbou
caa0fb4285
Do not return omnifunc suggestions if server crashed 2018-04-17 17:39:25 +02:00
zzbot
6975efddc1
Auto merge of #2983 - micbou:gototype-command-docs, r=puremourning
[READY] Add GoToType command to documentation

The `GoToType` command was added a long time ago to the TypeScript completer (see PR https://github.com/Valloric/ycmd/pull/458) but not mentioned in the docs.

<!-- 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/2983)
<!-- Reviewable:end -->
2018-04-16 15:47:42 -07:00
zzbot
2cda39f1cf
Auto merge of #2986 - micbou:fix-python2-builds, r=micbou
[READY] Do not update pip on Travis and CircleCI

Attempt to fix the builds on Travis and CircleCI.

<!-- 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/2986)
<!-- Reviewable:end -->
2018-04-16 15:07:42 -07:00
micbou
88ca541893
Fix pip cache directory on CircleCI 2018-04-16 20:36:33 +02:00
micbou
9805abde44
Do not update pip on Travis and CircleCI 2018-04-16 17:43:33 +02:00
zzbot
3bcc45ead1
Auto merge of #2979 - micbou:allowed-on-char-events, r=puremourning
[READY] Check if completion is allowed on character events

We should check if completion is allowed when a character is inserted or deleted like we do with the other events.

<!-- 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/2979)
<!-- Reviewable:end -->
2018-04-14 15:16:56 -07:00
zzbot
7d72519039
Auto merge of #2978 - micbou:fix-filetype-specific-completion-to-disable, r=puremourning
[READY] Do not disable omnifunc when filetype completion is disabled

Prior to PR https://github.com/Valloric/YouCompleteMe/pull/2657, it was possible to trigger Vim's omnifunc with `<C-Space>` even if semantic completion was disabled for the current filetype through the `g:ycm_filetype_specific_completion_to_disable` option. It worked because `<C-Space>` was mapped to `<C-X><C-O><C-P>`, which are the keys to trigger the omnifunc. PR https://github.com/Valloric/YouCompleteMe/pull/2657 changed that by making `<C-Space>` directly call the `SendCompletionRequest` function with `force_semantic` sets to `True`. This change was necessary to get fuzzy matching with the omnifunc (see issue https://github.com/Valloric/YouCompleteMe/issues/961) but broke the `<C-Space>` behavior when filetype completion is disabled. This PR restores that behavior.

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

<!-- 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/2978)
<!-- Reviewable:end -->
2018-04-14 12:32:46 -07:00
zzbot
3256ae3ffa
Auto merge of #2976 - micbou:refactor-server-exception-handling, r=puremourning
[READY] Refactor server exception handling

Having to wrap all request calls with the `HandleServerException` function is inconvenient. Handle server exceptions directly in `BaseRequest`.

<!-- 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/2976)
<!-- Reviewable:end -->
2018-04-14 11:13:15 -07:00
micbou
e96ef7ce38
Do not disable omnifunc when filetype completion is disabled
Allow users to still trigger Vim's omnifunc through C-Space when the
g:ycm_filetype_specific_completion_to_disable option is set for the current
filetype.
2018-04-13 02:40:50 +02:00
micbou
6ec1b0b4a1
Refactor server exception handling 2018-04-13 01:35:17 +02:00
zzbot
45502e5108
Auto merge of #2970 - micbou:duplicate-fixits, r=puremourning
[READY] Fix applying fixit twice after completion

Fixes the issue mentioned in PR https://github.com/Valloric/YouCompleteMe/pull/2963 for Vim 8.0.1493 and later. I don't think it's worth the trouble to fix the issue for older versions.

<!-- 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/2970)
<!-- Reviewable:end -->
2018-04-12 14:37:20 -07:00
zzbot
820affe6d9
Auto merge of #2981 - micbou:remove-unnecessary-lists-docs, r=puremourning
[READY] Remove unnecessary lists and fix options link in docs

Two small improvements to 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/2981)
<!-- Reviewable:end -->
2018-04-11 12:00:21 -07:00
zzbot
b63604c8e9
Auto merge of #2980 - micbou:remove-goto-implementation-java-docs, r=puremourning
[READY] Remove Java from the GoToImplementation command in docs

The Java completer does not provide a `GoToImplementation` command.

<!-- 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/2980)
<!-- Reviewable:end -->
2018-04-11 06:09:55 -07:00
micbou
de8c8f6441
Add GoToType command to documentation 2018-04-08 21:17:10 +02:00
micbou
cacc8e0d92
Remove unnecessary lists and fix options link in docs 2018-04-07 06:01:54 +02:00
micbou
05f7f1c6f0
Remove Java from the GoToImplementation command in docs 2018-04-07 03:56:24 +02:00
micbou
3b115831a0
Fix applying fixit twice after completion 2018-04-06 17:56:25 +02:00
zzbot
e8477c16b6
Auto merge of #2972 - micbou:universal-ctags, r=puremourning
[READY] Mention Universal Ctags in docs

Closes https://github.com/Valloric/YouCompleteMe/issues/2971.

<!-- 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/2972)
<!-- Reviewable:end -->
2018-04-03 21:29:48 -07:00
micbou
1bda165728
Mention Universal Ctags in docs 2018-04-03 22:20:01 +02:00
micbou
6f9366d150
Check if completion is allowed on character events 2018-04-02 22:16:47 +02:00
zzbot
c1815a9b2d
Auto merge of #2963 - micbou:refactor-completedone-logic, r=puremourning
[READY] Refactor CompleteDone logic

Since the `CompleteDone` code only depends on the completion request, it makes sense to move its logic to the `CompletionRequest` class. This is also going to help fixing the issue where a FixIt is applied twice when selecting a completion:

![completedone-bug](https://user-images.githubusercontent.com/10026824/38029281-bc09d224-3295-11e8-9976-d4dd031f2cca.gif)

Finally, this reduces the time it takes to run the tests because the ycmd server is not started anymore in the `postcomplete` tests.

<!-- 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/2963)
<!-- Reviewable:end -->
2018-04-02 11:13:23 -07:00
micbou
866693ef80
Refactor CompleteDone logic
Move CompleteDone logic to the CompletionRequest class.
2018-03-28 22:00:43 +02:00
zzbot
dc341aab58
Auto merge of #2957 - micbou:refactoring-commands-readme, r=puremourning
[READY] Fix Refactoring Commands link in table of contents

I broke it in PR https://github.com/Valloric/YouCompleteMe/pull/2900.

<!-- 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/2957)
<!-- Reviewable:end -->
2018-03-27 14:55:27 -07:00
micbou
9408ccec5d
Fix Refactoring Commands link in table of contents 2018-03-26 03:08:19 +02:00
zzbot
37965fe311
Auto merge of #2956 - micbou:fix-column-clamping-python3, r=puremourning
[READY] Fix column clamping when highlighting diagnostics on Python 3

We need to convert the Vim buffer to bytes in the `LineAndColumnNumbersClamped` function to correctly compute the length of the line as a byte offset (and not a Unicode offset) on Python 3.

Before:

![column-clamping-before](https://user-images.githubusercontent.com/10026824/37876087-01f38dde-3048-11e8-93aa-0ce284b09b55.png)
After:

![column-clamping-after](https://user-images.githubusercontent.com/10026824/37876089-056db49e-3048-11e8-9d84-540fe67e6689.png)

<!-- 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/2956)
<!-- Reviewable:end -->
2018-03-25 13:32:37 -07:00
micbou
ca8211a64b
Fix column clamping when highlighting diagnostics on Python 3 2018-03-25 16:02:48 +02:00
zzbot
788c293aee
Auto merge of #2951 - micbou:replace-chunk-out-of-range, r=puremourning
[READY] Fix index error when applying a chunk at the end of file

When sending a request to the server, [we add a newline to the buffer contents to match what gets saved to disk](d3381411a0/python/ycm/vimsupport.py (L117)). If the server generates a chunk containing that newline, this chunk goes past the Vim buffer contents since there is actually no new line, which raises an `IndexError` exception when applying the chunk. We fix the issue by recomputing the end position of where the chunk is applied and by removing all trailing characters in the chunk.

Steps to reproduce the issue:
 - create a `Test.java` file with the following contents:
```java
package Test;$
$
```
where `$` represents an end of line;
 - issue the `:YcmCompleter Format` command.

<!-- 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/2951)
<!-- Reviewable:end -->
2018-03-19 06:40:11 -07:00
micbou
3086626448
Fix index error when applying a chunk at the end of file
When sending a request to the server, we add a newline to the buffer contents
to match what gets saved to disk. If the server generates a chunk containing
that newline, this chunk goes past the Vim buffer contents since there is
actually no new line, which raises an IndexError exception when applying the
chunk. We fix the issue by recomputing the end position of where the chunk is
applied and by removing all trailing characters in the chunk.
2018-03-19 14:28:28 +01:00
zzbot
d3381411a0
Auto merge of #2946 - micbou:docs-ctrl-r-remap, r=puremourning
[READY] Add an entry in the docs about remapping CTRL-R in completion mode

The `<C-R>` key cannot be remapped in YCM's completion mode (`<C-X><C-U>`) due to a Vim limitation. Add an entry in the FAQ about this.

Closes https://github.com/Valloric/YouCompleteMe/issues/2943.

<!-- 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/2946)
<!-- Reviewable:end -->
2018-03-12 03:28:09 -07:00
micbou
0c22c000ef
Add an entry in the docs about remapping CTRL-R in completion mode 2018-03-11 20:09:46 +01:00
zzbot
3a760212cb
Auto merge of #2942 - micbou:remove-7zip-dependency, r=puremourning
[READY] Remove 7-Zip dependency from Windows instructions

7-Zip is not required anymore on Windows since we now extract libclang from our  `.tar.bz` packages.

<!-- 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/2942)
<!-- Reviewable:end -->
2018-03-09 15:11:50 -08:00
micbou
a80da86542
Remove 7-Zip dependency from Windows instructions 2018-03-09 19:46:25 +01:00
zzbot
b4714c711c
Auto merge of #2939 - bstaletic:ycmd_update, r=micbou
[READY] ycmd update

# PR Prelude

Thank you for working on YCM! :)

**Please complete these steps and check these boxes (by putting an `x` inside
the brackets) _before_ filing your PR:**

- [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

- Valloric/ycmd#949 - update-clang
- Valloric/ycmd#948 - sitecustomize-import-failure
- Valloric/ycmd#922 - alt-translation-unit
- Valloric/ycmd#946 - java-upgrade
- Valloric/ycmd#945 - skip-build
- Valloric/ycmd#939 - drop-vagrant-setup
- Valloric/ycmd#941 - update-clang-script
- Valloric/ycmd#940 - lower-minimum-python-version-requirements
- Valloric/ycmd#938 - stray-windows-paths
- Valloric/ycmd#936 - clang-cl_support
- Valloric/ycmd#934 - run-tests-fix-removing-cfamily
- Valloric/ycmd#933 - java-completer-server-is-running
- Valloric/ycmd#932 - java-completer-stderr
- Valloric/ycmd#931 - server-file-state
- Valloric/ycmd#929 - fix-cs-instructions
- Valloric/ycmd#926 - code-actions-offset
- Valloric/ycmd#924 - quiet-build

<!--[Please explain **in detail** why the changes in this PR are needed.]

[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/2939)
<!-- Reviewable:end -->
2018-03-09 01:18:41 -08:00
Boris Staletic
137f1382b1 ycmd update 2018-03-09 07:54:24 +01:00
zzbot
4b3075bf54
Auto merge of #2930 - micbou:lower-minimum-python-version-requirements, r=bstaletic
[READY] Lower minimum Python version requirements on Travis and CircleCI

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

<!-- 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/2930)
<!-- Reviewable:end -->
2018-02-26 16:50:14 -08:00
zzbot
9d9c12a192
Auto merge of #2926 - puremourning:fixit-no-quickfix, r=micbou
[READY] Don't open the quickfix window after FixIt/Refactor

# PR Prelude

Thank you for working on YCM! :)

**Please complete these steps and check these boxes (by putting an `x` inside
the brackets) _before_ filing your PR:**

- [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

When FixIt was originally implemented, I decided to present the quick fix list containing the set of changes made to the buffers as it was thought this would be helpful and would reassure the user that the changes we made to their code made sense and were safe. Some large part of this decision was paranoia.

Since then we're using fixit code in a lot more places and the feature is pretty mature. I personally find the opening of the quick fix window to be a bit of a pain, and I quickly end up closing it manually to reclaim the space. I have literally never used it to jump to a location that was changed.

I have received recent feedback from users that "Why is it when I do a FixIt, this annoying window appears at the bottom of the screen that I can't get rid of?". Most users who are unhappy with the result of a FixIt can, and do, use the undo command as a matter of habit.

So I propose to just not auto-display the quick fix window anymore for FixIts, Renames, etc. We continue to populate the quick fix list, however, so `:copen` can be used to inspect the results, for those power users that know about quick fix lists.

[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/2926)
<!-- Reviewable:end -->
2018-02-26 15:12:39 -08:00
zzbot
66b6fad000
Auto merge of #2931 - micbou:windows-prefix-command-with-python, r=puremourning
[READY] Prefix commands with python in Windows instructions

Arguments may be ignored when running the `install.py` script in a `cmd.exe` prompt if the command associated to Python files is incorrect. Update the Windows instructions by prefixing the commands with `python`.

Fixes #2929.

<!-- 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/2931)
<!-- Reviewable:end -->
2018-02-26 12:42:14 -08:00