Commit Graph

1962 Commits

Author SHA1 Message Date
Val Markovic
92346d2bcc Import order fixes for py3
The import machinery works differently in py3, so some massaging is in
order.
2016-02-28 14:39:55 -08:00
Val Markovic
1e72f4d421 Making it clearer an exception came from ycmd
Makes debugging easier when you know where the error lies.
2016-02-28 14:38:23 -08:00
Val Markovic
b04870c824 VimL support for py3 2016-02-28 13:54:49 -08:00
Val Markovic
1941d8bfb2 Fixing issues with bytes vs unicode for hmac 2016-02-27 17:38:38 -08:00
Val Markovic
4e82409cc1 Futurize pass + manual fixes 2016-02-27 16:12:44 -08:00
Homu
72b08862d3 Auto merge of #2011 - micbou:readme, r=micbou
[READY] Fix entries in table of contents

Rename entries of `YcmCompleter subcommands` section in table of contents so that they correspond to their sections title. Add `Miscellaneous commands` missing entry.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2011)
<!-- Reviewable:end -->
2016-02-28 05:28:47 +09:00
micbou
df8a52671d Fix table of contents
Make headings and TOC entries have the same text.
Use Title Case for TOC entries.
Add "Miscellaneous commands" and "Functions" entries.
Set "And That's not all..." heading in bold instead.
Move "Diagnostic highlighting groups" to a third-level entry.
2016-02-27 18:43:59 +01:00
Homu
cb8607796e Auto merge of #2004 - Valloric:new-omni, r=micbou
[READY] Updating to latest ycmd

This includes the using the new API for OmniCompleter.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2004)
<!-- Reviewable:end -->
2016-02-27 08:28:18 +09:00
Val Markovic
71c7a81e42 Updating to latest ycmd 2016-02-26 15:23:20 -08:00
Homu
27f391089c Auto merge of #2005 - micbou:new-omni-ycm-core-test, r=micbou
[READY] Add test to check if ycm_core is not imported

See PR #2004.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2005)
<!-- Reviewable:end -->
2016-02-26 05:18:01 +09:00
micbou
298c318bc7 Add test to check if ycm_core is not imported 2016-02-25 02:17:57 +01:00
Val Markovic
fd0c2cc1d8 Updating to latest ycmd
This includes the using the new API for OmniCompleter.
2016-02-24 17:10:13 -08:00
Homu
35f6090b76 Auto merge of #1994 - micbou:set-up-python, r=vheon
[READY] Rewrite SetUpPython function

This PR fixes issue #1726 by moving most of SetUpPython logic to its own module and using a try-catch-else block at the end of the function. It also prevents Python backtraces in Vim (which are really annoying) for common exceptions (`RuntimeError` and `ImportError`).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1994)
<!-- Reviewable:end -->
2016-02-25 06:12:17 +09:00
micbou
3cf6fa86f5 Rewrite SetUpPython function
Do not create YouCompleteMe object if setup failed. Use a try/except
block to prevent backtraces in Vim.
2016-02-24 17:56:31 +01:00
Homu
e2452b6594 Auto merge of #1995 - Valloric:ycmd-update, r=vheon
[READY] Updating to latest ycmd

Still using ycmd only in py2, but at least we can use YCM with ycmd master again.

@micbou @puremourning @vheon Try to give this one a whirl on your machines since ycmd had a ton of recent changes.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1995)
<!-- Reviewable:end -->
2016-02-24 07:47:16 +09:00
Val Markovic
f986bf19db Updating to latest ycmd 2016-02-22 09:50:15 -08:00
Homu
be0de73c42 Auto merge of #1917 - puremourning:fixit-multiple-files-upstream, r=Valloric
[READY] Support FixIt and Refactor commands across multiple files

## Apply FixIt chunks across files

Previously, FixIts could only apply to the current buffer. Now we can apply FixIts across files, even if they are not currently open in the user's Vim. We obey existing configuration about how/where to open new files and apply changes in such a way as to not scribble the user's filesystem, and allow full undo history, like existing FixIt commands. Vim's python API actually makes this really quite easy.

To achieve this, we sort the chunks by filename, apply the existing logic unchanged. The only difference is that `ReplaceChunk` no longer implicitly assumes it applies to `vim.current.buffer`.

## Recognise 'FixIt' responses for any subcommand

Previously, we used the subcommand name to determine the type of response to expect. This coupled the client and the server and didn't allow us to apply FixIts for a "Refactor" command, or "GoTo" for a, theoretical "Find" command.

Now 'GoTo' and 'FixIt' commands don't need to start with those prefixes. For 'FixIt' we can detect the response type by looking for the 'fixits' entry in the response.

## Other changes

