From 4803a93b572e75d186c94b1ba81dfdf42a2fa3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Nied=C5=BAwiedzi=C5=84ski?= Date: Sat, 20 Oct 2018 12:54:54 +0200 Subject: [PATCH 1/3] Add macOS pattern I found that only line link works on mac so I split windows and mac patterns into two. --- src/util.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/util.js b/src/util.js index e1c8548..896a7ff 100644 --- a/src/util.js +++ b/src/util.js @@ -114,7 +114,7 @@ function searchAnnotations(workspaceState, pattern, callback) { }); } - + }, function (err) { errorHandler(err); }); @@ -179,21 +179,27 @@ function showOutputChannel(data) { data.forEach(function (v, i, a) { // due to an issue of vscode(https://github.com/Microsoft/vscode/issues/586), in order to make file path clickable within the output channel,the file path differs from platform - var patternA = '#' + (i + 1) + '\t' + v.uri + '#' + (v.lineNum + 1); - var patternB = '#' + (i + 1) + '\t' + v.uri + ':' + (v.lineNum + 1) + ':' + (v.startCol + 1); - var patterns = [patternA, patternB]; + var patternWindows = '#' + (i + 1) + '\t' + v.uri + '#' + (v.lineNum + 1); + var patternLinux = '#' + (i + 1) + '\t' + v.uri + ':' + (v.lineNum + 1) + ':' + (v.startCol + 1); + var patternMac = "#" + (i + 1) + "\t" + v.uri + ":" + (v.lineNum + 1); + var patterns = [patternWindows, patternLinux, patternMac]; - //for windows and mac + //for windows var patternType = 0; if (os.platform() == "linux") { // for linux patternType = 1; } + if (os.platform() == "darwin") { + // for mac + patternType = 2; + } if (toggleURI) { //toggle the pattern patternType = +!patternType; } - window.outputChannel.appendLine(patterns[patternType]); + window.outputChannel.appendLine(os.platform()); + window.outputChannel.appendLine(patterns[patternType]); window.outputChannel.appendLine('\t' + v.label + '\n'); }); window.outputChannel.show(); From 1cf25255e1983913a1ef1c1d94fa645876bf370a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Nied=C5=BAwiedzi=C5=84ski?= Date: Sat, 20 Oct 2018 12:57:47 +0200 Subject: [PATCH 2/3] Remove unnecasary appendLine --- src/util.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util.js b/src/util.js index 896a7ff..657dead 100644 --- a/src/util.js +++ b/src/util.js @@ -198,8 +198,7 @@ function showOutputChannel(data) { //toggle the pattern patternType = +!patternType; } - window.outputChannel.appendLine(os.platform()); - window.outputChannel.appendLine(patterns[patternType]); + window.outputChannel.appendLine(patterns[patternType]); window.outputChannel.appendLine('\t' + v.label + '\n'); }); window.outputChannel.show(); From b95ea47c05f30e0f8f09a13d9c720f5b22c03fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Nied=C5=BAwiedzi=C5=84ski?= Date: Sat, 20 Oct 2018 13:03:59 +0200 Subject: [PATCH 3/3] Fix indentation --- src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index 657dead..9a263eb 100644 --- a/src/util.js +++ b/src/util.js @@ -198,7 +198,7 @@ function showOutputChannel(data) { //toggle the pattern patternType = +!patternType; } - window.outputChannel.appendLine(patterns[patternType]); + window.outputChannel.appendLine(patterns[patternType]); window.outputChannel.appendLine('\t' + v.label + '\n'); }); window.outputChannel.show();