Skip to content

Add Playground to make debugging easier in Metals #14692

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
Mar 15, 2022
Merged

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented Mar 15, 2022

  1. Bump junit-interface to 0.13.3
    This is needed by Metals to have the test explorer working (source)

  2. Add Playground class in scala3-compiler-test to make debugging easier
    It contains an example test that check the compilation of the tests/playground/example.scala file.
    The Playground class is annotated with @org.junit.Ignore: you need to remove it to run the test.

Demo:
debug

@bishabosha
Copy link
Member

when I try what's in the gif, my user dir is dotty/compiler so the path tests/playground/example.scala can't be found, I wonder why this is :/

@adpi2 adpi2 requested a review from mbovel March 15, 2022 15:51
@adpi2
Copy link
Member Author

adpi2 commented Mar 15, 2022

@bishabosha Could it be that you use Bloop and that Bloop does not take into account the working directory setting defined here:
https://github.com/lampepfl/dotty/blob/5fcfeeceeddaa0193c566f2dcf7d12ed279dfce8/project/Build.scala#L534

I don't think there is an easy fix for this. Maybe you can use sbt as the build server?

@adpi2
Copy link
Member Author

adpi2 commented Mar 15, 2022

@bishabosha Or you can change the Playground test itself locally:

compileFile("../../tests/playground/example.scala", defaultOptions).checkCompile()

@bishabosha
Copy link
Member

I don't think there is an easy fix for this. Maybe you can use sbt as the build server?

I switched to sbt as the build server and then it worked as expected. Thanks!

@mbovel
Copy link
Member

mbovel commented Mar 15, 2022

Excellent! I'll make a separate PR to document this.

@adpi2 adpi2 merged commit bfd4b53 into scala:main Mar 15, 2022
@adpi2 adpi2 deleted the debugger branch March 7, 2025 12:49
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