diff --git a/README.md b/README.md index b0a9b563..8ba1a65e 100644 --- a/README.md +++ b/README.md @@ -376,8 +376,7 @@ _Windows x86-64_ for a 64-bit Vim. We recommend installing Python 3. - [CMake][cmake-download]. Add CMake executable to the PATH environment variable. - [Visual Studio][visual-studio-download]. Download the community edition. -During setup, choose _Custom_ as the installation type and select the _Visual -C++_ component. +During setup, select _Desktop development with C++_ in _Workloads_. - [7-zip][7z-download]. Required to build YCM with semantic support for C-family languages. @@ -412,8 +411,8 @@ install with all language features, ensure `msbuild`, `go`, `tsserver`, `node`, python install.py --all You can specify the Microsoft Visual C++ (MSVC) version using the `--msvc` -option. YCM officially supports MSVC 11 (Visual Studio 2012), 12 (2013), and 14 -(2015). +option. YCM officially supports MSVC 12 (Visual Studio 2013), 14 (2015), and 15 +(2017). That's it. You're done. Refer to the _User Guide_ section on how to use YCM. Don't forget that if you want the C-family semantic completion engine to work, @@ -573,7 +572,7 @@ process. Python 3][python-win-download]. Pick the version corresponding to your Vim architecture. You will also need Microsoft Visual C++ (MSVC) to build YCM. You can obtain it by installing [Visual Studio][visual-studio-download]. - MSVC 11 (Visual Studio 2012), 12 (2013), and 14 (2015) are officially + MSVC 12 (Visual Studio 2013), 14 (2015), and 15 (2017) are officially supported. Here we'll assume you installed YCM with Vundle. That means that the @@ -730,6 +729,7 @@ Quick Feature Summary ### TypeScript * Semantic auto-completion +* Real-time diagnostic display * Renaming symbols (`RefactorRename `) * Go to definition, find references (`GoToDefinition`, `GoToReferences`) * Semantic type information for identifiers (`GetType`) @@ -1132,9 +1132,10 @@ Completer API. ### Diagnostic Display YCM will display diagnostic notifications for C-family and C# languages if you -compiled YCM with Clang and Omnisharp support, respectively. Since YCM continuously -recompiles your file as you type, you'll get notified of errors and warnings -in your file as fast as possible. +compiled YCM with Clang and Omnisharp support, respectively. Diagnostics will +also be displayed for TypeScript. Since YCM continuously recompiles your file as +you type, you'll get notified of errors and warnings in your file as fast as +possible. Here are the various pieces of the diagnostic UI: @@ -2563,11 +2564,6 @@ But fear not, you should be able to tweak your extra conf files to continue working by using the `g:ycm_extra_conf_vim_data` option. See the docs on that option for details. -### On very rare occasions Vim crashes when I tab through the completion menu - -That's a very rare Vim bug most users never encounter. It's fixed in Vim -7.4.72. Update to that version (or above) to resolve the issue. - ### I get `ImportError` exceptions that mention `PyInit_ycm_core` or `initycm_core` These errors are caused by building the YCM native libraries for Python 2 and @@ -3092,7 +3088,7 @@ This software is licensed under the [GPL v3 license][gpl]. [TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server [vim-win-download]: https://bintray.com/micbou/generic/vim [python-win-download]: https://www.python.org/downloads/windows/ -[visual-studio-download]: https://www.visualstudio.com/products/free-developer-offers-vs.aspx +[visual-studio-download]: https://www.visualstudio.com/downloads/ [7z-download]: http://www.7-zip.org/download.html [mono-install-osx]: http://www.mono-project.com/docs/getting-started/install/mac/ [mono-install-ubuntu]: http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives diff --git a/appveyor.yml b/appveyor.yml index b03d8ad6..f14072c4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ version: '{build}' +image: Visual Studio 2017 environment: COVERAGE: true matrix: diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 7ef59436..733162fb 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -90,8 +90,7 @@ function! youcompleteme#Enable() " We also need to trigger buf init code on the FileType event because when " the user does :enew and then :set ft=something, we need to run buf init " code again. - autocmd BufRead,FileType * call s:OnBufferRead() - autocmd BufEnter * call s:OnBufferEnter() + autocmd BufRead,BufEnter,FileType * call s:OnBufferVisit() autocmd BufUnload * call s:OnBufferUnload() autocmd CursorHold,CursorHoldI * call s:OnCursorHold() autocmd InsertLeave * call s:OnInsertLeave() @@ -101,11 +100,9 @@ function! youcompleteme#Enable() augroup END " BufRead/FileType events are not triggered for the first loaded file. - " However, we don't directly call the s:OnBufferRead function because it would - " send requests that can't succeed as the server is not ready yet and would - " slow down startup. - call s:DisableOnLargeFile( expand( '%' ) ) - + " However, we don't directly call the s:OnBufferVisit function because it + " would send requests that can't succeed as the server is not ready yet and + " would slow down startup. if s:AllowedToCompleteInCurrentBuffer() call s:SetCompleteFunc() endif @@ -313,6 +310,23 @@ function! s:TurnOffSyntasticForCFamily() endfunction +function! s:DisableOnLargeFile( buffer ) + if exists( 'b:ycm_largefile' ) + return b:ycm_largefile + endif + + let threshold = g:ycm_disable_for_files_larger_than_kb * 1024 + let b:ycm_largefile = + \ threshold > 0 && getfsize( expand( a:buffer ) ) > threshold + if b:ycm_largefile + exec s:python_command "vimsupport.PostVimMessage(" . + \ "'YouCompleteMe is disabled in this buffer; " . + \ "the file exceeded the max size (see YCM options).' )" + endif + return b:ycm_largefile +endfunction + + function! s:AllowedToCompleteInBuffer( buffer ) let buffer_filetype = getbufvar( a:buffer, '&filetype' ) @@ -322,7 +336,7 @@ function! s:AllowedToCompleteInBuffer( buffer ) return 0 endif - if exists( 'b:ycm_largefile' ) + if s:DisableOnLargeFile( a:buffer ) return 0 endif @@ -401,22 +415,6 @@ function! s:SetUpYcmChangedTick() endfunction -function! s:DisableOnLargeFile( filename ) - if exists( 'b:ycm_largefile' ) - return - endif - - let threshold = g:ycm_disable_for_files_larger_than_kb * 1024 - - if threshold > 0 && getfsize( a:filename ) > threshold - exec s:python_command "vimsupport.PostVimMessage(" . - \ "'YouCompleteMe is disabled in this buffer; " . - \ "the file exceeded the max size (see YCM options).' )" - let b:ycm_largefile = 1 - endif -endfunction - - function! s:OnVimLeave() exec s:python_command "ycm_state.OnVimLeave()" endfunction @@ -427,15 +425,13 @@ function! s:OnCompleteDone() endfunction -function! s:OnBufferRead() +function! s:OnBufferVisit() " We need to do this even when we are not allowed to complete in the current " buffer because we might be allowed to complete in the future! The canonical " example is creating a new buffer with :enew and then setting a filetype. call s:SetUpYcmChangedTick() - call s:DisableOnLargeFile( expand( ':p' ) ) - - if !s:AllowedToCompleteInCurrentBuffer() + if !s:VisitedBufferRequiresReparse() return endif @@ -448,16 +444,6 @@ function! s:OnBufferRead() endfunction -function! s:OnBufferEnter() - if !s:VisitedBufferRequiresReparse() - return - endif - - exec s:python_command "ycm_state.OnBufferVisit()" - call s:OnFileReadyToParse() -endfunction - - function! s:OnBufferUnload() " Expanding returns the unloaded buffer number as a string but we want " it as a true number for the getbufvar function. diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index 9d7ae400..1d6b41a3 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -130,44 +130,43 @@ Contents ~ 47. The |g:ycm_python_binary_path| option 11. FAQ |youcompleteme-faq| 1. I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't |youcompleteme-i-used-to-be-able-to-import-vim-in-.ycm_extra_conf.py-but-now-cant| - 2. On very rare occasions Vim crashes when I tab through the completion menu |youcompleteme-on-very-rare-occasions-vim-crashes-when-i-tab-through-completion-menu| - 3. I get 'ImportError' exceptions that mention 'PyInit_ycm_core' or 'initycm_core' |youcompleteme-i-get-importerror-exceptions-that-mention-pyinit_ycm_core-or-initycm_core| - 4. I get a linker warning regarding 'libpython' on Mac when compiling YCM |youcompleteme-i-get-linker-warning-regarding-libpython-on-mac-when-compiling-ycm| - 5. I get a weird window at the top of my file when I use the semantic engine |youcompleteme-i-get-weird-window-at-top-of-my-file-when-i-use-semantic-engine| - 6. It appears that YCM is not working |youcompleteme-it-appears-that-ycm-is-not-working| - 7. Sometimes it takes much longer to get semantic completions than normal |youcompleteme-sometimes-it-takes-much-longer-to-get-semantic-completions-than-normal| - 8. YCM auto-inserts completion strings I don't want! |youcompleteme-ycm-auto-inserts-completion-strings-i-dont-want| - 9. I get a 'E227: mapping already exists for ' error when I start Vim |youcompleteme-i-get-e227-mapping-already-exists-for-blah-error-when-i-start-vim| - 10. I get "'GLIBC_2.XX' not found (required by libclang.so)" when starting Vim |youcompleteme-i-get-glibc_2.xx-not-found-when-starting-vim| - 11. I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults |youcompleteme-im-trying-to-use-homebrew-vim-with-ycm-im-getting-segfaults| - 12. I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting |youcompleteme-i-have-homebrew-python-and-or-macvim-cant-compile-sigabrt-when-starting| - 13. I get 'LONG_BIT definition appears wrong for platform' when compiling |youcompleteme-i-get-long_bit-definition-appears-wrong-for-platform-when-compiling| - 14. I get 'libpython2.7.a [...] relocation R_X86_64_32' when compiling |youcompleteme-i-get-libpython2.7.a-...-relocation-r_x86_64_32-when-compiling| - 15. I get 'Vim: Caught deadly signal SEGV' on Vim startup |youcompleteme-i-get-vim-caught-deadly-signal-segv-on-vim-startup| - 16. I get 'Fatal Python error: PyThreadState_Get: no current thread' on startup |youcompleteme-i-get-fatal-python-error-pythreadstate_get-no-current-thread-on-startup| - 17. 'install.py' says python must be compiled with '--enable-framework'. Wat? |youcompleteme-install.py-says-python-must-be-compiled-with-enable-framework-.-wat| - 18. YCM does not read identifiers from my tags files |youcompleteme-ycm-does-not-read-identifiers-from-my-tags-files| - 19. 'CTRL-U' in insert mode does not work |youcompleteme-ctrl-u-in-insert-mode-does-not-work| - 20. YCM conflicts with UltiSnips TAB key usage |youcompleteme-ycm-conflicts-with-ultisnips-tab-key-usage| - 21. Snippets added with ':UltiSnipsAddFiletypes' do not appear in the popup menu |youcompleteme-snippets-added-with-ultisnipsaddfiletypes-do-not-appear-in-popup-menu| - 22. Why isn't YCM just written in plain VimScript, FFS? |youcompleteme-why-isnt-ycm-just-written-in-plain-vimscript-ffs| - 23. Why does YCM demand such a recent version of Vim? |youcompleteme-why-does-ycm-demand-such-recent-version-of-vim| - 24. I get annoying messages in Vim's status area when I type |youcompleteme-i-get-annoying-messages-in-vims-status-area-when-i-type| - 25. Nasty bugs happen if I have the 'vim-autoclose' plugin installed |youcompleteme-nasty-bugs-happen-if-i-have-vim-autoclose-plugin-installed| - 26. Is there some sort of YCM mailing list? I have questions |youcompleteme-is-there-sort-of-ycm-mailing-list-i-have-questions| - 27. I get an internal compiler error when installing |youcompleteme-i-get-an-internal-compiler-error-when-installing| - 28. I get weird errors when I press 'Ctrl-C' in Vim |youcompleteme-i-get-weird-errors-when-i-press-ctrl-c-in-vim| - 29. Why did YCM stop using Syntastic for diagnostics display? |youcompleteme-why-did-ycm-stop-using-syntastic-for-diagnostics-display| - 30. Completion doesn't work with the C++ standard library headers |youcompleteme-completion-doesnt-work-with-c-standard-library-headers| - 31. When I open a JavaScript file, I get an annoying warning about '.tern-project' + 2. I get 'ImportError' exceptions that mention 'PyInit_ycm_core' or 'initycm_core' |youcompleteme-i-get-importerror-exceptions-that-mention-pyinit_ycm_core-or-initycm_core| + 3. I get a linker warning regarding 'libpython' on Mac when compiling YCM |youcompleteme-i-get-linker-warning-regarding-libpython-on-mac-when-compiling-ycm| + 4. I get a weird window at the top of my file when I use the semantic engine |youcompleteme-i-get-weird-window-at-top-of-my-file-when-i-use-semantic-engine| + 5. It appears that YCM is not working |youcompleteme-it-appears-that-ycm-is-not-working| + 6. Sometimes it takes much longer to get semantic completions than normal |youcompleteme-sometimes-it-takes-much-longer-to-get-semantic-completions-than-normal| + 7. YCM auto-inserts completion strings I don't want! |youcompleteme-ycm-auto-inserts-completion-strings-i-dont-want| + 8. I get a 'E227: mapping already exists for ' error when I start Vim |youcompleteme-i-get-e227-mapping-already-exists-for-blah-error-when-i-start-vim| + 9. I get "'GLIBC_2.XX' not found (required by libclang.so)" when starting Vim |youcompleteme-i-get-glibc_2.xx-not-found-when-starting-vim| + 10. I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults |youcompleteme-im-trying-to-use-homebrew-vim-with-ycm-im-getting-segfaults| + 11. I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting |youcompleteme-i-have-homebrew-python-and-or-macvim-cant-compile-sigabrt-when-starting| + 12. I get 'LONG_BIT definition appears wrong for platform' when compiling |youcompleteme-i-get-long_bit-definition-appears-wrong-for-platform-when-compiling| + 13. I get 'libpython2.7.a [...] relocation R_X86_64_32' when compiling |youcompleteme-i-get-libpython2.7.a-...-relocation-r_x86_64_32-when-compiling| + 14. I get 'Vim: Caught deadly signal SEGV' on Vim startup |youcompleteme-i-get-vim-caught-deadly-signal-segv-on-vim-startup| + 15. I get 'Fatal Python error: PyThreadState_Get: no current thread' on startup |youcompleteme-i-get-fatal-python-error-pythreadstate_get-no-current-thread-on-startup| + 16. 'install.py' says python must be compiled with '--enable-framework'. Wat? |youcompleteme-install.py-says-python-must-be-compiled-with-enable-framework-.-wat| + 17. YCM does not read identifiers from my tags files |youcompleteme-ycm-does-not-read-identifiers-from-my-tags-files| + 18. 'CTRL-U' in insert mode does not work |youcompleteme-ctrl-u-in-insert-mode-does-not-work| + 19. YCM conflicts with UltiSnips TAB key usage |youcompleteme-ycm-conflicts-with-ultisnips-tab-key-usage| + 20. Snippets added with ':UltiSnipsAddFiletypes' do not appear in the popup menu |youcompleteme-snippets-added-with-ultisnipsaddfiletypes-do-not-appear-in-popup-menu| + 21. Why isn't YCM just written in plain VimScript, FFS? |youcompleteme-why-isnt-ycm-just-written-in-plain-vimscript-ffs| + 22. Why does YCM demand such a recent version of Vim? |youcompleteme-why-does-ycm-demand-such-recent-version-of-vim| + 23. I get annoying messages in Vim's status area when I type |youcompleteme-i-get-annoying-messages-in-vims-status-area-when-i-type| + 24. Nasty bugs happen if I have the 'vim-autoclose' plugin installed |youcompleteme-nasty-bugs-happen-if-i-have-vim-autoclose-plugin-installed| + 25. Is there some sort of YCM mailing list? I have questions |youcompleteme-is-there-sort-of-ycm-mailing-list-i-have-questions| + 26. I get an internal compiler error when installing |youcompleteme-i-get-an-internal-compiler-error-when-installing| + 27. I get weird errors when I press 'Ctrl-C' in Vim |youcompleteme-i-get-weird-errors-when-i-press-ctrl-c-in-vim| + 28. Why did YCM stop using Syntastic for diagnostics display? |youcompleteme-why-did-ycm-stop-using-syntastic-for-diagnostics-display| + 29. Completion doesn't work with the C++ standard library headers |youcompleteme-completion-doesnt-work-with-c-standard-library-headers| + 30. When I open a JavaScript file, I get an annoying warning about '.tern-project' file |youcompleteme-when-i-open-javascript-file-i-get-an-annoying-warning-about-.tern-project-file| - 32. When I start vim I get a runtime error saying 'R6034 An application has made an + 31. When I start vim I get a runtime error saying 'R6034 An application has made an attempt to load the C runtime library incorrectly.' |youcompleteme-when-i-start-vim-i-get-runtime-error-saying-r6034-an-application-has-made-an-attempt-to-load-c-runtime-library-incorrectly.| - 33. I hear that YCM only supports Python 2, is that true? |youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true| - 34. On Windows I get "E887: Sorry, this command is disabled, the Python's site + 32. I hear that YCM only supports Python 2, is that true? |youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true| + 33. On Windows I get "E887: Sorry, this command is disabled, the Python's site module could not be loaded" |youcompleteme-on-windows-i-get-e887-sorry-this-command-is-disabled-pythons-site-module-could-not-be-loaded| - 35. I can't complete python packages in a virtual environment. |youcompleteme-i-cant-complete-python-packages-in-virtual-environment.| - 36. I want to defer loading of YouCompleteMe until after Vim finishes booting |i-want-to-defer-loading-of-youcompleteme-until-after-vim-finishes-booting| + 34. I can't complete python packages in a virtual environment. |youcompleteme-i-cant-complete-python-packages-in-virtual-environment.| + 35. I want to defer loading of YouCompleteMe until after Vim finishes booting |i-want-to-defer-loading-of-youcompleteme-until-after-vim-finishes-booting| 12. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct| 13. Contact |youcompleteme-contact| 14. License |youcompleteme-license| @@ -424,12 +423,14 @@ Install YouCompleteMe with Vundle [23]. using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process. -Install development tools and CMake: 'sudo apt-get install build-essential -cmake' - -Make sure you have Python headers installed: 'sudo apt-get install python-dev -python3-dev'. - +Install development tools and CMake: +> + sudo apt-get install build-essential cmake +< +Make sure you have Python headers installed: +> + sudo apt-get install python-dev python3-dev +< Compiling YCM **with** semantic support for C-family languages: > cd ~/.vim/bundle/YouCompleteMe @@ -493,12 +494,14 @@ Install YouCompleteMe with Vundle [23]. using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process. -Install development tools and CMake: 'sudo dnf install automake gcc gcc-c++ -kernel-devel cmake' - -Make sure you have Python headers installed: 'sudo dnf install python-devel -python3-devel'. - +Install development tools and CMake: +> + sudo dnf install automake gcc gcc-c++ kernel-devel cmake +< +Make sure you have Python headers installed: +> + sudo dnf install python-devel python3-devel +< Compiling YCM **with** semantic support for C-family languages: > cd ~/.vim/bundle/YouCompleteMe @@ -576,8 +579,8 @@ Download and install the following software: - CMake [25]. Add CMake executable to the PATH environment variable. -- Visual Studio [35]. Download the community edition. During setup, choose - _Custom_ as the installation type and select the _Visual C++_ component. +- Visual Studio [35]. Download the community edition. During setup, select + _Desktop development with C++_ in _Workloads_. - 7-zip [36]. Required to build YCM with semantic support for C-family languages. @@ -617,8 +620,8 @@ install with all language features, ensure 'msbuild', 'go', 'tsserver', 'node', python install.py --all < You can specify the Microsoft Visual C++ (MSVC) version using the '--msvc' -option. YCM officially supports MSVC 11 (Visual Studio 2012), 12 (2013), and 14 -(2015). +option. YCM officially supports MSVC 12 (Visual Studio 2013), 14 (2015), and 15 +(2017). That's it. You're done. Refer to the _User Guide_ section on how to use YCM. Don't forget that if you want the C-family semantic completion engine to work, @@ -782,8 +785,8 @@ will notify you to recompile it. You should then rerun the install process. On Windows, you need to download and install Python 2 or Python 3 [34]. Pick the version corresponding to your Vim architecture. You will also need Microsoft Visual C++ (MSVC) to build YCM. You can obtain it by - installing Visual Studio [35]. MSVC 11 (Visual Studio 2012), 12 (2013), - and 14 (2015) are officially supported. + installing Visual Studio [35]. MSVC 12 (Visual Studio 2013), 14 (2015), + and 15 (2017) are officially supported. Here we'll assume you installed YCM with Vundle. That means that the top- level YCM directory is in '~/.vim/bundle/YouCompleteMe'. @@ -954,6 +957,7 @@ Go ~ TypeScript ~ - Semantic auto-completion +- Real-time diagnostic display - Renaming symbols ('RefactorRename ') - Go to definition, find references (|GoToDefinition|, |GoToReferences|) - Semantic type information for identifiers (|GetType|) @@ -1389,9 +1393,10 @@ Completer API. Diagnostic Display ~ YCM will display diagnostic notifications for C-family and C# languages if you -compiled YCM with Clang and Omnisharp support, respectively. Since YCM -continuously recompiles your file as you type, you'll get notified of errors -and warnings in your file as fast as possible. +compiled YCM with Clang and Omnisharp support, respectively. Diagnostics will +also be displayed for TypeScript. Since YCM continuously recompiles your file +as you type, you'll get notified of errors and warnings in your file as fast as +possible. Here are the various pieces of the diagnostic UI: @@ -2797,13 +2802,6 @@ But fear not, you should be able to tweak your extra conf files to continue working by using the |g:ycm_extra_conf_vim_data| option. See the docs on that option for details. -------------------------------------------------------------------------------- -*youcompleteme-on-very-rare-occasions-vim-crashes-when-i-tab-through-completion-menu* -On very rare occasions Vim crashes when I tab through the completion menu ~ - -That's a very rare Vim bug most users never encounter. It's fixed in Vim -7.4.72. Update to that version (or above) to resolve the issue. - ------------------------------------------------------------------------------- *youcompleteme-i-get-importerror-exceptions-that-mention-pyinit_ycm_core-or-initycm_core* I get 'ImportError' exceptions that mention 'PyInit_ycm_core' or ~ @@ -3367,7 +3365,7 @@ References ~ [32] http://www.mono-project.com/docs/getting-started/install/linux/#centos-7-fedora-19-and-later-and-derivatives [33] https://bintray.com/micbou/generic/vim [34] https://www.python.org/downloads/windows/ -[35] https://www.visualstudio.com/products/free-developer-offers-vs.aspx +[35] https://www.visualstudio.com/downloads/ [36] http://www.7-zip.org/download.html [37] http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1 [38] https://github.com/tpope/vim-pathogen#pathogenvim diff --git a/python/ycm/base.py b/python/ycm/base.py index 4de4c0bf..4bfb3663 100644 --- a/python/ycm/base.py +++ b/python/ycm/base.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from future.utils import iteritems diff --git a/python/ycm/client/base_request.py b/python/ycm/client/base_request.py index 99067b68..5b526366 100644 --- a/python/ycm/client/base_request.py +++ b/python/ycm/client/base_request.py @@ -19,18 +19,16 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa import contextlib import logging -import urllib.parse import json from future.utils import native from base64 import b64decode, b64encode from ycm import vimsupport -from ycmd.utils import ToBytes +from ycmd.utils import ToBytes, urljoin, urlparse from ycmd.hmac_utils import CreateRequestHmac, CreateHmac, SecureBytesEqual from ycmd.responses import ServerError, UnknownExtraConf @@ -120,7 +118,7 @@ class BaseRequest( object ): headers = dict( _HEADERS ) headers[ _HMAC_HEADER ] = b64encode( CreateRequestHmac( ToBytes( method ), - ToBytes( urllib.parse.urlparse( request_uri ).path ), + ToBytes( urlparse( request_uri ).path ), request_body, BaseRequest.hmac_secret ) ) return headers @@ -263,8 +261,7 @@ def _ValidateResponseObject( response ): def _BuildUri( handler ): - return native( ToBytes( urllib.parse.urljoin( BaseRequest.server_location, - handler ) ) ) + return native( ToBytes( urljoin( BaseRequest.server_location, handler ) ) ) def MakeServerException( data ): diff --git a/python/ycm/client/command_request.py b/python/ycm/client/command_request.py index 51916c9d..7d6a4f82 100644 --- a/python/ycm/client/command_request.py +++ b/python/ycm/client/command_request.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.client.base_request import ( BaseRequest, BuildRequestData, diff --git a/python/ycm/client/completer_available_request.py b/python/ycm/client/completer_available_request.py index 37d53d88..d9b11e25 100644 --- a/python/ycm/client/completer_available_request.py +++ b/python/ycm/client/completer_available_request.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.client.base_request import ( BaseRequest, BuildRequestData, diff --git a/python/ycm/client/completion_request.py b/python/ycm/client/completion_request.py index 1325711d..76c969a0 100644 --- a/python/ycm/client/completion_request.py +++ b/python/ycm/client/completion_request.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycmd.utils import ToUnicode diff --git a/python/ycm/client/debug_info_request.py b/python/ycm/client/debug_info_request.py index 8e856a75..3e6c5854 100644 --- a/python/ycm/client/debug_info_request.py +++ b/python/ycm/client/debug_info_request.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.client.base_request import ( BaseRequest, BuildRequestData, diff --git a/python/ycm/client/event_notification.py b/python/ycm/client/event_notification.py index e797ddb6..b46dd5e6 100644 --- a/python/ycm/client/event_notification.py +++ b/python/ycm/client/event_notification.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.client.base_request import ( BaseRequest, BuildRequestData, diff --git a/python/ycm/client/omni_completion_request.py b/python/ycm/client/omni_completion_request.py index 2bcb2911..7fc76594 100644 --- a/python/ycm/client/omni_completion_request.py +++ b/python/ycm/client/omni_completion_request.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.client.completion_request import CompletionRequest diff --git a/python/ycm/client/shutdown_request.py b/python/ycm/client/shutdown_request.py index 31fd6c53..8bef0235 100644 --- a/python/ycm/client/shutdown_request.py +++ b/python/ycm/client/shutdown_request.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.client.base_request import BaseRequest, HandleServerException diff --git a/python/ycm/client/ycmd_keepalive.py b/python/ycm/client/ycmd_keepalive.py index ecf5fe39..a36d6998 100644 --- a/python/ycm/client/ycmd_keepalive.py +++ b/python/ycm/client/ycmd_keepalive.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa import time diff --git a/python/ycm/diagnostic_filter.py b/python/ycm/diagnostic_filter.py index 78ab2972..e31e6e70 100644 --- a/python/ycm/diagnostic_filter.py +++ b/python/ycm/diagnostic_filter.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from future.utils import iterkeys, iteritems diff --git a/python/ycm/diagnostic_interface.py b/python/ycm/diagnostic_interface.py index e905b6ad..f68d09f0 100644 --- a/python/ycm/diagnostic_interface.py +++ b/python/ycm/diagnostic_interface.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from future.utils import itervalues, iteritems @@ -109,8 +108,9 @@ class DiagnosticInterface( object ): self._diag_message_needs_clearing = False return - text = diags[ 0 ][ 'text' ] - if diags[ 0 ].get( 'fixit_available', False ): + first_diag = diags[ 0 ] + text = first_diag[ 'text' ] + if first_diag.get( 'fixit_available', False ): text += ' (FixIt)' vimsupport.PostVimMessage( text, warning = False, truncate = True ) @@ -133,7 +133,8 @@ def _UpdateSquiggles( buffer_number_to_line_to_diags ): line_to_diags = buffer_number_to_line_to_diags[ vim.current.buffer.number ] for diags in itervalues( line_to_diags ): - for diag in diags: + # Insert squiggles in reverse order so that errors overlap warnings. + for diag in reversed( diags ): location_extent = diag[ 'location_extent' ] is_error = _DiagnosticIsError( diag ) @@ -202,23 +203,23 @@ def _GetKeptAndNewSigns( placed_signs, buffer_number_to_line_to_diags, continue for line, diags in iteritems( line_to_diags ): - for diag in diags: - sign = _DiagSignPlacement( next_sign_id, - line, - buffer_number, - _DiagnosticIsError( diag ) ) - if sign not in placed_signs: - new_signs += [ sign ] - next_sign_id += 1 - else: - # We use .index here because `sign` contains a new id, but - # we need the sign with the old id to unplace it later on. - # We won't be placing the new sign. - kept_signs += [ placed_signs[ placed_signs.index( sign ) ] ] + # Only one sign is visible by line. + first_diag = diags[ 0 ] + sign = _DiagSignPlacement( next_sign_id, + line, + buffer_number, + _DiagnosticIsError( first_diag ) ) + if sign not in placed_signs: + new_signs.append( sign ) + next_sign_id += 1 + else: + # We use .index here because `sign` contains a new id, but + # we need the sign with the old id to unplace it later on. + # We won't be placing the new sign. + kept_signs.append( placed_signs[ placed_signs.index( sign ) ] ) return new_signs, kept_signs, next_sign_id - def _PlaceNewSigns( kept_signs, new_signs ): placed_signs = kept_signs[:] for sign in new_signs: @@ -227,7 +228,7 @@ def _PlaceNewSigns( kept_signs, new_signs ): if sign in placed_signs: continue vimsupport.PlaceSign( sign.id, sign.line, sign.buffer, sign.is_error ) - placed_signs.append(sign) + placed_signs.append( sign ) return placed_signs @@ -248,10 +249,10 @@ def _ConvertDiagListToDict( diag_list ): for line_to_diags in itervalues( buffer_to_line_to_diags ): for diags in itervalues( line_to_diags ): - # We also want errors to be listed before warnings so that errors aren't - # hidden by the warnings; Vim won't place a sign oven an existing one. - diags.sort( key = lambda diag: ( diag[ 'location' ][ 'column_num' ], - diag[ 'kind' ] ) ) + # We want errors to be listed before warnings so that errors aren't hidden + # by the warnings. + diags.sort( key = lambda diag: ( diag[ 'kind' ], + diag[ 'location' ][ 'column_num' ] ) ) return buffer_to_line_to_diags diff --git a/python/ycm/omni_completer.py b/python/ycm/omni_completer.py index 2424ddd7..2587e088 100644 --- a/python/ycm/omni_completer.py +++ b/python/ycm/omni_completer.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa import vim diff --git a/python/ycm/paths.py b/python/ycm/paths.py index 292a2a17..cd0adf29 100644 --- a/python/ycm/paths.py +++ b/python/ycm/paths.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 YouCompleteMe contributors. +# Copyright (C) 2015-2017 YouCompleteMe contributors. # # This file is part of YouCompleteMe. # @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa import os @@ -35,7 +34,7 @@ DIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party', 'ycmd' ) WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' ) PYTHON_BINARY_REGEX = re.compile( - r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$' ) + r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$', re.IGNORECASE ) def Memoize( obj ): @@ -52,19 +51,20 @@ def Memoize( obj ): @Memoize def PathToPythonInterpreter(): + # Not calling the Python interpreter to check its version as it significantly + # impacts startup time. from ycmd import utils python_interpreter = vim.eval( 'g:ycm_server_python_interpreter' ) - if python_interpreter: - if IsPythonVersionCorrect( python_interpreter ): + if _EndsWithPython( python_interpreter ): return python_interpreter raise RuntimeError( "Path in 'g:ycm_server_python_interpreter' option " "does not point to a valid Python 2.6+ or 3.3+." ) python_interpreter = _PathToPythonUsedDuringBuild() - if IsPythonVersionCorrect( python_interpreter ): + if _EndsWithPython( python_interpreter ): return python_interpreter # On UNIX platforms, we use sys.executable as the Python interpreter path. @@ -73,8 +73,7 @@ def PathToPythonInterpreter(): # interpreter path. python_interpreter = ( WIN_PYTHON_PATH if utils.OnWindows() else sys.executable ) - - if IsPythonVersionCorrect( python_interpreter ): + if _EndsWithPython( python_interpreter ): return python_interpreter # As a last resort, we search python in the PATH. We prefer Python 2 over 3 @@ -85,8 +84,7 @@ def PathToPythonInterpreter(): python_interpreter = utils.PathToFirstExistingExecutable( [ 'python2', 'python', 'python3' ] ) - - if IsPythonVersionCorrect( python_interpreter ): + if python_interpreter: return python_interpreter raise RuntimeError( "Cannot find Python 2.6+ or 3.3+. You can set its path " @@ -105,34 +103,10 @@ def _PathToPythonUsedDuringBuild(): return None -def EndsWithPython( path ): +def _EndsWithPython( path ): """Check if given path ends with a python 2.6+ or 3.3+ name.""" return path and PYTHON_BINARY_REGEX.search( path ) is not None -def IsPythonVersionCorrect( path ): - """Check if given path is the Python interpreter version 2.6+ or 3.3+.""" - from ycmd import utils - - if not EndsWithPython( path ): - return False - - command = [ path, - # Disable site customize. Faster, and less likely to encounter - # issues with disconnected mounts (nfs, fuse, etc.) - '-S', - '-c', - "import sys;" - "major, minor = sys.version_info[ :2 ];" - "good_python = ( major == 2 and minor >= 6 ) " - "or ( major == 3 and minor >= 3 ) or major > 3;" - # If this looks weird, remember that: - # int( True ) == 1 - # int( False ) == 0 - "sys.exit( not good_python )" ] - - return utils.SafePopen( command ).wait() == 0 - - def PathToServerScript(): return os.path.join( DIR_OF_YCMD, 'ycmd' ) diff --git a/python/ycm/syntax_parse.py b/python/ycm/syntax_parse.py index 8bb3d711..964361a2 100644 --- a/python/ycm/syntax_parse.py +++ b/python/ycm/syntax_parse.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from future.utils import itervalues diff --git a/python/ycm/tests/__init__.py b/python/ycm/tests/__init__.py index b02d1204..40d4422d 100644 --- a/python/ycm/tests/__init__.py +++ b/python/ycm/tests/__init__.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import MockVimModule diff --git a/python/ycm/tests/base_test.py b/python/ycm/tests/base_test.py index 3ce7ff2a..3b4fd4f0 100644 --- a/python/ycm/tests/base_test.py +++ b/python/ycm/tests/base_test.py @@ -22,8 +22,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa import contextlib diff --git a/python/ycm/tests/client/command_request_test.py b/python/ycm/tests/client/command_request_test.py index a205990d..854b498b 100644 --- a/python/ycm/tests/client/command_request_test.py +++ b/python/ycm/tests/client/command_request_test.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import ExtendedMock, MockVimModule diff --git a/python/ycm/tests/client/completion_request_test.py b/python/ycm/tests/client/completion_request_test.py index 0c764522..c3bd1aed 100644 --- a/python/ycm/tests/client/completion_request_test.py +++ b/python/ycm/tests/client/completion_request_test.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from nose.tools import eq_ diff --git a/python/ycm/tests/client/debug_info_request_test.py b/python/ycm/tests/client/debug_info_request_test.py index 570e92e5..9ce2a433 100644 --- a/python/ycm/tests/client/debug_info_request_test.py +++ b/python/ycm/tests/client/debug_info_request_test.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from copy import deepcopy diff --git a/python/ycm/tests/client/omni_completion_request_tests.py b/python/ycm/tests/client/omni_completion_request_tests.py index 02fb2e93..6b699622 100644 --- a/python/ycm/tests/client/omni_completion_request_tests.py +++ b/python/ycm/tests/client/omni_completion_request_tests.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from mock import MagicMock diff --git a/python/ycm/tests/command_test.py b/python/ycm/tests/command_test.py index d18506c0..6ad41992 100644 --- a/python/ycm/tests/command_test.py +++ b/python/ycm/tests/command_test.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import ( MockVimModule, MockVimBuffers, VimBuffer ) diff --git a/python/ycm/tests/completion_test.py b/python/ycm/tests/completion_test.py index f5fb958c..e16de3fa 100644 --- a/python/ycm/tests/completion_test.py +++ b/python/ycm/tests/completion_test.py @@ -21,8 +21,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import ( CurrentWorkingDirectory, ExtendedMock, diff --git a/python/ycm/tests/diagnostic_filter_test.py b/python/ycm/tests/diagnostic_filter_test.py index c24e4e0b..9ecff64b 100644 --- a/python/ycm/tests/diagnostic_filter_test.py +++ b/python/ycm/tests/diagnostic_filter_test.py @@ -19,8 +19,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import MockVimModule diff --git a/python/ycm/tests/event_notification_test.py b/python/ycm/tests/event_notification_test.py index ee010fde..b83c35bb 100644 --- a/python/ycm/tests/event_notification_test.py +++ b/python/ycm/tests/event_notification_test.py @@ -21,8 +21,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import ( CurrentWorkingDirectory, ExtendedMock, @@ -49,8 +48,8 @@ def PresentDialog_Confirm_Call( message ): def PlaceSign_Call( sign_id, line_num, buffer_num, is_error ): sign_name = 'YcmError' if is_error else 'YcmWarning' - return call( 'sign place {0} line={1} name={2} buffer={3}' - .format( sign_id, line_num, sign_name, buffer_num ) ) + return call( 'sign place {0} name={1} line={2} buffer={3}' + .format( sign_id, sign_name, line_num, buffer_num ) ) def UnplaceSign_Call( sign_id, buffer_num ): diff --git a/python/ycm/tests/omni_completer_test.py b/python/ycm/tests/omni_completer_test.py index 907066b9..3342768b 100644 --- a/python/ycm/tests/omni_completer_test.py +++ b/python/ycm/tests/omni_completer_test.py @@ -21,11 +21,10 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa -from future.utils import PY2 +from future.utils import PY2 from mock import patch, call from nose.tools import eq_ from hamcrest import contains_string diff --git a/python/ycm/tests/paths_test.py b/python/ycm/tests/paths_test.py index 1c1c6fb9..e50572bd 100644 --- a/python/ycm/tests/paths_test.py +++ b/python/ycm/tests/paths_test.py @@ -1,4 +1,4 @@ -# Copyright (C) 2016 YouCompleteMe contributors +# Copyright (C) 2016-2017 YouCompleteMe contributors # # This file is part of YouCompleteMe. # @@ -19,23 +19,24 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import MockVimModule MockVimModule() from nose.tools import ok_ -from ycm.paths import EndsWithPython +from ycm.paths import _EndsWithPython def EndsWithPython_Good( path ): - ok_( EndsWithPython( path ) ) + ok_( _EndsWithPython( path ), + 'Path {0} does not end with a Python name.'.format( path ) ) def EndsWithPython_Bad( path ): - ok_( not EndsWithPython( path ) ) + ok_( not _EndsWithPython( path ), + 'Path {0} does end with a Python name.'.format( path ) ) def EndsWithPython_Python2Paths_test(): @@ -44,14 +45,14 @@ def EndsWithPython_Python2Paths_test(): 'python2', '/usr/bin/python2.6', '/home/user/.pyenv/shims/python2.7', - r'C:\Python26\python.exe' + r'C:\Python26\python.exe', + '/Contents/MacOS/Python' ] for path in python_paths: yield EndsWithPython_Good, path - def EndsWithPython_Python3Paths_test(): python_paths = [ 'python3', diff --git a/python/ycm/tests/postcomplete_test.py b/python/ycm/tests/postcomplete_test.py index 84b71b92..5b2c788a 100644 --- a/python/ycm/tests/postcomplete_test.py +++ b/python/ycm/tests/postcomplete_test.py @@ -21,8 +21,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import MockVimModule diff --git a/python/ycm/tests/syntax_parse_test.py b/python/ycm/tests/syntax_parse_test.py index 0a8fb760..7c656633 100644 --- a/python/ycm/tests/syntax_parse_test.py +++ b/python/ycm/tests/syntax_parse_test.py @@ -20,8 +20,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from ycm.tests.test_utils import MockVimModule diff --git a/python/ycm/tests/test_utils.py b/python/ycm/tests/test_utils.py index c8a4d497..36ce2478 100644 --- a/python/ycm/tests/test_utils.py +++ b/python/ycm/tests/test_utils.py @@ -20,8 +20,7 @@ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import -from future import standard_library -standard_library.install_aliases() +# Not installing aliases from python-future; it's unreliable and slow. from builtins import * # noqa from mock import MagicMock, patch @@ -42,6 +41,9 @@ BWIPEOUT_REGEX = re.compile( '^(?:silent! )bwipeout!? (?P[0-9]+)$' ) GETBUFVAR_REGEX = re.compile( '^getbufvar\((?P[0-9]+), "&(?P