File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,7 +191,8 @@ export class ProblemsDiagnosticCollection implements vscode.Disposable {
191191
192192 if ( ! isCliInstalled || ! codacyConfigExists ) return
193193
194- let pathToFile = document . uri . fsPath
194+ const originalPath = document . uri . fsPath
195+ let pathToFile = originalPath
195196
196197 try {
197198 this . _isAnalysisRunning = true
@@ -222,15 +223,15 @@ export class ProblemsDiagnosticCollection implements vscode.Disposable {
222223 // Run the local analysis
223224 const results = await runCodacyAnalyze ( pathToFile )
224225
225- this . _currentCliIssues [ document . uri . fsPath ] = results
226+ this . _currentCliIssues [ originalPath ] = results
226227
227228 this . updateDocumentDiagnostics ( document )
228229 } catch ( error ) {
229230 console . error ( 'Failed to process Codacy analysis:' , error )
230231 } finally {
231232 this . _isAnalysisRunning = false
232233
233- if ( document . isDirty ) {
234+ if ( document . isDirty && pathToFile !== originalPath ) {
234235 // Remove the temporary file after analysis with retries
235236 const deleted = await this . retryDeleteFile ( pathToFile )
236237 if ( ! deleted ) {
You can’t perform that action at this time.
0 commit comments