Skip to content

Stop tracking removed files and modules #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2020
Merged

Stop tracking removed files and modules #237

merged 2 commits into from
May 16, 2020

Conversation

szajbus
Copy link
Contributor

@szajbus szajbus commented May 8, 2020

After a file is removed

  • its md5 should not be tracked anymore and
  • its module should not be tracked in mod_deps

@axelson
Copy link
Member

axelson commented May 9, 2020

Hi, thanks for the PR! Can you explain a little bit about what problems occur without this change and why this is needed in addition to the removal that happens on line 351?

mod_deps = Map.drop(mod_deps, MapSet.to_list(stale_modules))

@szajbus
Copy link
Contributor Author

szajbus commented May 11, 2020

Hi,
I added some extra JsonRPC calls to get more output from ElixirLS in vs code and I noticed that a file I already removed is still being tracked (passed in state.removed_files to compile/2 on each build).

The expected behaviour would be to stop tracking removed files.

This was done by removing file's md5 hash from md5 map that is used by ElixirLS.LanguageServer.Dialyzer to identify changed and removed files on builds.

But there's also mod_deps map that is tracking module dependencies (as provided by :dialyzer_analysis_callgraph) so that we can reanalyze changed modules and also their dependants.

When a module is removed we should stop tracking it as a dependency of other modules, because it may lead to their unnecessary reanalysis.

(On a side note, I think there may still be some issue with the module deps tracking, because it sometimes reanalyzes less modules than are actually recompiled after a change. That was the reason I started "digging" in the first place, but didn't fully resolve it yet)

Copy link
Member

@axelson axelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down and the writeup! ❤️ Would be great to have tests for this but that's not really feasible at the moment. Perhaps more tests can be added later.

@axelson axelson merged commit ead80a4 into elixir-lsp:master May 16, 2020
axelson added a commit that referenced this pull request May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants