Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Analyze files with implicit requires #80

Merged
merged 2 commits into from
Apr 9, 2018

Conversation

faustinoaq
Copy link
Member

@faustinoaq faustinoaq commented Apr 9, 2018

This PR basically adds the following feature: Analyze the code twice if undefined symbol is found on diagnostics result

The rules:

  1. first time analyzes a single file and stop if no error
  2. second time analyzes the entire project requiring the first level files inside src folder

Summary of changes:

  • Add method inside_crystal_path? to avoid analizing lib and stdlib
  • Send clean diagnostics for all files when a full project is analyzed
  • Allow analyze files with implicit requires (main file style)
  • Adds --no-debug flag for speed up compilation
  • Add fake file .scry.cr to analyze a full project (aka main file)
  • Remove the fake file .scry.cr from diagnostic list
  • Add untitled: to the uri_to_filename method

Use case: very useful on those projects where you have a main file that require all other files, allowing you to write your code without multiple requires in every file

Fixes #29 as well

Related to #78 (This allows to remove the errors across files when you search implementations)

* Add method inside_crystal_path? to avoid analizing lib and stdlib
* Send clean diagnostics for all files when a full project is analyzed
* Allow analyze files with implicit requires (main file style)
* Adds --no-debug flag for speed up compilation
* Add fake file .scry.cr to analyze a full project (aka main file)
* Remove the fake file .scry.cr from diagnostic list
* Add untitled: to the uri_to_filename method
@faustinoaq faustinoaq requested a review from a team April 9, 2018 09:01
@faustinoaq
Copy link
Member Author

faustinoaq commented Apr 9, 2018

About the spec: as same as I said on #78, Actually the current tests already cover this feature. To create a full test for this we need a full workspace, so is a bit harder that common specs.I think those kind of specs can be implemented on other PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants