Commit Graph

2177 Commits

Author SHA1 Message Date
Homu
f53b272801 Auto merge of #2118 - micbou:travis, r=Valloric
[READY] Fix and improve pyenv setup in Travis script

See PR Valloric/ycmd#459.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2118)
<!-- Reviewable:end -->
2016-04-16 17:34:55 +09:00
micbou
514fc71e35 Fix and improve pyenv setup in Travis script 2016-04-15 12:17:21 +02:00
Homu
f67033c990 Auto merge of #2106 - micbou:vimdiff, r=puremourning
[READY] Do not disable YCM when Vim is started in diff mode

Since we don't really know why YCM is disabled when Vim is started in diff mode (the [relevant commit](a6d5979b08) is 4 years old) and I couldn't find any issues with YCM enabled in this mode, I propose to revert this commit.

See issue #2104 and [relevant thread on ycm-users list](https://groups.google.com/forum/?hl=en#!topic/ycm-users/cdqPJH5QrBs).

Fixes issue #2104.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2106)
<!-- Reviewable:end -->
2016-04-10 11:40:09 +09:00
Homu
63b8198b11 Auto merge of #2097 - micbou:fix-post-complete-test, r=Valloric
[READY] Fix PostComplete test

A refactoring of PostComplete tests made the `GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_OldVim` test identical to
`GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_NewVim`. Revert to original test.

This PR also updates the tests with small changes. See the commit message.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2097)
<!-- Reviewable:end -->
2016-04-09 23:21:06 +09:00
micbou
e52d252d08 Revert "Don't run the plugin when in diff mode"
This reverts commit a6d5979b08.
2016-04-09 12:09:10 +02:00
Homu
63690467ea Auto merge of #2099 - micbou:clang-documentation, r=vheon
[READY] Update Clang version in documentation

Since PR Valloric/ycmd#353, Clang version must be at least 3.8.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2099)
<!-- Reviewable:end -->
2016-04-08 05:59:28 +09:00
micbou
4824b8fd4b Update Clang version in documentation 2016-04-07 11:16:01 +02:00
Homu
9f92f530d4 Auto merge of #2095 - micbou:typescript-refactor-rename-documentation, r=puremourning
[READY] Add TypeScript RefactorRename subcommand to documentation

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2095)
<!-- Reviewable:end -->
2016-04-07 10:39:01 +09:00
micbou
638550384e Update PostComplete tests
Move with-statement patch as decorator when possible.
Use single quote everywhere instead of double quote (for consistency).
Remove empty lines.
2016-04-07 00:42:43 +02:00
micbou
4b9e16f14d Fix PostComplete test
ReturnEmptyIfPendingMatches_OldVim test was identical to
ReturnEmptyIfPendingMatches_NewVim.
2016-04-07 00:42:43 +02:00
micbou
5a938ec82f Add TypeScript RefactorRename to documentation 2016-04-06 05:33:19 +02:00
Homu
41e4886489 Auto merge of #2093 - Valloric:ycmd-update, r=micbou
Updating to latest ycmd

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2093)
<!-- Reviewable:end -->
2016-04-06 12:30:21 +09:00
Val Markovic
d7cbd8d91b Updating to latest ycmd 2016-04-04 18:30:59 -07:00
Lifepillar
bf63188066 Support lazy loading with :packadd.
Vim recently has introduced a new feature called 'packages', which
permits, among the rest, to disable automatic loading a plugin at
startup. Plugins that are disabled at startup may be manually loaded
during a session using :packadd (see :h packages, :h :packadd). Of
course, a plugin that is loaded after startup cannot rely on VimEnter
events.

In order to support lazy loading YCM, check whether YCM is sourced
during startup or at a later time. In the former case, define an
autocommand as before; in the latter case, enable YCM immediately.
2016-03-26 21:30:24 +02:00
Homu
1b76af4386 Auto merge of #2083 - puremourning:readme-pyenv, r=vheon
Add how to build python to avoid startup problems (in particular, pyenv)

# 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

I spent a while trying to find where I had written the instructions for building python with pyenv to work with YCM, then I thought the README was a good place for it.

ycmd must use pythons with `--enable-shared` or `--enable-framework` else boom.

[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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2083)
<!-- Reviewable:end -->
2016-03-27 03:28:18 +09:00
Homu
0648068b37 Auto merge of #2054 - vheon:rename-python-interpreter-options, r=Valloric
[READY] Rename ycmd python option

# 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

[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

As requested in https://github.com/Valloric/YouCompleteMe/issues/2052#issuecomment-195631106 I'm sending this PR. I've marked it as WIP because I've renamed only the `ycmd` option and that is because keeping the backward compatibility here was straight forward since is a client only option. For the jedihttp option instead I would like some opinion on how to procede: should we keep the backward compatibility here on the client or should we make the backward compatibility layer on the ycmd side? Keeping it here would be easier but it would mean that other clients should implement this theirself. Thoughts?

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2054)
<!-- Reviewable:end -->
2016-03-27 03:16:07 +09:00
Andrea Cedraro
9e6645f515 Rename ycmd python option
- Rename ycm_path_to_python_interpreter to ycm_ycmd_python_interpreter
- Keep ycm_path_to_python_interpreter backward compatible
2016-03-26 19:15:08 +01:00
Ben Jackson
366b11c7be Add how to build python to avoid startup problems (in particular, pyenv) 2016-03-26 15:24:47 +00:00
Homu
429e04ab98 Auto merge of #2074 - micbou:windows-installation-update, r=puremourning
[READY] Update Windows installation in README

