Skip to content

Commit

Permalink
return empty request if highlight is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejlevkovitch committed Dec 21, 2023
1 parent de768e2 commit 96698c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ycm/semantic_highlighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.


from ycm.client.base_request import BaseRequest
from ycm.client.semantic_tokens_request import SemanticTokensRequest
from ycm.client.base_request import BuildRequestData
from ycm import vimsupport
Expand Down Expand Up @@ -185,6 +186,9 @@ def __init__( self, bufnr ):


def _NewRequest( self, request_range ):
if self._do_highlight == False:
return BaseRequest()

Check warning on line 190 in python/ycm/semantic_highlighting.py

View check run for this annotation

Codecov / codecov/patch

python/ycm/semantic_highlighting.py#L190

Added line #L190 was not covered by tests

request: dict = BuildRequestData( self._bufnr )
request[ 'range' ] = request_range
return SemanticTokensRequest( request )
Expand Down

0 comments on commit 96698c1

Please sign in to comment.