Filter more unused warnings from compile errors in kvscode

This commit is contained in:
2021-12-14 18:22:13 -07:00
parent 1d9ba02e65
commit c63d6a384c
2 changed files with 5 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
(when (FileSystem.exists lastConfigDir)
(FileSystem.rename lastConfigDir activeConfigDir))
// When user config fails to build, use the default
// Counterintuitively, this unless is correct:
(unless fallbackToDefault
(warningMessage "Falling back to the default Kiss-VSCode Config")
(unless config

View File

@@ -102,7 +102,8 @@
null)))))
(function :Void showCompileError [errorMessage]
(ifLet [compileErrors (R.distinctMatches
(ifLet [errorMessage (.join (filter (errorMessage.split "\n") ->[:String l] (= -1 (l.indexOf "This case is unused"))) "\n")
compileErrors (R.distinctMatches
(R.group
(R.namedGroup "file"
(R.repeat (R.oneOf R.anyLetter R.anyDigit (R.escape "/")) 1) // filename
@@ -117,7 +118,8 @@
errorMessage)]
{
(Vscode.window.showErrorMessage errorMessage)
(awaitLet [chosen (quickPickMap (for match (filter compileErrors ->match (= -1 (match.match.indexOf "This case is unused"))) =>match.match match))]
(awaitLet [chosen (quickPickMap (for match compileErrors =>match.match match))]
(Vscode.window.showErrorMessage chosen.match)
(executeCommand "workbench.action.quickOpen" (substr (chosen.namedGroup "file") 0 -1)))
}
(Vscode.window.showErrorMessage errorMessage)))