Commit Graph

1607 Commits

Author SHA1 Message Date
Ben Jackson
6029a672ee Prevent postcomplete_tests.py from leaving mock object lying around
Previously, running postcomplete_tests.py could lead to MagicMock objects being
left around within the ycm modules. This lead to random test failures in other
modules.

Further, by using mock.patch appropriately, tests withing postcomplete_tests.py
no longer rely on mocking performed by previous tests (and can be successfully
run individually)
2015-12-21 19:38:56 +00:00
Ben Jackson
861546fac0 Display errors raised by OnFileReadyToParse in non-diagnostics filetypes 2015-12-20 17:27:17 +00:00
Homu
93c2a8644b Auto merge of #1824 - micbou:ycmd-update, r=Valloric
Update to latest ycmd

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1824)
<!-- Reviewable:end -->
2015-12-13 09:25:33 +09:00
Homu
14083d939d Auto merge of #1821 - micbou:ycm-issue-1818, r=vheon
Set buffer filetypes for UltiSnips

Currently, only `all` snippets are displayed by YCM because UltiSnips is called without setting the buffer filetypes. See issue #1818.

This is fixed by using UltiSnips methods `reset_buffer_filetypes` and `add_buffer_filetypes`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1821)
<!-- Reviewable:end -->
2015-12-11 02:55:11 +09:00
micbou
aa73ea0175 Set buffer filetypes for UltiSnips
This fixes #1818.
2015-12-10 00:20:25 +01:00
micbou
26db1db531 Update to latest ycmd 2015-12-08 20:45:24 +01:00
Homu
cc623d43ea Auto merge of #1814 - kennykaye:error-warning-count, r=vheon
Expose functions to get error and warning counts

@Valloric I've implemented two functions which resolve #1011

The interface exposed to Vim is:

```viml
youcompleteme#GetErrorCount()
youcompleteme#GetWarningCount()
```

Below is a rough example of how these methods can be used to integrate with other plugins. In this case Lightline has been extended to show the error and warning count as red and yellow sections on the end of the status line, respectively.

![animation](https://cloud.githubusercontent.com/assets/3267574/11604073/078cb98e-9a9d-11e5-9fa3-c9b4bb6a6e82.gif)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1814)
<!-- Reviewable:end -->
2015-12-06 06:37:39 +09:00
Kenny Kaye
0c55527a38 Included usage example for error/warning getters 2015-12-05 11:06:33 -08:00
Kenny Kaye
908fd68548 Update help doc formatting 2015-12-05 10:34:05 -08:00
Kenny Kaye
bb8490e6c7 Properly namespace vim warning/error getters 2015-12-05 09:24:15 -08:00
Kenny Kaye
163238992c Document YcmGetErrorCount and YcmGetWarningCount functions 2015-12-05 09:12:28 -08:00
Kenny Kaye
dafc36ba37 Expose functions to get error and warning counts 2015-12-04 14:45:11 -08:00
Homu
e166907e98 Auto merge of #1807 - micbou:canonical-response, r=vheon
Handle canonical response from subcommands

In continuation to PR #1805, when the ycmd server returns a canonical type (boolean, number, string, etc.), we should print it to the user.

For example, this applies to the `SolutionFile` C♯ subcommand which only returns a string (actually, this could be improved in the completer).

This also fixes a thrown exception when the response is not iterable (a number for example).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1807)
<!-- Reviewable:end -->
2015-11-30 04:30:35 +09:00
micbou
37f3f1530e Handle scalar response from subcommands
When the ycmd server returns a scalar (boolean, number, string, etc.)
from a subcommand, print it to the user.
2015-11-29 20:03:02 +01:00
Homu
4651c2112b Auto merge of #1805 - micbou:boolean-response, r=Valloric
Handle boolean responses from ycmd subcommands

`ServerReady`, `ServerRunning`, and `ServerTerminated` C♯ subcommands could return a traceback or nothing in Vim because ycmd returns a boolean as the response of these commands.
Fix this by echoing `Yes` when the response is `True`, `No` otherwise.

Refactor the `RunPostCommandActionsIfNeeded` function to improve readability.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1805)
<!-- Reviewable:end -->
2015-11-29 02:56:14 +09:00
micbou
13aeaa37a8 Handle boolean responses from ycmd
Fix ServerReady, ServerRunning, and ServerTerminated subcommands from
C♯ completer.
2015-11-28 16:48:24 +01:00
Homu
96f0d94196 Auto merge of #1786 - ReadmeCritic:master, r=Valloric
Update README URLs based on HTTP redirects

Created with https://github.com/dkhamsing/frankenstein

### GitHub Corrected URLs
Was | Now
--- | ---
http://mxcl.github.com/homebrew/ | http://mxcl.github.io/homebrew/
https://github.com/gmarik/vundle/issues/48 | https://github.com/VundleVim/Vundle.vim/issues/48
https://github.com/nosami/OmniSharpServer | https://github.com/OmniSharp/omnisharp-server

