Commit Graph

221 Commits

Author SHA1 Message Date
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
micbou
3b115831a0
Fix applying fixit twice after completion 2018-04-06 17:56:25 +02:00
micbou
866693ef80
Refactor CompleteDone logic
Move CompleteDone logic to the CompletionRequest class.
2018-03-28 22:00:43 +02:00
micbou
ca8211a64b
Fix column clamping when highlighting diagnostics on Python 3 2018-03-25 16:02:48 +02: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
Ben Jackson
dc52b73048 Don't open the quickfix window after fixit 2018-02-22 23:02:10 +00:00
zzbot
54a4ecf2d9
Auto merge of #2922 - micbou:improve-diagnostic-match, r=bstaletic
[READY] Improve diagnostic matches display

There are two issues with how we display diagnostic matches. The first issue is that if the current buffer contains diagnostic matches and is split in a new window, all the matches are cleared and only matches in the new window are shown. The second issue is that if a new buffer with no diagnostic support is open in the current window and that window already contained matches then the matches are still displayed. Here's an illustration of both issues (signs are disabled):

![diagnostic-matches-issue](https://user-images.githubusercontent.com/10026824/36352338-bfeb2092-14b7-11e8-88f4-ae8cf6903304.gif)

The solution is to add an autocommand that updates matches on the `BufEnter` and `WinEnter` events. Here's the result:

![diagnostic-matches-fix](https://user-images.githubusercontent.com/10026824/36352340-c2a64a8c-14b7-11e8-8db2-4f1f54448c65.gif)

Note that it's not perfect as multiple windows of the same buffer won't be updated simultaneously. Supporting that scenario is rather tricky because we would need to go through all the windows to update the matches and switching windows can lead to a lot of issues (like interrupting visual mode) so we don't.

This PR also improves how we update matches by only displaying matches that are not already present and then clearing the remaining ones (similarly to what we do with signs; see PR https://github.com/Valloric/YouCompleteMe/pull/2915) instead of always clearing all the matches then displaying the new ones.

<!-- 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/2922)
<!-- Reviewable:end -->
2018-02-18 17:15:46 -08:00
micbou
c84e70737c
Improve diagnostic matches display 2018-02-18 21:32:00 +01:00
micbou
b182556804
Add function to capture Vim command output 2018-02-18 14:06:09 +01:00
micbou
5e98da5b09
Improve diagnostic sign placement 2018-02-18 10:46:19 +01:00
zzbot
02f117035e
Auto merge of #2910 - micbou:fix-typo-tests, r=puremourning
[READY] Fix typo in tests name

`:%s/YouCompelteMe/YouCompleteMe`.

<!-- 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/2910)
<!-- Reviewable:end -->
2018-02-12 13:06:31 -08:00
micbou
8ab3f73b4d
Fix typo in tests name 2018-02-12 02:03:05 +01:00
micbou
a13329fe94
Add range support to completer command 2018-02-12 01:50:08 +01:00
Ben Jackson
7989b7b0fd Support for additional FixIts on java completions
Java completer can include FixIts which are applied when a completion
entry is selected. We use the existing mechanism implemented for c-sharp
to perform these edits using the CompleteDone autocommand.

However, the existing mechanism relies on pattern matching the source to
work out which item was completed. Vim patch 8.0.1493 introduces support
for user_data on completion items, so when available we populate it with
the completion array index of the item and use that to get the exact
element that was selected. This is both a lot faster and a lot more
accirate.

Of course when applying these 'FixIts' we don't interrupt the user with
confirmation or the quickfix list as this would just be annoying. If the
server reports that an edit must be made, we just make the edit. This is
achieved by adding a silent flag to ReplaceChunks.
2018-02-11 18:11:34 +00:00
zzbot
39fe6d1f86
Auto merge of #2898 - micbou:line-overlapping-chunks, r=micbou
[READY] Apply chunks from bottom to top

Without the proposed fix, the test included in that PR fails as follows
```
FAIL: ycm.tests.vimsupport_test.ReplaceChunksInBuffer_LineOverlappingChunks_test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "C:\Users\micbou\projects\YouCompleteMe\python\ycm\tests\vimsupport_test.py", line 768, in ReplaceChunksInBuffer_LineOverlappingChunks_test
    AssertBuffersAreEqualAsBytes( expected_buffer, result_buffer )
  File "C:\Users\micbou\projects\YouCompleteMe\python\ycm\tests\vimsupport_test.py", line 86, in AssertBuffersAreEqualAsBytes
    eq_( ToBytes( result_line ), ToBytes( expected_line ) )
AssertionError: b'    third line' != b'    third '
```
Found the issue while trying to add code formatting support to the language server completer. The test is based on a real-world scenario when formatting with jdt.ls (for some reason, jdt.ls is including the newline of the previous line when fixing indentation).

<!-- 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/2898)
<!-- Reviewable:end -->
2018-02-10 15:20:24 -08:00
micbou
c692b48bc6
Apply chunks from bottom to top 2018-02-10 21:42:41 +01:00
zzbot
0d495578b5
Auto merge of #2863 - puremourning:java-async-diagnostics, r=micbou
[READY] Java support with asynchronous diagnostics and messages

