Skip to content

Commit

Permalink
fix: decode uri path for notifications (#249)
Browse files Browse the repository at this point in the history
Signed-off-by: Ilona Shishov <[email protected]>
  • Loading branch information
IlonaShishov authored Apr 4, 2024
1 parent d91b75d commit 13676d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/componentAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AnalysisResponse implements IAnalysisResponse {
connection.console.warn(`Component Analysis Error: ${errMsg}`);
connection.sendNotification('caError', {
errorMessage: errMsg,
uri: diagnosticFilePath,
uri: decodeUriPath(diagnosticFilePath),
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/diagnosticsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

import { Diagnostic } from 'vscode-languageserver';

import { DependencyMap, IDependencyProvider, getRange } from './collector';
import { DependencyMap, IDependencyProvider, getRange, IPositionedContext } from './collector';
import { executeComponentAnalysis, DependencyData } from './componentAnalysis';
import { Vulnerability } from './vulnerability';
import { connection } from './server';
import { VERSION_PLACEHOLDER } from './constants';
import { clearCodeActionsMap, registerCodeAction, generateSwitchToRecommendedVersionAction } from './codeActionHandler';
import { IPositionedContext } from './collector';
import { decodeUriPath } from './utils';

/**
* Diagnostics Pipeline specification.
Expand Down Expand Up @@ -50,14 +50,14 @@ class DiagnosticsPipeline implements IDiagnosticsPipeline {
connection.sendDiagnostics({ uri: this.diagnosticFilePath, diagnostics: [] });
connection.sendNotification('caNotification', {
done: false,
uri: this.diagnosticFilePath,
uri: decodeUriPath(this.diagnosticFilePath),
});
}

reportDiagnostics() {
connection.sendNotification('caNotification', {
done: true,
uri: this.diagnosticFilePath,
uri: decodeUriPath(this.diagnosticFilePath),
diagCount: this.diagnostics.length,
vulnCount: this.vulnCount,
});
Expand Down Expand Up @@ -143,7 +143,7 @@ async function performDiagnostics(diagnosticFilePath: string, contents: string,
connection.console.warn(`Component Analysis Error: ${error}`);
connection.sendNotification('caError', {
errorMessage: error.message,
uri: diagnosticFilePath,
uri: decodeUriPath(diagnosticFilePath),
});
}
}
Expand Down

0 comments on commit 13676d0

Please sign in to comment.