Skip to content

Commit

Permalink
Print server info in lsp-bridge buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Nov 4, 2023
1 parent ffeed75 commit 7569769
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions core/lspserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ def __init__(self, message_queue, project_path, server_info, server_name, enable
stdout=PIPE,
stderr=stderr)

# Notify user server is start.
message_emacs("Start LSP server ({}) for {}...".format(self.server_info["name"], self.root_path))

# Two separate thread (read/write) to communicate with LSP server.
self.receiver = LspServerReceiver(self.lsp_subprocess, self.server_info["name"])
self.receiver.start()
Expand Down
4 changes: 2 additions & 2 deletions core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def close_epc_client():


def handle_arg_types(arg):
if type(arg) is str and arg.startswith("'"):
if isinstance(arg, str) and arg.startswith("'"):
arg = sexpdata.Symbol(arg.partition("'")[2])

return sexpdata.Quoted(arg)
Expand Down Expand Up @@ -218,7 +218,7 @@ def epc_arg_transformer(arg):
(list 1 2 3) => [1 2 3]
(list 1 2 (list 3 4)) => [1 2 [3 4]]
"""
if type(arg) != list:
if not isinstance(arg, list):
return arg

# NOTE: Empty list elisp can be treated as both empty python dict/list
Expand Down
10 changes: 5 additions & 5 deletions lsp_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,11 @@ def _close_file(self, filepath):

def enjoy_hacking(self, servers, project_path):
# Notify user server is ready.
message_emacs("Start LSP server ({}) for {} with '{}' mode, enjoy hacking!".format(
", ".join(servers),
project_path,
"project" if os.path.isdir(project_path) else "single-file"
))
print("Start lsp server ({}) for {}".format(", ".join(servers), project_path))

message_emacs("Active {} '{}', enjoy hacking!".format(
"project" if os.path.isdir(project_path) else "file",
os.path.basename(project_path)))

def load_single_lang_server(self, project_path, filepath):
single_lang_server = get_emacs_func_result("get-single-lang-server", project_path, filepath)
Expand Down

0 comments on commit 7569769

Please sign in to comment.