-
Notifications
You must be signed in to change notification settings - Fork 645
Add a command to execute the previous test #478
Conversation
@lukehoban do you have any idea what's up with those Travis failures? |
@ironcladlou The test for gometalinter tries to set the user settings for
which fails with the latest version of VSCode as you can no longer update config that way. Interestingly the comment for the above config in vscode.d.ts says it is a readonly dictionary, though it has been writable till the last release There have been changes to the configuration service in VS Code in August and more to come in September Logged #479 |
@@ -72,6 +72,11 @@ export function activate(ctx: vscode.ExtensionContext): void { | |||
testCurrentFile(goConfig['testTimeout']); | |||
})); | |||
|
|||
ctx.subscriptions.push(vscode.commands.registerCommand('go.test.previous', () => { | |||
let goConfig = vscode.workspace.getConfiguration('go'); | |||
testPrevious(); |
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.
Do you intend to pass testTimeout
here as in other test commands? Or to not use goConfig
?
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.
Actually - looks like you are intentionally not passing testTimeout
- so should drop the goConfig
line.
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.
I intentionally disregard any settings as the intent of the command is to repeat the last test exactly as it was previously executed. I can imagine how you might want your timeout setting to override whatever's stored, but I wanted to keep it simple. Thoughts?
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.
Removed the config lookup for now.
*/ | ||
export function testPrevious() { | ||
let editor = vscode.window.activeTextEditor; | ||
if (!editor) { |
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.
Why does an editor need to be active in this case? It sounds like the semantics for this command are not tied to what is in the current editor (if there is one). It just executes whatever the last Go test was that was invoked.
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.
You're right, I'll remove that check.
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.
Removed the editor check.
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.
A couple of cleanup things but the new command looks good.
@ramya-rao-a, thanks for tracking down that Travis issue! |
Added a small commit to rename the title of the command to something more auto-complete friendly (as a complement to #495). |
136e2dd
to
4d802da
Compare
Squashed commits. |
Will this be merged? |
Sure, I tested your changes and they look good. Could you trigger another travis runs so that the tests are all green? The last time it failed due to an upstream issue with vscode-debugadapter |
@ramya-rao-a Thanks! How do I trigger a new build without making some dummy commit? |
Add a `go.test.previous` command that runs the last test which was executed.
4d802da
to
0677cf6
Compare
Add a
go.test.previous
command which runs the last test which wasexecuted.