From 111c882d8d6cb82d42f115819221d112e3d6ca00 Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Wed, 28 Aug 2024 22:02:11 +0200 Subject: [PATCH 1/4] Bump vim requirement to version 9.1.0016 Since Ubuntu 24.04 is out, we can clean up a bit. Some of the `VimSupportsFoo()` functions will always return `True` in vim, but we also need to take into account othervim. --- README.md | 20 +++---- plugin/youcompleteme.vim | 4 +- python/ycm/diagnostic_interface.py | 4 +- python/ycm/inlay_hints.py | 2 +- python/ycm/tests/test_utils.py | 38 ++++++++----- python/ycm/tests/youcompleteme_test.py | 2 +- python/ycm/text_properties.py | 13 +---- python/ycm/vimsupport.py | 79 +++++++------------------- python/ycm/youcompleteme.py | 2 +- 9 files changed, 63 insertions(+), 101 deletions(-) diff --git a/README.md b/README.md index f674b6afe8..dff492b4f6 100644 --- a/README.md +++ b/README.md @@ -211,13 +211,12 @@ Installation | Runtime | Min Version | Recommended Version (full support) | Python | |---------|-------------|------------------------------------|--------| -| Vim | 8.2.3995 | 9.0.214 | 3.8 | -| Neovim | 0.5 | Vim 9.0.214 | 3.8 | +| Vim | 9.1.0016 | 9.1.0016 | 3.8 | +| Neovim | 0.5 | Vim 9.1.0016 | 3.8 | #### Supported Vim Versions Our policy is to support the Vim version that's in the latest LTS of Ubuntu. -That's currently Ubuntu 22.04 which contains `vim-nox` at `v8.2.3995`. Vim must have a [working Python 3 runtime](#supported-python-runtime). @@ -418,7 +417,7 @@ that are conservatively turned off by default that you may want to turn on. ### Linux 64-bit -The following assume you're using Ubuntu 22.04. +The following assume you're using Ubuntu 24.04. #### Quick start, installing all completers @@ -1091,7 +1090,7 @@ On supported architectures, the `install.py` script will download a suitable clangd (`--clangd-completer`) or libclang (`--clang-completer`) for you. Supported architectures are: -* Linux glibc >= 2.31 (Intel, armv7-a, aarch64) - built on ubuntu 22.04 +* Linux glibc >= 2.39 (Intel, armv7-a, aarch64) - built on ubuntu 24.04 * MacOS >=10.15 (Intel, arm64) - For Intel, compatibility per clang.llvm.org downloads - For arm64, macOS 10.15+ @@ -1617,10 +1616,10 @@ let g:ycm_language_server = \ 'filetypes': [ 'yaml' ] \ }, \ { - \ 'name': 'rust', - \ 'cmdline': [ 'ra_lsp_server' ], - \ 'filetypes': [ 'rust' ], - \ 'project_root_files': [ 'Cargo.toml' ] + \ 'name': 'csharp', + \ 'cmdline': [ 'OmniSharp', '-lsp' ], + \ 'filetypes': [ 'csharp' ], + \ 'project_root_files': [ '*.csproj', '*.sln' ] \ }, \ { \ 'name': 'godot', @@ -1639,7 +1638,8 @@ Each dictionary contains the following keys: * `filetypes` (list of string, mandatory): List of Vim filetypes this server should be used for. * `project_root_files` (list of string, optional): List of filenames to search - for when trying to determine the project's root. + for when trying to determine the project's root. Uses python's pathlib for + glob matching. * `cmdline` (list of strings, optional): If supplied, the server is started with this command line (each list element is a command line word). Typically, the server should be started with STDIO communication. If not supplied, `port` diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 2d6ff8792c..5c0ab1d37b 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -31,10 +31,10 @@ let s:is_neovim = has( 'nvim' ) if exists( "g:loaded_youcompleteme" ) call s:restore_cpo() finish -elseif ( v:version < 802 || (v:version == 802 && !has( 'patch3995' )) ) && +elseif ( v:version < 901 || (v:version == 901 && !has( 'patch0016' )) ) && \ !s:is_neovim echohl WarningMsg | - \ echomsg "YouCompleteMe unavailable: requires Vim 8.2.3995+." | + \ echomsg "YouCompleteMe unavailable: requires Vim 9.1.0016+." | \ echohl None call s:restore_cpo() finish diff --git a/python/ycm/diagnostic_interface.py b/python/ycm/diagnostic_interface.py index ffbd35485a..40697fc962 100644 --- a/python/ycm/diagnostic_interface.py +++ b/python/ycm/diagnostic_interface.py @@ -133,7 +133,7 @@ def _ClearCurrentDiagnostic( self, will_be_replaced=False ): if not self._diag_message_needs_clearing: return - if ( vimsupport.VimSupportsVirtualText() and + if ( not vimsupport.VimIsNeovim() and self._user_options[ 'echo_current_diagnostic' ] == 'virtual-text' ): tp.ClearTextProperties( self._bufnr, prop_types = [ 'YcmVirtDiagPadding', @@ -149,7 +149,7 @@ def _ClearCurrentDiagnostic( self, will_be_replaced=False ): def _EchoDiagnosticText( self, line_num, first_diag, text ): self._ClearCurrentDiagnostic( bool( text ) ) - if ( vimsupport.VimSupportsVirtualText() and + if ( not vimsupport.VimIsNeovim() and self._user_options[ 'echo_current_diagnostic' ] == 'virtual-text' ): if not text: return diff --git a/python/ycm/inlay_hints.py b/python/ycm/inlay_hints.py index 6199af5f58..880e89ed67 100644 --- a/python/ycm/inlay_hints.py +++ b/python/ycm/inlay_hints.py @@ -32,7 +32,7 @@ def Initialise(): - if not vimsupport.VimSupportsVirtualText(): + if vimsupport.VimIsNeovim(): return False props = tp.GetTextPropertyTypes() diff --git a/python/ycm/tests/test_utils.py b/python/ycm/tests/test_utils.py index 17025af9cc..1aa1b7286b 100644 --- a/python/ycm/tests/test_utils.py +++ b/python/ycm/tests/test_utils.py @@ -41,6 +41,13 @@ '^(?:silent! )bwipeout!? (?P[0-9]+)$' ) GETBUFVAR_REGEX = re.compile( '^getbufvar\\((?P[0-9]+), "(?P