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

Run test(s) in context #45

Merged
merged 15 commits into from
Apr 8, 2018
Merged

Run test(s) in context #45

merged 15 commits into from
Apr 8, 2018

Conversation

teamdynamiq
Copy link
Contributor

This adds a command to run test(s) depending on the context of the current cursor and open document.

The command can be executed by right clicking the editor or executing the keyboard shortcut (default is alt-r + alt-u)

image

Examples:

image

If the command is executed on line 10-13 it executes the dotnet test command for Xunittest.TestClass.Pass. If executed on line 7-9 it will run for Xunittest.TestClass. If it can't figure out which symbol is the matching one it will execute the test for the first symbol found in the file.

package.json Outdated
@@ -66,6 +66,10 @@
"dark": "resources/dark/run.svg"
}
},
{
"command": "dotnet-test-explorer.runTestInContext",
"title": "Run Test in context"
Copy link
Owner

Choose a reason for hiding this comment

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

Better name it Run .NET Core Test?

package.json Outdated
"editor/context": [
{
"command": "dotnet-test-explorer.runTestInContext",
"group": "dotnetTestExplorer@0"
Copy link
Owner

Choose a reason for hiding this comment

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

This context would only be shown when language is C#, F# or VB.NET

@janaka
Copy link
Collaborator

janaka commented Mar 27, 2018

Had a quick glance and seem good to me. What I mentioned in Gitter about supporting the same k/b shortcuts as Visual Studio, that would be great but I recall having conflicts with existing default shortcuts. Here they are if you can get it to work or align closer https://msdn.microsoft.com/en-us/library/da5kh0wa.aspx#bkmk_testexplorerGLOBAL

Will have a closer look at the PR later.

@stefanforsberg
Copy link
Collaborator

Shortcuts are tricky since what feels natural is largely what you're used to from before. If you come from vs the vs ones make sense, if you come from resharper the resharper ones make sense etc. The shortcuts are easily changeable in vscode and I have a feeling that people that care deeply about their shortcuts will change them to whatever makes sense to them regardless of what we set as a default value.

That's my gut feeling anyway.

@stefanforsberg stefanforsberg merged commit 8d398f8 into formulahendry:master Apr 8, 2018
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.

4 participants