Commit Graph

1563 Commits

Author SHA1 Message Date
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
Davit Samvelyan
a0495a994e Fix for rare crash when trying to jump to file which has .swp 2015-10-13 18:46:20 +04:00
Marko Kevac
410282830b Don't say that language tag is wrong 2015-10-12 19:32:41 +03:00
Marko Kevac
72fe806dc3 Add notice to FAQ about ctags and C projects 2015-10-12 19:16:04 +03:00
micbou
290a65219f Define Vim commands only if setup is successful 2015-10-12 15:27:30 +02:00
Homu
d98298ab87 Auto merge of #1720 - micbou:windows-documentation, r=Valloric
Add Windows documentation

This is the first draft of the official Windows documentation.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1720)
<!-- Reviewable:end -->
2015-10-12 01:35:42 +09:00
micbou
2ace4eea88 Add Windows documentation 2015-10-11 15:22:04 +02:00
Homu
7bf39973c1 Auto merge of #1719 - micbou:path-to-python-interpreter, r=puremourning
Move PathToPythonInterpreter function from ycmd to YouCompleteMe

This function contains mostly Vim-specific code and is only used in YouCompleteMe so we move it in vimsupport.py file.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1719)
<!-- Reviewable:end -->
2015-10-10 23:31:35 +09:00
micbou
87854f0245 Move PathToPythonInterpreter function to YCM
Create a module for paths.
2015-10-09 18:53:24 +02:00
Homu
5a186275a5 Auto merge of #1701 - puremourning:getdoc-readme, r=Valloric
Declare support for GetDoc subcommand

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

This change:
* updates the `README.md` and vim help
* updates the `ycmd` submodule to latest master, which includes `GetDoc` subcommand

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1701)
<!-- Reviewable:end -->
2015-09-25 11:14:24 +09:00
Ben Jackson
e137427a51 Udpdate ycmd to latest to add GetDoc subcommand 2015-09-24 22:25:42 +01:00
Ben Jackson
3ddc2fcbee Update documentation to add GetDoc subcommand 2015-09-24 22:25:27 +01:00
Homu
d4e9d4d1a3 Auto merge of #1698 - micbou:windows-appveyor, r=Valloric
[Windows support] Add AppVeyor configuration

@Valloric you need to add the YouCompleteMe project in your AppVeyor account. I'll update the badge.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1698)
<!-- Reviewable:end -->
2015-09-22 11:15:28 +09:00
micbou
9750835cf0 Add AppVeyor configuration 2015-09-22 04:12:46 +02:00
Homu
2816559ee4 Auto merge of #1694 - puremourning:detailed-info-subcommands, r=Valloric
Allow subcommands to display information in the preview window

References
====

https://github.com/Valloric/YouCompleteMe/issues/1653

There will be some PRs coming to ycmd that will supply documentation in this format

Background
====

This adds support to YCM for displaying "detailed info" (e.g. quick-info, documentation, etc.) from a completer subcommand response. We display the info in the preview window.

Technical notes
====

Use of the preview window
----

