-
Notifications
You must be signed in to change notification settings - Fork 734
Accurately recognize fourslash test as submodule #2068
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,8 +58,13 @@ func getBaselineExtension(command string) string { | |
| } | ||
| } | ||
|
|
||
| func getBaselineOptions(command string) baseline.Options { | ||
| func getBaselineOptions(command string, testPath string) baseline.Options { | ||
| subfolder := "fourslash/" + normalizeCommandName(command) | ||
| if !isSubmoduleTest(testPath) { | ||
| return baseline.Options{ | ||
| Subfolder: subfolder, | ||
| } | ||
| } | ||
| switch command { | ||
| case "Smart Selection": | ||
| return baseline.Options{ | ||
|
|
@@ -229,6 +234,10 @@ func getBaselineOptions(command string) baseline.Options { | |
| } | ||
| } | ||
|
|
||
| func isSubmoduleTest(testPath string) bool { | ||
| return strings.Contains(testPath, "fourslash/tests/gen") || strings.Contains(testPath, "fourslash/tests/manual") | ||
| } | ||
|
Comment on lines
+237
to
+239
|
||
|
|
||
| func normalizeCommandName(command string) string { | ||
| words := strings.Fields(command) | ||
| command = strings.Join(words, "") | ||
|
|
||
This file was deleted.
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 was worried about this, but runtime.Callers always returns fourward slash paths, so it should work.
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.
Hadn't really thought about that, but I tested on Windows. 🙂