Skip to content

Commit 0fc9512

Browse files
authored
Update diagnostics parsing to handle new warnings (#1440)
Starting with Swift 6.2 some warnings may end with a tag such as [#no-usage]. Update parsing logic to remove these tags from the warnings to ensure we can combine them with the warnings from SourceKit. Issue: #1434
1 parent 2735bc3 commit 0fc9512

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DiagnosticsManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export class DiagnosticsManager implements vscode.Disposable {
374374
): ParsedDiagnostic | vscode.DiagnosticRelatedInformation | undefined {
375375
const diagnosticRegex =
376376
/^(?:\S+\s+)?(.*?):(\d+)(?::(\d+))?:\s+(warning|error|note):\s+(.*)$/g;
377-
const switfcExtraWarningsRegex = /\[-W.*?\]/g;
377+
const switfcExtraWarningsRegex = /\[(-W|#).*?\]/g;
378378
const match = diagnosticRegex.exec(line);
379379
if (!match) {
380380
return;

0 commit comments

Comments
 (0)