Skip to content

Commit

Permalink
do not consider changes in .elixir-ls and _build dirs when deciding i…
Browse files Browse the repository at this point in the history
…d rebuild is necessary

Fixes elixir-lsp#686
  • Loading branch information
lukaszsamson committed May 18, 2022
1 parent c1a9a5f commit ae40661
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/language_server/lib/language_server/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,11 @@ defmodule ElixirLS.LanguageServer.Server do
Enum.any?(changes, fn %{"uri" => uri = "file:" <> _, "type" => type} ->
path = SourceFile.path_from_uri(uri)

Path.extname(path) in (additional_watched_extensions ++ @default_watched_extensions) and
relative_path = Path.relative_to(path, state.project_dir)
first_path_segment = relative_path |> Path.split() |> hd

first_path_segment not in [".elixir_ls", "_build"] and
Path.extname(path) in (additional_watched_extensions ++ @default_watched_extensions) and
(type in [1, 3] or not Map.has_key?(state.source_files, uri) or
state.source_files[uri].dirty?)
end)
Expand Down

0 comments on commit ae40661

Please sign in to comment.