The `vimsupport.OpenFilename` method needed to handle the presence of Vim swap files and the various user responses. This pushed the cyclomatic complexity over the threshold, so the code was partially obfuscated to accommodate the cyclomatic complexity gods.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1917)
<!-- Reviewable:end -->
2016-02-22 07:18:00 +09:00
Val Markovic
6e0e128d4b Merge pull request #2003 from Valloric/templates
[READY] Templates for new issues and PRs
2016-02-21 14:05:34 -08:00
Ben Jackson
e8de632b90 Add docs for RefactorRename
Additionally, we restructure subcommands section to organise by
command type.

There are now a significant number of subcommands offering quite
powerful features. A flat-list of such commands is not easy for users to
discover (citation needed). Restructured into:
 - GoTo commands
 - Documenation/type information commands
 - FixIt/refactor commands

This has the following benefits:
 - features are more discoverable to the user (due to contents page
   update)
 - more obvious where to add new subcommand documentation
 - a place to write notes which apply to multiple commands (such as
   jump lists, multi-file refactor)
2016-02-21 22:02:33 +00:00
Ben Jackson
24f1f9c900 Support FixIt commands across buffers
We simply apply the changes to each file in turn. The existing replacement
logic is unchanged, except that it now no longer implicitly assumes we are
talking about the current buffer.

If a buffer is not visible for the requested file name, we open it in
a horizontal split, make the edits, then hide the window. Because this
can cause UI flickering, and leave hidden, modified buffers around, we
issue a warning to the user stating the number of files for which we are
going to do this. We pop up the quickfix list at the end of applying
the edits to allow the user to see what we changed.

If the user opts to abort due to, say, the file being open in another
window, we simply raise an error and give up, as undoing the changes
is too complex to do programatically, but trivial to do manually in such
a rare case.
2016-02-21 22:02:33 +00:00
Ben Jackson
d9fef6be14 Remove knowlegde from YCM about subcommand names
Now 'GoTo' and 'FixIt' commands don't need to start with those
prefixes. For 'FixIt' we can detect the response type by looking for
the 'fixits' entry in the response.

For 'GoTo' this is a touch harder, as there is no completely obvious
way to tell. However it is unique in this respect, so we can simply
fall back to it.

Completers returning other types of response are not supported by
this client.
2016-02-21 22:02:33 +00:00
Val Markovic
f8512e7007 Templates for new issues and PRs 2016-02-21 13:43:33 -08:00
Homu
7b8b1acb5e Auto merge of #1905 - davits:easy_handler, r=Valloric
[READY] Simplify parse request handling

Moved file parse request handling into python, trying to simplify the overall flow, and allow easier additions of additional post handlers such as semantic token extraction.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1905)
<!-- Reviewable:end -->
2016-02-22 03:56:58 +09:00
Davit Samvelyan
4d97437872 Moved parse request and diagnostics handling to python.
Moved File parse request handling and diagnostic extraction flow into
python to simplify flow and allow easier addition of new parse request
handlers such as semantic highlighter.
Refactored base_test to patch separate vimsupport functions instead of
the whole module, and interfering the test results afterwards.
Added new tests for diagnostic sign place/unplace and error/warning
count extraction API.
2016-02-21 14:47:54 +04:00
Homu
8ad4044203 Auto merge of #1990 - micbou:readme-ycmd-link, r=vheon
[READY] Add links to ycmd repository in README

Found this while reading the documentation. There is no `ycmd` reference so it is displayed as `[ycmd][]`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1990)
<!-- Reviewable:end -->
2016-02-18 06:57:03 +09:00
micbou
60b101f3ba Add reference to ycmd in README 2016-02-17 20:15:36 +01:00
Homu
d9c7eebe85 Auto merge of #1988 - mispencer:RemoveOldC#Document, r=micbou
Remove C# Diagnostic Support documentation note

This hasn't been true since [ycmd pull request #44](https://github.com/Valloric/ycmd/pull/44).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1988)
<!-- Reviewable:end -->
2016-02-17 17:57:04 +09:00
Spencer G. Jones
308cf4b653 Remove C# Diagnostic Support documentation note
This hasn't been true since ycmd pull request #44.
2016-02-16 19:27:26 -07:00
Homu
3e748deaec Auto merge of #1965 - micbou:go-documentation, r=puremourning
[READY] Update Go documentation with GoTo subcommands

This also updates to latest ycmd. Changes that affect the client:
 - update racerd;
 - add GoTo support for Go completer;
 - add concurrent requests for Typescript completer;
 - fix issue #1953;
 - add GoToReferences support for Typescript completer.

I changed the filetypes lists to be in alphabetical order, except the C-family languages.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1965)
<!-- Reviewable:end -->
2016-02-08 07:46:04 +09:00
micbou
716d0c974f Update Go documentation 2016-02-07 20:28:41 +01:00
micbou
d534afbe23 Update to latest ycmd
List of changes:
 - update racerd;
 - add GoTo support for Go completer;
 - add concurrent requests for Typescript completer;
 - fix issue #1953;
 - add GoToReferences support for Typescript completer.
