Skip to content
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

Define dependency to scala files in using directives #1157

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

lwronski
Copy link
Contributor

@lwronski lwronski commented Jul 6, 2022

No description provided.

@lwronski lwronski linked an issue Jul 6, 2022 that may be closed by this pull request
@lwronski lwronski force-pushed the directive-source-file branch 3 times, most recently from 59f2848 to 54782df Compare July 6, 2022 11:35
@lwronski lwronski marked this pull request as ready for review July 7, 2022 07:09
Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

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

There are a few questions I'm wondering about the new inputs:

  • are they taken into account when watching files on disk? (IIRC, we only watch things from the initial Inputs instance)
  • do they work fine from BSP? (they should, but I'd add a test for that in BspTestDefinitions just in case)
  • are relative paths computed fine? like what if the using file directive is in a source in a sub-directory, like in src/foo/bar/Something.scala?

Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

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

I think it might be cool to highlight this feature in the scripts.md guide as well, since that's where this feature would probably be at its most useful.

website/docs/commands/run.md Outdated Show resolved Hide resolved
website/docs/commands/run.md Outdated Show resolved Hide resolved
website/docs/commands/run.md Outdated Show resolved Hide resolved
@lwronski lwronski force-pushed the directive-source-file branch 3 times, most recently from d8c44b6 to 6d48703 Compare July 11, 2022 12:25
@lwronski
Copy link
Contributor Author

There are a few questions I'm wondering about the new inputs:

  • are they taken into account when watching files on disk? (IIRC, we only watch things from the initial Inputs instance)

Now it should work, and upon every change, I re-compute actual Inputs instance adding sources from using directives.

  • do they work fine from BSP? (they should, but I'd add a test for that in BspTestDefinitions just in case)

Yes, It works fine from BSP and I also added one BSP test.

  • are relative paths computed fine? like what if the using file directive is in a source in a sub-directory, like in src/foo/bar/Something.scala?

I think, it is out of the scope of this PR, it should be fixed in #1098. Now, it works the same as path resolving for the resourceDir parameter in using directive.

@lwronski lwronski force-pushed the directive-source-file branch 2 times, most recently from 899a664 to 441f444 Compare July 12, 2022 09:02
@lwronski lwronski requested a review from wleczny July 12, 2022 09:49
@lwronski lwronski force-pushed the directive-source-file branch 3 times, most recently from 88f226e to 72f0031 Compare July 12, 2022 14:49
@lwronski lwronski force-pushed the directive-source-file branch 2 times, most recently from 1cdffdc to 6d700c4 Compare July 12, 2022 15:25
Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

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

Apart from the minor commit (and maybe reworking the commits a bit so that we can do a merge commit), LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add possibility for scripts to define dependency on other scala files
3 participants