Skip to content

Commit

Permalink
Ensure tool directory is always on path (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Aug 2, 2023
1 parent d12f5d8 commit df3e688
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bundled/tool/lsp_runner.py
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
# Always use bundled server files.
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
6 changes: 5 additions & 1 deletion bundled/tool/lsp_server.py
Expand Up @@ -26,11 +26,15 @@ 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
# Always use bundled server files.
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"),
)


# **********************************************************
# Imports needed for the language server goes below this.
# **********************************************************
Expand Down

0 comments on commit df3e688

Please sign in to comment.