# 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

This change is required for a better user experience when using native
java support

This implements an asynchronous message system using a long-poll request
to the server.

The server provides an endpoint /receive_messages which blocks until
either a timeout occurs or we receive a batch of asynchronous messages.
We send this request asynchronously and poll it 4 times a second to see
if we have received any messages.

The messages may either be simply for display (such as startup progress)
or diagnostics, which override the diagnostics returned by
OnFileReqdyToParse.

In the former case, we simply display the message, accepting that this
might be overwritten by any other message (indeed, requiring this), and
for the latter we fan out diagnostics to any open buffer for the file in
question.

Unfortunately, Vim has bugs related to timers when there is something
displayed (such as a "confirm" prompt or other), so we suspend
background timers when doing subcommands to avoid vim bugs. NOTE: This
requires a new version of Vim (detected by the presence of the
particular functions used).

NOT_READY because:

- the submodule commit points at my repo and requires https://github.com/Valloric/ycmd/pull/857 to be merged
- my spider sense suggest i have more testing to do...

Notes:

- Part 3 (I think) of the Java support PRs. This one actually adds the minimal changes for working java support
- There are about 2 or 3 other PRs to come to add things like automatic module imports, etc.

[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/2863)
<!-- Reviewable:end -->
2018-02-10 12:37:57 -08:00
Ben Jackson
292de25c72 Add support for Java diagnostics and asynchronous messages
This implements an asynchronous message system using a long-poll request
to the server.

The server provides an endpoint /receive_messages which blocks until
either a timeout occurs or we receive a batch of asynchronous messages.
We send this request asynchronously and poll it 4 times a second to see
if we have received any messages.

The messages may either be simply for display (such as startup progress)
or diagnostics, which override the diagnostics returned by
OnFileReqdyToParse.

In the former case, we simply display the message, accepting that this
might be overwritten by any other message (indeed, requiring this), and
for the latter we fan out diagnostics to any open buffer for the file in
question.

Unfortunately, Vim has bugs related to timers when there is something
displayed (such as a "confirm" prompt or other), so we suspend
background timers when doing subcommands to avoid vim bugs. NOTE: This
requires a new version of Vim (detected by the presence of the
particular functions used).
2018-02-10 16:29:27 +00:00
micbou
6c326a1b5f
Avoid traceback when computing extra conf data
Evaluating the values of g:ycm_extra_conf_vim_data may raise a Python exception
(e.g. one of the values is not defined). Since that option is parsed each time
a request is sent, such exception makes the editor almost unusable as each key
press is printing a Python traceback to the user. Catch and log the exception.
2018-02-10 15:27:27 +01:00
Boris Staletic
605ef42cd6 Drop Python 2.6 and Python 3.3 2018-01-30 18:34:50 +01:00
micbou
43ebd5252d
Optimize request building
Reduce the time spent to build the request when there are a lot of buffers by:
 - using the options property on the buffer object to get the mod variable
instead of evaluating getbufvar;
 - not computing the buffer filepath if the buffer is not modified;
 - passing the number of the unloaded buffer instead of its filepath on the
   BufferUnload event. Getting the Python buffer object from its number is
   easier than from its filepath.