### Other Corrected URLs
Was | Now
--- | ---
http://en.wikipedia.org/wiki/Subsequence | https://en.wikipedia.org/wiki/Subsequence
http://www.cmake.org/cmake/resources/software.html | https://cmake.org/download/

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1786)
<!-- Reviewable:end -->
2015-11-21 14:24:12 +09:00
ReadmeCritic
6ef35bd197 Update Homebrew URL 2015-11-18 12:35:19 -08:00
ReadmeCritic
792e0aab69 Update README URLs based on HTTP redirects 2015-11-18 08:58:55 -08:00
Homu
2de2f0df8d Auto merge of #1760 - micbou:ycm-toggle-logs, r=Valloric
Introducing :YcmToggleLogs command

Two approaches were proposed in PR #1753:
- open the stdout and stderr logfiles in Vim windows or close them if already opened: `:YcmToggleLogs`;
- open one of the logfiles in the preview window by specifying it as an argument in the command: `:YcmShowLog <stdout|stderr>`.

This PR merges both approaches by adding an optional argument (`Stdout` or `Stderr`) to the first approach. When no argument is given, both logfiles are opened (or closed if already opened).

With this approach, we cannot use the preview window because only one such window is allowed by Vim. So, we simulate it by adding properties specific to the preview window (horizontal split, height, etc.)

Since they are multiple ways to open a file in Vim, I added a generic function `OpenFilename` for this. It makes easy to customize the way logfiles are opened and could be useful for new features.

Tests were a pain to add and I am not sure of the way I implemented them. If someone could review them. There is some refactoring of the Vim mock.

I updated the documentation and the contribution guidelines. I added a new instruction when creating an issue: adding the output of the `:YcmDebugInfo` command. We often ask it in the issues.

I suggest fetching the `ycm-toggle-logs` branch of my repository to test yourself this command.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1760)
<!-- Reviewable:end -->
2015-11-17 12:29:56 +09:00
Homu
ad5880e01f Auto merge of #1782 - micbou:requests, r=Valloric
Remove requests submodule

See PR Valloric/ycmd#259.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1782)
<!-- Reviewable:end -->
2015-11-17 12:29:46 +09:00
micbou
e7112e4543 Update to latest ycmd 2015-11-17 00:13:44 +01:00
micbou
31cbb3b6aa Remove requests submodule
Since the requests module is already provided by ycmd, we don't need
to add it a second time in YCM.
2015-11-17 00:13:44 +01:00
micbou
e95776890d Fix stdout and stderr occurences
Fix stdout and stderr occurences in documentation and contribution
guidelines.
2015-11-11 17:26:16 +01:00
micbou
6f36c3ff82 Improve :YcmToggleLogs behavior
If already opened logfiles are not visible (hidden buffers or in another
tab), close them and open new ones. It fixes the issue where the command
seems to do nothing even though it actually close the non-visible logfiles.
2015-11-11 14:32:01 +01:00
micbou
2eb75ced81 Update buffers-related tests
Mock buffers as a list of buffers where each buffer is represented
as a dictionary containing its filename, its number, and optionally
its associated window.
Test buffer visibility instead of existence.
Mock Vim wipeout command.
Refactor Vim mocks.
2015-11-11 14:18:26 +01:00
micbou
9ce4e31718 Do not capitalize :YcmToggleLogs argument
stdout and stderr names are rarely capitalized.
2015-11-11 14:15:01 +01:00
Homu
65cc309421 Auto merge of #1762 - puremourning:test-on-osx, r=micbou
Run tests on OS X

There should be no difference between the behaviour on OS X and the behaviour on other platforms as all of the tests are python. However, running them is cheap and proves that there are no differences.

The approach is to import the scripts from `ycmd` with a couple of modifications:
     - don't set `YCM_CORES=1` as we didn't before, and this makes the build a lot faster
     - don't install `gcc-4.8` as we didn't before
     - install `argparse` for the tests as it is not available in python2.6

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1762)
<!-- Reviewable:end -->
2015-11-09 08:29:46 +09:00
Ben Jackson
90dc6fdae5 Correct import of argparse 2015-11-08 23:09:41 +00:00
Ben Jackson
0639200153 Run tests on OS X
We import the scripts from ycmd with a couple of modifications:
 - don't set YCM_CORES=1 as we didn't before, and this makes the build a lot faster
 - don't install gcc-4.8 as we didn't before
 - install argparse as it is not available in python2.6
2015-11-08 22:07:45 +00:00
micbou
26a18643ee Update contribution guidelines 2015-11-08 18:43:52 +01:00
micbou
b3c9f3ffc1 Add :YcmToggleLogs documentation 2015-11-08 18:43:52 +01:00
micbou
cbe3e04745 Add :YcmToggleLogs command 2015-11-08 18:43:52 +01:00
micbou
f23cbae2a8 Add tests for Vim file and buffer operations
Refactor Vim mocking.
2015-11-08 18:43:52 +01:00
Homu
59b91817a0 Auto merge of #1761 - micbou:appveyor, r=puremourning
Fix AppVeyor configuration