This PR updates the Windows documentation by mentioning both Python versions but recommending Python 3. It also changes the link to the 64-bit Vim by a link to [my own builds](https://bintray.com/micbou/generic/vim/view): they are updated more frequently, are available in both architectures, provide almost all Vim features, and are automatically tested before being released.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2074)
<!-- Reviewable:end -->
2016-03-24 07:58:44 +09:00
micbou
dbc2c08af9 Update Windows installation in README
Add instructions for Python 3 on Windows. Change link to Vim builds
for Windows. Always use a capital letter for Python.
2016-03-23 18:51:41 +01:00
Val Markovic
21a0019279 Merge pull request #2065 from micbou/completer-parameter-readme
[READY] Fix more confusing phrasing in README
2016-03-20 17:34:05 -07:00
micbou
c5cf60b7d3 Fix more confusing phrasing in README 2016-03-20 22:50:26 +01:00
Homu
f44435b88e Auto merge of #2037 - puremourning:fix-vim-eval-returning-py2-str, r=puremourning
[READY] Fix traceback when syntax files contain unicode characters

# 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.
- [ ] 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

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

I'm submitting this without tests for now because it's probably quite important, and adding tests is going to be quite time consuming because we somehow need to mock out the output of `:syntax list` with unicode chars, etc.

I have tested manually and got people experiencing the issue to also confirm that it fixes it.

I've also surveyed other uses of `vim.eval` that return string and wrapped them in a `ToUnicode` where there is a possibility of it not working. This is much more speculative, so feel free to say ditch this and just fix the issue at hand.

Also, of course feel free to say we can't merge this without tests, which is also valid :)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2037)
<!-- Reviewable:end -->
2016-03-11 06:29:56 +09:00
Ben Jackson
953885c449 Fix traceback when a syntax file has unicode characters
vim.eval returns a str() object on py2, but our internal strings are all unicode().
We use vimsupport.VimExpressionToPythonType to wrap the conversion complexities.
2016-03-10 21:28:42 +00:00
Homu
385dae5ad9 Auto merge of #2047 - liquiddandruff:patch-1, r=Valloric
Update tern_runtime directory in README

# 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.
- [ ] 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

Was following the guides and saw this referencing a wrong path so I decided to fix it with the proper one.

Should be useful sine this will keep the docs up-to-date!

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

https://reviewable.io/reviews/valloric/youcompleteme/2047
2016-03-11 03:45:30 +09:00
Steven Huang
1828f47870 Update tern_runtime directory in README 2016-03-10 12:52:26 +00:00
Homu
80c4dc58d3 Auto merge of #2043 - Valloric:docs-fix, r=puremourning
Fix confusing phrasing in README

Fixes #2042

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2043)
<!-- Reviewable:end -->
2016-03-10 18:43:48 +09:00
Val Markovic
e8fa6e2350 Fix confusing phrasing in README
Fixes #2042
2016-03-09 20:00:05 -08:00
Homu
49be4e6015 Auto merge of #2041 - micbou:server-check-on-file-ready-to-parse, r=vheon
[READY] Do not send request in OnFileReadyToParse function if server is down

Even if `ycmd` process is terminated, YCM will try to send the `event_notification` request in `OnFileReadyToParse` function, blocking Vim for one second if the server crashed at the start (because of [this request](https://github.com/Valloric/YouCompleteMe/blob/master/python/ycm/client/base_request.py#L222)) or resulting in a traceback with  `ConnectionError` exception otherwise. This will happen for the `InsertLeave`, `CursorMoved`, `CursorHold`, `BufferVisit` events, making Vim almost unusable.

This is fixed by returning early if the process is terminated.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2041)
<!-- Reviewable:end -->
2016-03-10 06:06:48 +09:00
micbou
d59dfb0a7e Do not send request if server is down
Do not send an "event_notification" request in OnFileReadyToParse
function if server process is terminated. Otherwise, it blocks Vim
for one second or results in a traceback each time the InsertLeave,
CursorMoved, CursorHold, and BufferVisit events are triggered.
2016-03-09 16:53:20 +01:00
Homu
381b213271 Auto merge of #2035 - micbou:faq-import-error, r=Valloric
[READY] Fix multiline title entry in FAQ

Apparently, it is not possible to write a header on multiple lines using the `#` syntax in markdown, so we write it on one line.

Update the vim docs too.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2035)
<!-- Reviewable:end -->
2016-03-08 02:57:14 +09:00
micbou
0f10951bdf Fix title entry in FAQ 2016-03-07 17:00:33 +01:00
Homu
9569bb4223 Auto merge of #2031 - puremourning:flake8, r=micbou
[READY] Update flake8 config

