From 2a72a0e65a80d590c83cb967dd40db082ad2da44 Mon Sep 17 00:00:00 2001 From: Shuangcheng-Ni <110970449+Shuangcheng-Ni@users.noreply.github.com> Date: Sun, 25 Dec 2022 21:51:43 +0800 Subject: [PATCH 1/2] More available arguments for commands This change provides more available arguments for commands like `YcmCompleter`. The new available arguments `--line_num=` and `--column_num=` enables the commands to be executed at any position. Without these two arguments, the commands can only be executed at cursor position. --- python/ycm/youcompleteme.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 421dde1e8b..8f8c16b747 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -391,6 +391,10 @@ def _GetCommandRequestArguments( self, elif argument.startswith( '--bufnr=' ): extra_data[ 'bufnr' ] = int( argument[ len( '--bufnr=' ): ] ) continue + elif argument.startswith( '--line_num=' ): + extra_data[ 'line_num' ] = int( argument[ len( '--line_num=' ): ] ) + elif argument.startswith( '--column_num=' ): + extra_data[ 'column_num' ] = int( argument[ len( '--column_num=' ): ] ) final_arguments.append( argument ) From b11ebef0871a1c695d3ce955023d7e8359cca101 Mon Sep 17 00:00:00 2001 From: Shuangcheng-Ni <110970449+Shuangcheng-Ni@users.noreply.github.com> Date: Sun, 25 Dec 2022 22:01:03 +0800 Subject: [PATCH 2/2] Update youcompleteme.py --- python/ycm/youcompleteme.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 8f8c16b747..b4f58ece81 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -393,8 +393,10 @@ def _GetCommandRequestArguments( self, continue elif argument.startswith( '--line_num=' ): extra_data[ 'line_num' ] = int( argument[ len( '--line_num=' ): ] ) + continue elif argument.startswith( '--column_num=' ): extra_data[ 'column_num' ] = int( argument[ len( '--column_num=' ): ] ) + continue final_arguments.append( argument )