AppVeyor certainly made some changes to their infrastructures because the `run_tests.py` script is not properly executed anymore. We now need to specifically call it with python.

This is already done in the `ycmd` repository so no changes needed there.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1761)
<!-- Reviewable:end -->
2015-11-09 02:30:55 +09:00
micbou
ea62d08ecd Fix AppVeyor configuration
We need to explicitly call the run_tests script with python. Otherwise,
the script is not properly executed.
2015-11-08 18:03:01 +01:00
Homu
0352ed9b1f Auto merge of #1753 - micbou:remove-vim-stdout-option, r=Valloric
Remove g:ycm_server_use_vim_stdout option

The `g:ycm_server_use_vim_stdout` option is not working like expected. ycmd logs are not written to the console when using the gui client with this option enabled. This is the case on Windows and I think @puremourning can confirm this on other platforms. Worse, it also makes the ycmd server unresponsive on Windows.

It's a big issue because we recommend to use this option in [CONTRIBUTING.md](https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md).

This PR removes the option and updates the contribution guidelines by asking the user to put the `let g:ycm_server_keep_logfiles = 1` option instead.

To further improve the debugging process, I would like to add a new command `:YcmToggleLogs` (thanks to @puremourning for the idea) that automatically open or close the ycmd stdout and stderr logs as windows in Vim. If you agree, I'll send another PR adding the command.

Note: if you are wondering why the ycmd stdout logs are always empty while you are adding print statements in the ycmd code, this is because the output needs to be flushed: `sys.stdout.flush()`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1753)
<!-- Reviewable:end -->
2015-11-02 03:45:39 +09:00
micbou
186aa6b671 Remove g:ycm_server_use_vim_stdout option
This option does not work like expected. Logs are not written to the
console. It also makes the ycmd server unresponsive on Windows.
2015-10-27 18:19:22 +01:00
Homu
f20c69321d Auto merge of #1742 - micbou:documentation, r=Valloric
Add an entry for Fedora installation in README.md

Following PR #1740. Update the Vim documentation.

Maybe we should remove the `super-quick` in the titles to make them shorter and be consistent with the others. I'll update the PR if you agree.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1742)
<!-- Reviewable:end -->
2015-10-25 07:38:40 +09:00
micbou
de06e22a02 Update installation titles 2015-10-24 20:34:31 +02:00
micbou
2084ee2909 Add Fedora entry in README.md
Update Vim documentation
2015-10-23 15:08:48 +02:00
Homu
b1f2171f9f Auto merge of #1740 - rjleaf:patch-1, r=Valloric
Fedora documentation with required dependencies. Works on F22.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1740)
<!-- Reviewable:end -->
2015-10-23 13:30:14 +09:00
Ryan Leaf
234fd5acb8 Fedora documentation with required dependencies. Works on F22. 2015-10-21 18:19:27 -04:00
Homu
dec2287638 Auto merge of #1738 - micbou:goto-include, r=vheon
Add GoToInclude documentation and update to latest ycmd

This PR closes #334.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1738)
<!-- Reviewable:end -->
2015-10-21 02:46:57 +09:00
micbou
e7c7e4fe84 Update to latest ycmd
This closes #334.
2015-10-20 15:17:13 +02:00
micbou
570444fc5a Add GoToInclude subcommand to documentation 2015-10-20 15:06:49 +02:00
Homu
76ff85bf75 Auto merge of #1727 - micbou:vim-commands, r=Valloric
Define Vim commands only if setup is successful

Vim commands (`YcmDebugInfo`, `YcmCompleter`, etc.) should not be defined if an error is encountered when processing the `s:SetUpPython` function. Why? Because those commands will return errors like `name 'ycm_state' is not defined`.

Note: due to an unexpected behavior, those commands work fine when libraries are found outdated. See issue #1726.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1727)
<!-- Reviewable:end -->
2015-10-19 04:04:48 +09:00
Homu
2bc1ec80be Auto merge of #1724 - mkevac:patch-1, r=Valloric
Add notice to FAQ about ctags and C projects



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1724)
<!-- Reviewable:end -->
2015-10-19 04:02:26 +09:00
Homu
a0817e6f9c Auto merge of #1732 - davits:master, r=Valloric
Fix rare crash when trying to jump to file which has .swp

One of my coworkers found this crash today. Usually he opens a lot of gvim-s and forgets about them, and eventually one of GoToDefinition commands backfired :)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1732)
<!-- Reviewable:end -->
2015-10-19 04:00:16 +09:00
Davit Samvelyan
cb3325970e Refactoring 2015-10-14 11:37:33 +04:00