Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bundled/tool/lsp_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ def update_sys_path(path_to_add: str, strategy: str) -> None:


# Ensure that we can import LSP libraries, and other bundled libraries.
BUNDLE_DIR = pathlib.Path(__file__).parent.parent
Comment thread
edvilme marked this conversation as resolved.
Comment thread
edvilme marked this conversation as resolved.
# Always bundled: this is the server's own code, not a user-swappable dependency.
update_sys_path(os.fspath(BUNDLE_DIR / "tool"), "useBundled")
update_sys_path(
os.fspath(pathlib.Path(__file__).parent.parent / "libs"),
os.fspath(BUNDLE_DIR / "libs"),
os.getenv("LS_IMPORT_STRATEGY", "useBundled"),
)

Expand Down
9 changes: 5 additions & 4 deletions bundled/tool/lsp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys
import sysconfig
import threading
from typing import Any, Callable, List, Sequence, Tuple, Union
from typing import Any, Callable, List, Optional, Sequence, Tuple, Union

# Save the working directory used when loading this module
SERVER_CWD = os.getcwd()
Expand Down Expand Up @@ -88,9 +88,10 @@ def is_stdlib_file(file_path: str) -> bool:
class RunResult:
"""Object to hold result from running tool."""

def __init__(self, stdout, stderr):
self.stdout = stdout
self.stderr = stderr
def __init__(self, stdout: str, stderr: str, exit_code: Optional[int] = None):
self.stdout: str = stdout
self.stderr: str = stderr
self.exit_code: Optional[int] = exit_code


class CustomIO(io.TextIOWrapper):
Expand Down
Loading