2018-01-09 01:40:07 +01:00
Ben Jackson
c2f26159f6 Use fake filetype for omni completion test
Now that the server supports Java natively, we need to use a
filetype that does not have native support to ensure that we call the
mocked omnifunc, but also one for which YCM has a semantic trigger.

Rather than picking another random languagse, which might break in the
future, we invent a language (ycmtest) and supply a manual trigger
mapping to the YouCompleteMe object.
2017-12-23 15:41:14 +00:00
zzbot
8aa617ec03 Auto merge of #2861 - puremourning:always-supply-wd, r=micbou
[READY] Always supply working directory

This allows completer servers to detect the correct directory to launch
no matter what request initialises the completer server.

# 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

This change ensures that the client supplies the working directory to the server on each request, in particular, event notifications; the java and javascript completers use this to start the server in the `FileReadyToParse` event, rather than on construction of the completer. The subtle difference allows them to use the client's working directory, rather than the _server's_ working directory to do things like project detection.

See also:

* This is PR 1 of the set of changes related to #2827 - client changes required to support Java and other language-server protocols.
* ycmd change for javascript that makes use of this now: https://github.com/Valloric/ycmd/pull/886
* updated API doc: http://puremourning.github.io/ycmd-1

The ycmd API change is simply to allow `working_dir` on all requests.

cc for minor optional API change: @abingham @Qusic @LuckyGeck @mawww @richard1122 @jakeanq @orsonteodoro

[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/2861)
<!-- Reviewable:end -->
2017-12-22 17:36:34 -08:00
Ben Jackson
bc6ac461f3 Always supply working directory
This allows completer servers to detect the correct directory to launch
no matter what request initialises the completer server.
2017-12-23 00:51:21 +00:00
micbou
497a803188
Prompt the user to select a logfile with YcmToggleLogs
When no argument is given to the YcmToggleLogs command, instead of displaying
the list of available logfiles, prompt the user to open (or close if already
open) one of them.
2017-12-22 19:58:29 +01:00
micbou
c3859791ea
Use fnameescape to escape filepath 2017-12-01 17:54:45 +01:00
micbou
67d2a0fbf8
Fix error when filetype is a number
The VimExpressionToPythonType function automatically convert a number
represented as a string to an integer. This causes an error when used to
evaluate a filetype set to a number as the result is split on the dot character
to get a list of filetypes and an integer cannot be split. Use vim.eval and
ToUnicode instead.
2017-11-26 16:44:35 +01:00
micbou
664d2c99d9
Change GetBufferNumberForFilename default behavior
If no buffer exists for a given filename, the GetBufferNumberForFilename
function will create a buffer for that file by default. This behavior is
unexpected given the name of that function and may lead to performance issues
when ycmd returns diagnostics for a lot of files with no corresponding buffers.
The default behavior for that function should be to not create a buffer.
2017-11-17 00:52:40 +01:00
micbou
84998b5b5f
Fix bare except statement
Use Exception to catch all exceptions instead of a bare except statement.
2017-10-23 21:05:16 +02:00
micbou
2b8e86797c
Improve server crash notification at startup
Notify the user if the server crashed during server polling at startup.
2017-10-05 13:12:23 +02:00
micbou
880f8700b3
Echo diagnostic asynchronously 2017-10-04 16:59:47 +02:00
zzbot
712c417529 Auto merge of #2787 - micbou:improve-path-to-python-interpreter, r=puremourning
[READY] Improve path to python interpreter error handling

YCM returns the cryptic error `YouCompleteMe unavailable: [Errno 2] No such file or directory` when the Python interpreter path used to start the server doesn't exist. See issues https://github.com/Valloric/YouCompleteMe/issues/2773 and https://github.com/Valloric/YouCompleteMe/issues/2775.

This PR improves that by using the `FindExecutable` and `GetExecutable` functions from ycmd to check if the Python interpreter path exists (and is an executable) and by returning a much more helpful message if it doesn't. We use `FindExecutable` instead of `GetExecutable` on the `g:ycm_server_python_interpreter` option so that the user can specify a Python path with just the executable name (e.g. `python`, `python2`, `python3`).