We display the detailed info text in the preview window. Vim's preview window is designed to display actual files, not scratch data. Our approach is to open a temporary file, even though that file is never  written. This way, all of Vim's existing settings for the preview window (and people's configured mappings) just work. This is also consistent with showing the documentation in the preview
window during completion (although, Vim fixes the preview window height to 3 in that case).

Other plugins have more complicated functions for this (such as eclim), or Scratch.vim, but this approach is simple and doesn't require external dependencies or additional settings. 


 `wincmd P` etc.
---

The approach in `vimsupport.py` of jumping around with `wincmd P` and `wincmd p` was taken pretty much directly from vim's `:help preview-window` (specifically `:help CursorHold-example`), so while ugly it is apparently the 'recommended' way.

`vim` module mocking
----

I had to change the way we were mocking the `vim` module in the tests. From the commit message:

    This required fixing a sort-of-bug in which the mock'd Vim module was always
    only set once, and could not be changed outside of the module which created it.
    This meant that it wasn't easy to have arbitrary tests, because it was dependent
    on the order in which the tests execute as to whether the return from
    MockVimModule() was actually the one in use.

    The solution was to make the mock'd vim module a singleton, imported by any
    tests which require fiddling with it. This should hopefully help testing going
    forwards.

I committed this separately to help review (hopefully).
2015-09-21 12:50:20 +09:00
Ben Jackson
958d8f1eb5 Support subcommands which return detailed info
We display the detailed info text in the preview window. Vim's preview window is
designed to display actual files, not scratch data. Our approach is to open a
temporary file, even though that file is never written. This way, all of Vim's
existing settings for the preview window (and people's configured mappings) just
work. This is also consistent with showing the documentation in the preview
window during completion.

Other plugins have more complicated functions for this (such as eclim), or
Scratch.vim, but this approach is simple and doesn't require external
dependencies or additional settings.

Tests:

This required fixing a sort-of-bug in which the mock'd Vim module was always
only set once, and could not be changed outside of the module which created it.
This meant that it wasn't easy to have arbitrary tests, because it was dependent
on the order in which the tests execute as to whether the return from
MockVimModule() was actually the one in use.

The solution was to make the mock'd vim module a singleton, and use mock's
patch decorator to assign new MagicMock() instances to those methods in the vim
module which a particular test is interested in.
2015-09-20 21:30:23 +01:00
Homu
04850041b9 Auto merge of #1680 - puremourning:quick-feature-summary, r=Valloric
Add super-quick feature summary by completer

I never got time to do the larger revamp of the README.md, but I thought a super-quick summary would be useful, as I'm about to add yet-another subcommand to a bunch of completers.
2015-09-20 02:48:07 +09:00
Ben Jackson
449b6fbb9f Add super-quick feature summary by completer 2015-09-19 12:41:09 +01:00
Strahinja Val Markovic
a7bb97f100 Updating to latest ycmd 2015-09-16 18:49:33 -07:00
Homu
61a5a9b84b Auto merge of #1689 - bronzehedwick:patch-1, r=micbou
Add VimL syntax highlighting to Readme
2015-09-16 06:08:33 +09:00
Chris DeLuca
1eafd4981d Add VimL syntax highlighting to Readme 2015-09-15 14:57:34 -04:00
Homu
e60fa3f138 Auto merge of #1679 - puremourning:typescript-subcommands, r=Valloric
Update subcommmands supported for typescript

Noticed that the subcommands supported by typescript are not listed. Updated the docs and ran

```
vim-tools/html2vimdoc.py -f youcompleteme README.md > doc/youcompleteme.txt
```
2015-09-15 13:03:30 +09:00
Homu
0d426e4922 Auto merge of #1636 - mispencer:CsAddImport, r=puremourning
Add required namespace in C# after completing

When forcing semantic completion with the keybind, C# completions can return a list of importable types. These types are from namespaces which havn't been imported, and thus are not valid to use without also adding their namespace's import statement. This change makes YCM automatically insert the necessary using statement to import that namespace on completion completion. In the case there are multiple possible namespaces, it prompts you to choose one.

Demo:
![c namespaceinsertdemo](https://cloud.githubusercontent.com/assets/1434266/9337289/b7994542-459b-11e5-8f52-e48af76a3aab.gif)

By default, the using statement is inserted after the last using statement. If there aren't any, it's inserted before the first line. This behavior is customization by setting a function to the vim global ``g:ycm_cs_insert_namespace_function``. I implemented this in pure vimscript largely so I could provide such customization...

Caveats: vim does not provide a way to get which completion was inserted. To get this, we store the completions, hook the CompleteDone event, and check than if the preceding text matches any of the completions. This is imperfect, and sometimes matches when it shouldn't. Also, the CompleteDone event requires 7.3.598 or newer.
2015-09-14 00:48:30 +09:00
Spencer G. Jones
bb21150798 Fix merge test failure 2015-09-13 08:57:09 -06:00
Spencer G. Jones
2a41101955 Merge remote-tracking branch 'origin/master' into CsAddImport 2015-09-13 08:49:28 -06:00
Ben Jackson
7c2b7b7ef3 Update subcommmands supported for typescript 2015-09-13 13:01:11 +01:00
Homu
a4f7d02a3b Auto merge of #1676 - micbou:fix-it-chunks-sorting, r=Valloric
Correct FixIt chunks sorting

While playing with FixIts in C++, I found the following issue. When fixing the third line in the code:
```cpp
template<int Value> struct CT { template<typename> struct Inner; };

CT<10 >> 2> ct; // expected-warning{{require parentheses}}
```
the following result is obtained:
```cpp
CT<1(0 >> 2)> ct; // expected-warning{{require parentheses}}
```
which is obviously wrong.

The issue is YouCompleteMe does not replace the chunks in the right order. It starts by adding the closing parenthesis, add one to the delta and inserts the opening parenthesis in the wrong place cause of the delta.

We actually use the expression `str(line) + ',' + str(column)` to sort the chunks by line then column whereas it should simply be `(line, column)`.

This PR fixes this issue, adds two tests which are failing in the current version, refactors the `_HandleFixitResponse` function and cleans up code.
2015-09-13 13:48:54 +09:00
Homu
9d8e85d363 Auto merge of #1677 - puremourning:add-clang-brief-to-preview, r=Valloric
Show docs from clang completer in preview window

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

We add the detailed_info (which is the function definiton) followed by the brief comment if supplied.

I added a test for the method, which is now reasonably complex.
2015-09-13 13:28:09 +09:00
Ben Jackson
5cfd6376c6 Show docs from clang completer in preview window
We add the detailed_info (which is the function definiton)
followed by the brief comment
2015-09-12 20:51:04 +01:00
micbou
8c17995bee Correct FixIt chunks sorting 2015-09-12 18:14:06 +02:00
micbou
17f5f20cd6 Add chunks sorting tests 2015-09-12 18:14:05 +02:00
micbou
2c72a3c598 Clean code in vimsupport tests 2015-09-12 18:14:04 +02:00
micbou
33316d8bf8 Refactor _HandleFixitResponse function 2015-09-12 18:13:54 +02:00
Spencer G. Jones
df73ca6b66 Update g:ycm_csharp_insert_namespace_expr documention 2015-09-11 17:14:09 -06:00
Spencer G. Jones
391b3df3b7 Update mimimum version in documention 2015-09-10 10:12:59 -06:00
Spencer G. Jones
28e318c0bb fixup! To determine which completion prompted CompleteDone, look at the new variable if vim is recent enough. 2015-09-10 09:18:48 -06:00
Spencer G. Jones
af4aaa1d17 fixup! To determine which completion prompted CompleteDone, look at the new variable if vim is recent enough. 2015-09-09 09:08:41 -06:00
Spencer G. Jones
9f134c4dd0 To determine which completion prompted CompleteDone, look at the new variable if vim is recent enough. 2015-09-09 08:27:15 -06:00
Strahinja Val Markovic
a2808ee3ff Updating to latest ycmd 2015-09-01 19:51:16 -07:00
Homu
886787ff17 Auto merge of #1662 - micbou:table-of-contents, r=Valloric
Update table of contents in README

Remove Project Management entry.
2015-09-02 11:18:12 +09:00
micbou
9fc26130ef Update table of contents in README
Remove Project Management entry.
2015-09-02 01:54:05 +02:00
Spencer G. Jones
9f568be39a fixup! Add CompleteDone hook, with namespace insertion for C# 2015-08-31 10:51:23 -06:00
Homu
f94b342989 Auto merge of #1659 - puremourning:cwd-filetype-completer, r=Valloric
Pass cwd to completer for filename completions

Required for https://github.com/Valloric/ycmd/pull/210. Please see that PR for functional and testing details.
2015-08-31 02:58:30 +09:00
Homu
042fea73f8 Auto merge of #1657 - micbou:travis-badge, r=Valloric
Use SVG Travis badge instead of PNG

Because badges need consideration (and it [still](https://github.com/Valloric/ycmd/pull/207) looks better).
2015-08-31 02:16:44 +09:00
Spencer G. Jones
dd27184970 Add CompleteDone hook, with namespace insertion for C#
Add a new vim hook on CompleteDone. This hook is called when a
completions is selected.

When forcing semantic completion with the keybind, C# completions can
return a list of importable types. These types are from namespaces which
havn't been imported, and thus are not valid to use without also adding
their namespace's import statement. This change makes YCM automatically
insert the necessary using statement to import that namespace on
completion completion. In the case there are multiple possible
namespaces, it prompts you to choose one.
2015-08-28 10:05:46 -06:00