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

allow to run main of different files in parallel #1479

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

kaplan-shaked
Copy link
Contributor

No description provided.

@@ -76,10 +76,10 @@ async function runMain(main: ExtendedScalaRunMain): Promise<boolean> {
},
{}
);

const file = currentFile();
Copy link
Contributor

Choose a reason for hiding this comment

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

This might prove problematic if we run but the file is not focused 🤔

Actually, we can already make it better via main.class which will be the name of the class being run, which should be unique.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. testing it now.

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -79,7 +79,7 @@ async function runMain(main: ExtendedScalaRunMain): Promise<boolean> {

const shellOptions = { ...platformSpecificOptions(), env };
const task = new Task(
{ type: "scala", task: "run" },
{ type: "scala " + main.data.class, task: "run" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ type: "scala " + main.data.class, task: "run" },
{ type: "scala", task: "run", class: main.data.class },

I read the API for Task and it seems type should stay as "scala" and we can just add another property which looks to be working. If we ever need to use https://code.visualstudio.com/api/extension-guides/task-provider#task-definition then we would avoid weird issue.

I should have thought of it in the first place, thanks for working on this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@tgodzik tgodzik merged commit 658b86c into scalameta:main Apr 9, 2024
10 checks passed
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.

2 participants