This also fixes a Python traceback in Vim that occurs when, after successfully starting the server, the `g:ycm_server_python_interpreter` option is set to an invalid path and the server is restarted with `:YcmRestartServer`. Steps to reproduce are:
 - start Vim with a working YCM;
 - type `:let g:ycm_server_python_interpreter = '/invalid/python/path'`;
 - type `:YcmRestartServer`.

<!-- 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/2787)
<!-- Reviewable:end -->
2017-09-21 14:07:27 -07:00
micbou
5d78e4c2c0
Improve path to python interpreter error handling 2017-09-21 21:17:32 +02:00
micbou
d61944098a
Do not open location list at the bottom of screen
The location list is specific to the current window so it should be opened
inside the current window, not to full width at the bottom of the screen.
2017-09-17 20:34:52 +02:00
micbou
c5bec8f690
Expect GetCompletions_Cache_List_Unicode test to fail
This test is expected to fail since we now filter and sort candidates on empty
query.
2017-09-10 16:33:24 +02:00
micbou
031edea89e
Improve error message when server crashes
Give the exact command that the user needs to type to open the server logfile
when the server unexpectedly crashes.
2017-08-18 18:15:20 +02:00
micbou
bdac8ed43e
Do not read server stderr
Reading ycmd stderr blocks Vim if a subserver process is still up even if ycmd
is not running.
2017-08-17 20:16:54 +02:00
micbou
2afc0d5f5f
Update BufferUnload test with Unicode paths 2017-07-08 14:19:27 +02:00
micbou
139e3fbaf9
Add omnifunc tests 2017-07-07 22:45:05 +02:00
micbou
600383fbac
Do not cache omnifunc on FileReadyToParse event 2017-07-07 21:39:27 +02:00
micbou
dec9c0f827
Add test with omnifunc moving cursor position 2017-07-07 13:59:57 +02:00
micbou
db0b9ab335
Rewrite omnifunc tests
The VimBuffer object now accepts a Python function as its omnifunc.
2017-07-05 23:21:36 +02:00
micbou
81546b901e
Fix HiddenEnabled function
The 'hidden' option is a global option, not a buffer one. If this option is
false, we should check if the 'bufhidden' option, which is local to the buffer,
is set to 'hide'. If so, the buffer can be hidden despite the 'hidden' option
being false.
2017-07-05 19:56:13 +02:00
micbou
e5457affd8
Add JumpToLocation unicode tests 2017-07-05 00:55:29 +02:00
micbou
f31102e317
Check if server is ready before running tests 2017-07-03 18:06:01 +02:00
Ben Jackson
5c98b69b6f Fix tests supplying findstart. It's 0-based. Known failure is no longer a known failure 2017-07-03 00:55:03 +01:00
micbou
223ae6ab9f
Rewrite completion system
Bring fully asynchronous completion by polling for completions with a timer
then calling completefunc once the completions are ready. Use the start column
returned by the server in completefunc. Immediately display the last completion
on the TextChangedI event to prevent the popup menu disappearing while waiting
for the completions. Handle the TextChangedI event not being triggered while
the completion menu is open by closing the menu when inserting a character
through the InsertCharPre event, and when deleting a character on the <BS> and
<C-h> keys.
2017-06-21 02:32:57 +02:00
zzbot
44d4f1d299 Auto merge of #2690 - micbou:identifier-functions-codepoint, r=Valloric
[READY] Use codepoint offsets in identifier functions

`CurrentIdentifierFinished` and `LastEnteredCharIsIdentifierChar` incorrectly use byte offsets with unicode lines (`CurrentColumn` returns a byte offset and `CurrentLineContents` a unicode string). This leads to weird bugs when there is a non-ASCII character on the current line:

