Skip to content

Commit

Permalink
Make ruff happy
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Oct 25, 2023
1 parent 8057033 commit 4e75189
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/lspserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import traceback
from subprocess import PIPE
from sys import stderr
from typing import TYPE_CHECKING, Dict
from urllib.parse import urlparse
from typing import Dict, TYPE_CHECKING
from core.mergedeep import merge

from core.handler import Handler
from core.mergedeep import merge

if TYPE_CHECKING:
from core.fileaction import FileAction
Expand Down Expand Up @@ -213,15 +213,15 @@ def __init__(self, message_queue, project_path, server_info, server_name, enable

# LSP server information.
self.completion_trigger_characters = list()

self.completion_resolve_provider = False
self.rename_prepare_provider = False
self.code_action_provider = False
self.code_format_provider = False
self.signature_help_provider = False
self.workspace_symbol_provider = False
self.inlay_hint_provider = False

self.code_action_kinds = [
"quickfix",
"refactor",
Expand Down Expand Up @@ -346,7 +346,7 @@ def get_capabilities(self):
}
})

if type(self.worksplace_folder) == str:
if isinstance(self.worksplace_folder, str):
merge_capabilites = merge(merge_capabilites, {
"workspace": {
"workspaceFolders": True
Expand All @@ -365,7 +365,7 @@ def get_capabilities(self):
def get_initialization_options(self):
initialization_options = self.server_info.get("initializationOptions", {})

if type(self.worksplace_folder) == str:
if isinstance(self.worksplace_folder, str):
initialization_options = merge(initialization_options, {
"workspaceFolders": [
self.worksplace_folder
Expand Down Expand Up @@ -421,15 +421,15 @@ def send_did_save_notification(self, filepath, buffer_name):
"uri": path_to_uri(filepath)
}
}

# Fetch buffer whole content to LSP server if server capability 'includeText' is True.
if self.save_include_text:
args = merge(args, {
"textDocument": {
"text": get_buffer_content(filepath, buffer_name)
}
})

self.sender.send_notification("textDocument/didSave", args)

def send_did_change_notification(self, filepath, version, start, end, range_length, text):
Expand Down

0 comments on commit 4e75189

Please sign in to comment.