# 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

Python is a dynamic language and as a result shares the dynamic language mentality of "Fail Late". Admittedly, Python fails earlier than most dynamic languages, but in any case it is extremely useful to have static analysis and syntax checking tools available prior to runtime execution.

YCM uses flake8 for this as part of its test runs. However, due to code _style_ being more important to most of the checkers than code _quality_, we have not always taken full advantage (for example, syntax checking was disabled). This PR continues https://github.com/Valloric/ycmd/pull/416 and adds the same set of checks to YCM client.

This benefits developers because it speeds up the code/test cycle (using Syntactic now requires _no_ additional configuration for flake8 to be correct for YCM and ycmd), and benefits users, because we should produce better quality code :)

This PR also updates to the latest ycmd to include https://github.com/Valloric/ycmd/pull/416

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2031)
<!-- Reviewable:end -->
2016-03-07 06:17:16 +09:00
Ben Jackson
de583e7946 Update to latest ycmd 2016-03-06 17:40:00 +00:00
Ben Jackson
edd2bdbe0f Update flake8 config 2016-03-06 17:39:55 +00:00
Homu
285c452831 Auto merge of #2029 - micbou:timeout-exception, r=Valloric
[READY] Catch ReadTimeout exception on requests

In PR #2016, we have changed the way we are catching exceptions on requests by only catching the `ServerError` instead of all exceptions, which is great for debugging purposes. However, due to this change, we don't catch the exception from a timed out request, leading to a ugly traceback in Vim. This PR fixes that.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2029)
<!-- Reviewable:end -->
2016-03-06 07:05:36 +09:00
Homu
190adeade6 Auto merge of #2027 - puremourning:readme-all-install, r=micbou
[READY] Add --all option to README

# 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

I use the `--all` flag for every build. I know this is probably a flag that's more useful for YCM contributors than most users, but it makes sense to document it.

# No tests

It's only an update to the README, so I just tested it by eyeballing the output.

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2027)
<!-- Reviewable:end -->
2016-03-06 06:37:46 +09:00
micbou
f6d5f68d6b Catch ReadTimeout exception on requests 2016-03-05 22:34:45 +01:00
Ben Jackson
3b6b949bb3 Update README to include --all flag 2016-03-05 21:31:32 +00:00
Homu
d4f8c1d404 Auto merge of #2016 - Valloric:py3, r=micbou
[READY] Making YCM run in Vim with only python3

Since https://github.com/Valloric/ycmd/pull/358, ycmd has supported Python 3. Now's the time to make the YCM client work in Python 3 too. As with the ycmd PR, **until we merge this, no other code-changing PR should be merged.** We need to get to a state where we have green Travis for Python 3 before any other PRs start landing.

This was substantially easier than porting ycmd, but it was still a massive pain. It's likely to fail in certain corner cases, so please give this a spin!

The best way to test it out is to build a Vim that has only Python 3 support. Our wiki page on [building Vim from source](https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source) is a great start; you'll probably need to change `--enable-pythoninterp` to `--enable-python3interp` and similar for `--with-python-config-dir`. Or just get yourself a beta image of Ubuntu 16.04 LTS and run it in a VM (16.04 doesn't even ship Python 2 in the base image!). You can verify that you're running the right Vim by looking at the output of `vim --version`. It should have `-python` and `+python3`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2016)
<!-- Reviewable:end -->
2016-03-06 03:25:31 +09:00
Val Markovic
0bcecb14d8 Fixing conversion bug in VimExpressionToPythonType
Bug was that objects other than strings/bytes were being converted to
strings. Also added tests.
2016-03-05 10:16:08 -08:00
Val Markovic
7b9b5ac688 Updating readme with more python3 info
New entry in the FAQ for ImportError exceptions and the installation
sections now also recommend python3 dev headers.
2016-03-04 19:48:49 -08:00
Val Markovic
74f5e5ef34 Using non-emacs version of python coding line 2016-03-02 18:12:38 -08:00
Val Markovic
07b9e6a68d Update to latest ycmd 2016-03-02 18:09:59 -08:00
Val Markovic
80631b1aaf Enforcing unicode in more vimsupport functions 2016-03-01 19:30:02 -08:00
Val Markovic
0187c6df5b Fixing minor typos 2016-03-01 19:30:02 -08:00
Val Markovic
c91130f280 Not depending on exception internals
We used to read the `message` attribute; that breaks on py3. The
standard idiom is to just use `str( exception )` to get the message.
2016-03-01 19:30:02 -08:00
Val Markovic
0ed1096040 Support multiline exception message
Also stopped adding the "ycmd exception:" prefix to error messages
because it lies; some exceptions hitting this may not come from ycmd.
2016-03-01 19:29:21 -08:00
Val Markovic
94ec3ed902 Merge pull request #2020 from micbou/readme
[READY] Fix installation entries and links in README
2016-02-29 11:44:14 -08:00
micbou
ecdb97b71c Fix installation entries and links in README 2016-02-29 20:36:58 +01:00