Skip to content

Commit e5e0711

Browse files
authored
Merge pull request #1164 from cbecker/add-stdlib-dir-option
Add stdlib dir option
2 parents 8eaba5f + 76c1bb5 commit e5e0711

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ Below is a list of configuration options supported by the ElixirLS language serv
387387
<dt>elixirLS.enableTestLenses</dt><dd>Show code lenses to run tests in terminal.</dd>
388388
<dt>elixirLS.additionalWatchedExtensions</dt><dd>Additional file types capable of triggering a build on change</dd>
389389
<dt>elixirLS.languageServerOverridePath</dt><dd>Absolute path to an alternative ElixirLS release that will override the packaged release</dd>
390+
<dt>elixirLS.stdlibSrcDir</dt><dd>Path to Elixir's std lib source code. See [here](https://github.com/elixir-lsp/elixir_sense/pull/277) for more info</dd>
390391
</dl>
391392

392393
## Debug Adapter configuration options

apps/language_server/lib/language_server/server.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,11 @@ defmodule ElixirLS.LanguageServer.Server do
18641864
mix_target = Map.get(settings, "mixTarget")
18651865
project_dir = Map.get(settings, "projectDir")
18661866
additional_watched_extensions = Map.get(settings, "additionalWatchedExtensions", [])
1867+
stdlib_src_dir = to_string(Map.get(settings, "stdlibSrcDir", ""))
1868+
1869+
if stdlib_src_dir != "" do
1870+
Application.put_env(:language_server, :elixir_src, stdlib_src_dir)
1871+
end
18671872

18681873
state =
18691874
state
@@ -1902,6 +1907,7 @@ defmodule ElixirLS.LanguageServer.Server do
19021907
"elixir_ls.envVariables" => to_string(Map.get(settings, "envVariables", %{}) != %{}),
19031908
"elixir_ls.mixEnv" => to_string(Map.get(settings, "mixEnv", "test")),
19041909
"elixir_ls.mixTarget" => to_string(Map.get(settings, "mixTarget", "host")),
1910+
"elixir_ls.stdlibSrcDir" => stdlib_src_dir,
19051911
"elixir_ls.dialyzerFormat" =>
19061912
if(Map.get(settings, "dialyzerEnabled", true),
19071913
do: Map.get(settings, "dialyzerFormat", "dialyxir_long"),

0 commit comments

Comments
 (0)