Skip to content

Commit

Permalink
feat: add SYMBOL_SERVER & SYMBOL_CACHE_DOWNLOAD vars to control symbo…
Browse files Browse the repository at this point in the history
…l server (#4)

Closes #3.
  • Loading branch information
williamboman committed May 2, 2023
1 parent 1f24a2f commit e5b1ddf
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,20 @@ $ julia-lsp ~/.julia/environments/v1.8/
The executable is configured to store caches to `$JULIA_LSP_STORAGE` if defined, otherwise it defaults to `../store`
relative to where the executable is located.

## Symbol caches

Symbols will automatically be downloaded to the store cache. To disable symbol downloads from the symbol server, set the
`SYMBOL_CACHE_DOWNLOAD` environment variable to `0`, for example:

```sh
$ SYMBOL_CACHE_DOWNLOAD=0 julia-lsp "<julia_env_path>"
```

To configure the symbol server (default is `https://www.julia-vscode.org/symbolcache`), set the `SYMBOL_SERVER`
environment variable, for example:

```sh
$ SYMBOL_SERVER=https://symbol-server julia-lsp "<julia_env_path>"
```

[modeline]: vim:tw=120:et:sw=4
8 changes: 6 additions & 2 deletions bin/julia-lsp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ export DEBUG="--debug=no"
export IGNORE_TELEMETRY_CRASH=""
export OLD_DEPOT_PATH=${JULIA_DEPOT_PATH:-""}
export STORAGE_PATH="${JULIA_LSP_STORAGE:-${PKG_ROOT}/store}"
export USE_SYMSERVER_DOWNLOADS="download"
export SYMSERVER_UPSTREAM="https://www.julia-vscode.org/symbolcache"
if [[ ${SYMBOL_CACHE_DOWNLOAD:-1} != 0 ]]; then
export USE_SYMSERVER_DOWNLOADS="download"
else
export USE_SYMSERVER_DOWNLOADS="local"
fi
export SYMSERVER_UPSTREAM="${SYMBOL_SERVER:-https://www.julia-vscode.org/symbolcache}"
export DETACHED="--detached=no"

export JULIA_LOAD_PATH=":"
Expand Down
18 changes: 15 additions & 3 deletions bin/julia-lsp.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ set "JULIA_ENVIRONMENT_PATH=%1"
set "DEBUG=--debug=no"
set "IGNORE_TELEMETRY_CRASH="
set "OLD_DEPOT_PATH=%JULIA_DEPOT_PATH%"
if "%JULIA_LSP_STORAGE%"=="" set "STORAGE_PATH=%PKG_ROOT%\store" || set "STORAGE_PATH=%JULIA_LSP_STORAGE%"
set "USE_SYMSERVER_DOWNLOADS=download"
set "SYMSERVER_UPSTREAM=https://www.julia-vscode.org/symbolcache"
IF "%JULIA_LSP_STORAGE%"=="" (
set "STORAGE_PATH=%PKG_ROOT%\store"
) ELSE (
set "STORAGE_PATH=%JULIA_LSP_STORAGE%"
)
IF "%SYMBOL_CACHE_DOWNLOAD%"=="0" (
set "USE_SYMSERVER_DOWNLOADS=local"
) ELSE (
set "USE_SYMSERVER_DOWNLOADS=download"
)
IF "%SYMBOL_SERVER%"=="" (
set "SYMSERVER_UPSTREAM=https://www.julia-vscode.org/symbolcache"
) ELSE (
set "SYMSERVER_UPSTREAM=%SYMBOL_SERVER%"
)
set "DETACHED=--detached=no"

set "JULIA_LOAD_PATH=;"
Expand Down

0 comments on commit e5b1ddf

Please sign in to comment.