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

Add option to run everything in the current file #3311

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Nov 26, 2021

This will enable the possibility to run/debug without specifying the configuration in launch.json

Some further work can be done on the discovery so that we would be able to automatically feel new configurations for the user.

Related to #3272

@ayoub-benali
Copy link
Contributor

Does this still requires DAP support from the client ?
In the case of sublime DAP would handled by a separate plugin https://github.com/daveleroy/sublime_debugger (similarly to vim ?). That plugin also seems to require a config file which is confusing in term of setup

@tgodzik
Copy link
Contributor Author

tgodzik commented Nov 26, 2021

Does this still requires DAP support from the client ? In the case of sublime DAP would handled by a separate plugin https://github.com/daveleroy/sublime_debugger (similarly to vim ?). That plugin also seems to require a config file which is confusing in term of setup

It does require some kind of DAP client, but the command should start the process and return the port to connect to. So some work on the editor side is required to wire the output of the command and starting of the session.

@ayoub-benali
Copy link
Contributor

Thanks for the clarification. Is this simplification only for running files ? do test cases for example require the "old" way (config file).

@tgodzik
Copy link
Contributor Author

tgodzik commented Nov 26, 2021

Thanks for the clarification. Is this simplification only for running files ? do test cases for example require the "old" way (config file).

Actually the aim of the PR is to provide an universal way of running things:

  • if there is a main class in the file, run that
  • if there are multiple main classes, show quickpick and run the chosen class
  • if there are test classes, run all of them

@tgodzik tgodzik force-pushed the add-run-in-file branch 2 times, most recently from 246aa7c to e82cba6 Compare November 29, 2021 13:11
@tgodzik tgodzik requested a review from ckipp01 November 29, 2021 13:11
Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Couple nits, but other than that LGTM! I tried it out with nvim-metals and all seemed to work well!

)
)
} else {
Future.failed(NoRunOptionException)
Copy link
Member

Choose a reason for hiding this comment

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

Total aside, but on my TODO list to to refactor all this fails out. I'm not a huge fan of using failing futures for control flow. I think we can probably model all of these differently. One day 😆

Copy link
Member

Choose a reason for hiding this comment

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

Are you talking about a dedicated error channel?

This will enable the possibility to run/debug without specifying the configuration in `launch.json`

Some further work can be done on the disocery so that we would be able to automatically feel new configurations for the user.
@tgodzik tgodzik merged commit e7cd38e into scalameta:main Nov 29, 2021
@tgodzik tgodzik deleted the add-run-in-file branch November 29, 2021 18:27
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.

None yet

4 participants