2016-02-07 20:27:08 +01:00
Homu
b8ec993c0a Auto merge of #1964 - icholy:master, r=micbou
Update readme with typescript GoToReferences subcommand

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1964)
<!-- Reviewable:end -->
2016-02-08 03:59:00 +09:00
Ilia Choly
ef47aba62a Update vimdoc 2016-02-06 16:24:47 -05:00
Ilia Choly
66155c3de2 Update readme with typescript GoToReferences subcommand 2016-02-06 14:41:03 -05:00
Homu
a2f0ec1624 Auto merge of #1962 - micbou:python-env, r=Valloric
[READY] Remove interpreter line from Python sources

See PR Valloric/ycmd#346.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1962)
<!-- Reviewable:end -->
2016-02-06 02:15:57 +09:00
micbou
4835b49a89 Remove interpreter line from Python sources 2016-02-05 16:24:03 +01:00
Homu
674db42eef Auto merge of #1954 - micbou:documentation-make-confusion, r=vheon
[READY] Avoid confusion with make command

This sentence may be interpreted as executing the `make` command to move the libaries. See issue #1951. We *make* it clear by using `cmake` instead.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1954)
<!-- Reviewable:end -->
2016-02-04 02:48:45 +09:00
micbou
2cd3d1b9d3 Avoid confusion with make command 2016-02-03 17:51:35 +01:00
Homu
8ee365356f Auto merge of #1928 - vheon:custom-python-jedi, r=puremourning
[READY] Update documentation of latest python completer

I've just wrote down the first things that came to mind. So any feedback on which part to expand or fix is appreciated. Specifically I don't know if would be useful to the user to know that JediHTTP exists and what it does. I fear that explaining would do more harm than good 😕

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1928)
<!-- Reviewable:end -->
2016-02-03 08:20:50 +09:00
Andrea Cedraro
581f58add6 Update documentation of latest python completer 2016-02-03 00:12:00 +01:00
Homu
e66d1f1ddd Auto merge of #1922 - Chiel92:patch-1, r=micbou
Add notes to readme according to #1891.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1922)
<!-- Reviewable:end -->
2016-01-31 10:28:11 +09:00
Chiel ten Brinke
833d30eda8 Update vim docs. 2016-01-29 10:40:34 +01:00
Chiel ten Brinke
40db3c0865 Merge https://github.com/Valloric/YouCompleteMe into patch-1 2016-01-29 09:53:01 +01:00
Chiel ten Brinke
d6ebef3c8d Address review comments. 2016-01-29 09:48:24 +01:00
Strahinja Val Markovic
5ee7bd2c80 Updating TOC in README 2016-01-26 15:54:44 -08:00
Strahinja Val Markovic
0efa668931 Adding an explicit Contributor Code of Conduct
Everything in the CoC was true since the beginning of the project, it
was just implicit and not written down. Now we're making it explicit.
2016-01-26 15:49:58 -08:00
Chiel ten Brinke
4afcbee4a1 Adress minor improvement suggestions. 2016-01-25 10:47:59 +01:00
Chiel ten Brinke
8ebcdb491a Improve the solution for error R6034. 2016-01-25 10:37:08 +01:00
Homu
1201115141 Auto merge of #1927 - micbou:event-notification-test, r=Valloric
[READY] Fix issue in EventNotification tests

While I was reviewing PR #1905, I found an issue with the `EventNotification` tests. It's easy to reproduce. You just need to comment [this line in `python/ycm/youcompleteme.py`](https://github.com/Valloric/YouCompleteMe/blob/master/python/ycm/youcompleteme.py#L508) and run the tests. With this change, the `EventNotification` tests should fail since the second call of `ValidateParseRequest` re-raises the warning. However, tests are still passing because `assert_has_calls` does not check if a call was not made. For example, if `functionA` is called twice, both `assert_has_calls( [ functionA ] )` and `assert_has_calls( [ functionA, functionA ] )` are successful.

To fix this, we just need to check the number of calls using `call_count`. This is done by creating a subclass of `MagicMock` implementing the `assert_has_exact_calls` method and using it in tests.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1927)
<!-- Reviewable:end -->
2016-01-25 08:26:15 +09:00
Homu
8d5f164feb Auto merge of #1896 - micbou:path-to-python-interpreter, r=Valloric
[READY] Implement new strategy to find the Python interpreter path

See discussion in issue #1891 for details.

Implement a new strategy to find the Python interpreter path:
  - if specified, use `g:ycm_path_to_python_interpreter` option.
  - on UNIX platforms, use `sys.executable` as the path to Python interpreter;
  - on Windows, deduce it from `os.__file__` path (it should always be in the parent folder).

In all cases, check the version (2.6 or 2.7) of the Python interpreter path by running it.

This PR may break things. It needs thorough testing.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/1896)
<!-- Reviewable:end -->
2016-01-25 08:24:34 +09:00