![unicode-identifier-bug](https://user-images.githubusercontent.com/10026824/27256590-34b27c8c-53ba-11e7-8032-b98f0c7e0b14.gif)

This is fixed by converting byte offsets to codepoint ones through the `ByteOffsetToCodepointOffset` function.

This changes the behavior of these two functions when the current column position is invalid. Both functions returned false in that case. They now return as if the current column were at the end of the line. In practice, this doesn't really matter since the position of the current column should always be valid.

<!-- 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/2690)
<!-- Reviewable:end -->
2017-06-18 12:29:13 -07:00
micbou
eb3c0cd8c1
Use codepoint offsets in identifier functions
CurrentIdentifierFinished and LastEnteredCharIsIdentifierChar incorrectly use
byte offsets with unicode lines. Convert those offsets to codepoint offsets.
2017-06-18 20:41:30 +02:00
Davit Samvelyan
a70755aa40 Removed current buffer caching approach. 2017-06-12 15:23:14 +04:00
Davit Samvelyan
e5b0565d1a Fixed bug: current buffer was not set correctly.
Other minor fixes.
2017-06-10 09:53:18 +04:00
Davit Samvelyan
22be4e777d Refactored diag interface, removed dummy sign. 2017-06-05 22:20:57 +04:00
zzbot
c2906b6fef Auto merge of #2631 - davits:changedtick, r=bstaletic
[READY] Moved change tracking to python. Per buffer diagnostics

Thank you for working on YCM! :)

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

Adds an emulation of Vim buffer object and moves change tracking into python.
Now diagnostics are stored per buffer, which effectively solves #2165 .

<!-- 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/2631)
<!-- Reviewable:end -->
2017-06-05 03:21:41 -07:00
Davit Samvelyan
8c6efb4214 Cache current buffer on buffer visit. 2017-06-04 12:09:49 +04:00
Boris Staletic
3e77555905 Filepath space escaping 2017-05-24 17:30:15 +02:00
Davit Samvelyan
b6bbe6388f Removed unused function, added comment. 2017-05-21 19:35:01 +04:00
Davit Samvelyan
3a690fc8d4 Update based on the latest upstream changes. 2017-05-21 18:58:29 +04:00
Davit Samvelyan
0846673aa4 Latest upstream changes with buffer emulation.
Contains diagnostic interface improvents as well.
2017-05-21 18:26:50 +04:00
Davit Samvelyan
979f14acfd Moved change tracking to python. Per buffer diags 2017-05-21 11:47:27 +04:00
micbou
1fc6b4a43b
Clean C# inserting namespace code
Remove code that automatically insert namespaces in C# for Vim versions prior
to 7.4.774.
2017-05-17 19:44:02 +02:00
micbou
26ac0c8730
Add syntax keywords tests
Patch EventNotification instead of BaseRequest in event notification tests.
2017-05-17 13:09:39 +02:00
micbou
47f3f9d2c6
Fix diagnostic highlighting with invalid location extent
Ignore location extent when starting column is zero. Do not highlight warnings
as errors when location extent is invalid.
2017-04-06 17:53:23 +02:00
Andrey Pikas
ebc3856121 Merge branch 'master' into fork_master 2017-03-30 20:26:11 +03:00
micbou
e45a409ac9
Prioritize errors over warnings on the same line 2017-03-29 12:34:48 +02:00
micbou
fb000ca9e7
Accept capitalized name for Python executable
Python executable name may be capitalized on macOS.
2017-03-28 02:12:15 +02:00
micbou
f84796bf0e
Remove Python version check
Starting the Python interpreter to check its version is slow.
2017-03-25 18:27:07 +01:00
micbou
f3ccafe3ae
Do not install aliases from future
Installing aliases from python-future is unreliable and slow.
2017-03-18 18:24:48 +01:00
Andrey Pikas
2495dffa59 Fix tests under Windows. 2017-03-12 23:06:05 +03:00
Andrey Pikas
822010fe4c Move import to the top of file. 2017-03-12 20:18:24 +03:00
Andrey Pikas
592b85516b Tests for checking that extra_conf_data sended to server from :DebugInfo and :YcmCompleter commands. 2017-03-12 19:03:07 +03:00
micbou
414782bc74
Add tests for diagnostic commands 2017-02-20 18:28:49 +01:00
Andrea Cedraro
fda5c7e6c6 Use bang version of normal
Fixes #2519
2017-01-31 22:09:40 +01:00
micbou
8426191655
Update test 2017-01-24 22:43:41 +01:00
micbou
ab758e4c64
Include subservers logfiles in YcmToggleLogs 2017-01-21 13:42:58 +01:00
micbou
18aba7a582
Implement new debugging information API 2017-01-18 11:13:11 +01:00
micbou
85d5844873
Add docstring to HandleServerException
Wrap request with HandleServerException in YcmdKeepalive class.
2016-12-12 02:53:57 +01:00
micbou
01aa54ee2d
Add tests 2016-12-12 02:36:15 +01:00
micbou
fd41d52dfe
Catch and log all server exceptions 2016-12-12 02:36:15 +01:00
micbou
b93c1fd47c
Add client logfile 2016-11-19 18:47:43 +01:00
Nader Akoury
9c93244d3b Addressed review comments and fixed tests 2016-11-11 10:15:22 -08:00
dhleong
0babb4b102 Cleanup 2016-11-03 11:21:15 -04:00
dhleong
0523ad02c0 Fix InsertNamespace indent matching
Aso updates the appropriate tests and adds docs to some
relevant methods whose behavior might be confusing
2016-11-02 08:08:30 -04:00
dhleong
26141253a5 Add some tests for InsertNamespace 2016-11-01 08:28:28 -04:00
Homu
d55b5c09d6 Auto merge of #2394 - micbou:move-client-tests, r=Valloric
[READY] Move client tests to the main tests folder

