-
Notifications
You must be signed in to change notification settings - Fork 76
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 commands to run or test the current file or target. #520
Conversation
src/scalaDebugger.ts
Outdated
@@ -247,3 +247,14 @@ export interface DebugSession { | |||
name: string; | |||
uri: string; | |||
} | |||
|
|||
export interface DebugDiscoveryParams { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckipp01 should we move these classes to the language client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea probably. I'll open a pr for that. Also, should we put in the other optional fields?
"args"?: string[],
"jvmOptions"?: string[],
"env"?: {}, // <-- I actually don't know how this is is done in TS to signify it's an object with unknown k v pairs.
"envFile"?: string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can. I haven't added them since they would require using launch.json
, which I think might not work when running current file. Also it's kind of weird to set the same options for each file we would run. I think if a user requires arguments etc. then it makes sense to create a dedicated run configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea true sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works pretty cool! 😍 metals-1615550014766.mp4 |
src/extension.ts
Outdated
registerTextEditorCommand( | ||
`metals.test-current-file`, | ||
(editor, _edit, _args) => { | ||
let args: DebugDiscoveryParams = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let args: DebugDiscoveryParams = { | |
const args: DebugDiscoveryParams = { |
src/extension.ts
Outdated
registerTextEditorCommand( | ||
`metals.test-current-target`, | ||
(editor, _edit, _args) => { | ||
let args: DebugDiscoveryParams = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let args: DebugDiscoveryParams = { | |
const args: DebugDiscoveryParams = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
a2ccc92
to
43aac4c
Compare
Thanks to @ckipp01 it's now possible to run test or main classes inside the current file. The Metals PR that added this functionality is scalameta/metals#2532
43aac4c
to
c17921f
Compare
…rn/minimatch-3.1.2 chore(deps): bump minimatch from 3.0.4 to 3.1.2
Thanks to @ckipp01 it's now possible to run test or main classes inside the current file.
The Metals PR that added this functionality is scalameta/metals#2532