Commit Graph

32 Commits

Author SHA1 Message Date
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
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
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
micbou
3109c9d8a4
Add tests for current directory 2016-10-18 02:22:28 +02:00
micbou
fa10f33c2a
Move test_utils to tests folder
This remove the file from coverage.
2016-10-15 04:03:48 +02:00
micbou
92f1bbda94
Add event notification tests
Add tests for the BufferVisit and BufferUnload event notifications.
2016-10-10 16:27:29 +02:00
micbou
2fabac5a67
Fix BufferUnload event notification
Send the request as the unloaded buffer instead of the current buffer
for the BufferUnload event notification. This fixes the issue where
the filetype of the current buffer is not the same as the unloaded
buffer one, making the ycmd server uses the wrong completer when
handling the request.
2016-10-08 16:43:50 +02:00
Justin Lebar
a33f20d690 Update ycmd, and use JoinLinesAsUnicode in GetUnsavedAndCurrentBufferData().
This function is invoked on every kepress.  On a large file (15+k loc),
using this new function takes kepress latency down to <10ms from ~100ms.
2016-10-07 18:27:09 -07:00
micbou
391757eec2 Avoid hit-enter prompts during completions
When an error occurs during completions, a message is displayed on
the status line. If this message is longer than the width of the
current window, Vim will prompt the user to press enter or type a
command to hide the message, interrupting user workflow. We prevent
that by truncating the message to window width.
Merge PostMultiLineNotice, EchoText, and EchoTextVimWidth functions
into PostVimMessage.
2016-08-28 09:19:07 +02:00
micbou
ef49f3e052 Fix diagnostic highlighting at line ending
When columns are clamped to not be past the contents of the line for
highlighting diagnostics, we need to account for the column end not
being included in the diagnostic range.
2016-08-18 21:21:10 +02:00
micbou
a986b3ed0e Update ReplaceChunk tests
Do not convert strings to bytes but instead use plain strings to mimic
Vim buffers returning a list of byte objects on Python 2 and unicode
objects on Python 3.
2016-07-14 00:46:30 +02:00
Ben Jackson
cfd4bbd531 Support selecting from the list of FixIts when multiple are supplied 2016-07-11 21:52:41 +01:00
micbou
805911b56b Use SetQuickFixList for GoTo* subcommands
Open the quickfix window to full width at the bottom of the screen with
its height set to fit all entries. This behavior can be overridden by
using the YcmQuickFixOpened autocommand.
Add a new section for autocommands in the documentation.
Update GoTo and ReplaceChunks tests.
2016-06-13 00:25:12 +02:00
Ben Jackson
4d7b386a37 Fix a number of multi-byte errors and tracebacks
- Correct FixIts when there are unicode characters
- Fix errors in CompleteDone handler
- Fix tracebacks when omnifunc returns unicode chars
2016-05-08 15:32:36 +01: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
74f5e5ef34 Using non-emacs version of python coding line 2016-03-02 18:12:38 -08:00
micbou
f981370965 Fix CheckFilename test on Windows and Py2
On Windows and Python 2, the full exception message from IOError
in CheckFilename will contain the filepath formatted as a unicode
string. Since the filepath is already added in the RuntimeError
message, use the strerror attribute to only display the error.
2016-02-29 20:06:01 +01:00
Val Markovic
43b2dd44f2 Ensuring vimsupport only returns unicode text
Python 3 is much stricter around mixing bytes with unicode (and by
"stricter," I mean it doesn't allow it at all) so we're making
vimsupport only return `unicode` objects (`str` on py3). The idea is
that YCM (and ycmd) internals only ever deal with unicode.
2016-02-28 19:23:40 -08:00
Val Markovic
4e82409cc1 Futurize pass + manual fixes 2016-02-27 16:12:44 -08: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
micbou
4835b49a89 Remove interpreter line from Python sources 2016-02-05 16:24:03 +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
f23cbae2a8 Add tests for Vim file and buffer operations
Refactor Vim mocking.
2015-11-08 18:43:52 +01: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
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
Ben Jackson
98c4d712b4 YouCompleteMe client support for FixIt subcommands 2015-08-05 22:09:07 +01:00