This makes it possible to configure all tests at a package level by implementing the `setUpPackage` and `tearDownPackage` functions in `python/ycm/tests/__init__.py` file.

<!-- 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/2394)
<!-- Reviewable:end -->
2016-10-26 07:46:33 +09:00
Homu
f27787f263 Auto merge of #2377 - dhleong:dhleong/#2021-quiet_messages, r=micbou
Implement ycm_quiet_messages options (See #2021)

# 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

See issue #2021. This is a partial implementation based on the syntastic option referenced, supporting the `!` flag and filters of type `regex` and `level`. Also supports filetype specific filters using `ycm_<ft>_quiet_messages`, but I couldn't think of a great way to fall back to syntastic configs for this one.

In terms of usefulness: I've been playing with C# recently, which has a bunch of style warnings that I don't want to follow, and prefer to only have the gutter showing if there are actually errors, or warnings that I *do* want to follow.

<!-- 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/2377)
<!-- Reviewable:end -->
2016-10-24 10:46:06 +09:00
dhleong
e2852a8b2b Update to use appropriate test_utils package after rebase 2016-10-22 23:33:43 -04:00
dhleong
7978215bca Refactor filter to not be initialized every time
We eagerly compile all the filters up front, then gather the
compiled filters into a DiagnosticFilter lazily, caching the
result to avoid garbage lists.
2016-10-22 23:31:46 -04:00
dhleong
b8280c7b19 Rename diagnostic_filter_tests -> diagnostic_filter_test 2016-10-22 23:31:46 -04:00
dhleong
18a25d45b3 Style refactor and cleanup 2016-10-22 23:31:46 -04:00
dhleong
bb793826b6 Refactor filter spec to filter_diagnostics; update tests, README 2016-10-22 23:31:46 -04:00
dhleong
3869830a65 Rename method for clarity and tweak style 2016-10-22 23:31:46 -04:00
dhleong
ca29f6abe8 Verify that an empty list overrides (disables) rules 2016-10-22 23:31:46 -04:00
dhleong
f15f9f2255 Fix style/lint issues 2016-10-22 23:31:46 -04:00
dhleong
73343bd98f Support filtering on level/kind 2016-10-22 23:31:46 -04:00
dhleong
f7fbbd16f7 Implement a preliminary quest_messages with regex support 2016-10-22 23:31:46 -04:00
micbou
993f0ef7b6
Move client tests to the main tests folder 2016-10-20 00:24:38 +02:00
micbou
234658f30b
Use helper function to get current directory
Fix tests.
2016-10-18 15:35:51 +02:00
micbou
3109c9d8a4
Add tests for current directory 2016-10-18 02:22:28 +02:00