Skip to content

Commit

Permalink
Merge pull request #1066 from fuyu0425/master
Browse files Browse the repository at this point in the history
setting cwd when launching lsp server
  • Loading branch information
manateelazycat authored Oct 9, 2024
2 parents 9e21846 + f84c231 commit 670dd9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/lspserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,15 @@ def __init__(self, message_queue, project_path, server_info, server_name, enable
self.save_include_text = False

# Start LSP server.
cwd = self.project_path
if os.path.isfile(self.project_path): # single file
cwd = os.path.dirname(self.project_path)
self.lsp_subprocess = subprocess.Popen(self.server_info["command"],
bufsize=DEFAULT_BUFFER_SIZE,
stdin=PIPE,
stdout=PIPE,
stderr=stderr)
stderr=stderr,
cwd=cwd)

# Two separate thread (read/write) to communicate with LSP server.
self.receiver = LspServerReceiver(self.lsp_subprocess, self.server_info["name"])
Expand Down

0 comments on commit 670dd9c

Please sign in to comment.