Skip to content

Commit 980cdbc

Browse files
author
Arvid Paeglit
committed
Bugfix: inadequate reactions in suggestion tree when files are changing rapidly.
Removed filePathInworkspace and use absolute path instead
1 parent bd31daa commit 980cdbc

File tree

4 files changed

+2
-10
lines changed

4 files changed

+2
-10
lines changed

src/deepcode/lib/analyzer/DeepCodeAnalyzer.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ class DeepCodeAnalyzer implements AnalyzerInterface {
181181
return;
182182
}
183183
const fileIssuesList: IFilePath = updateFileReviewResultsPositions(this.analysisResults, updatedFile);
184-
// Opening a project directory instead of a workspace leads to empty updatedFile.workspace field
185-
const workspace = updatedFile.workspace;
186-
const filepath = updatedFile.filePathInWorkspace || updatedFile.fullPath.replace(workspace, '');
187-
this.analysisResults.files[filepath] = { ...fileIssuesList };
188184
if (this.deepcodeReview) {
189185
const issues = this.createIssuesList({
190186
fileIssuesList,
@@ -199,7 +195,7 @@ class DeepCodeAnalyzer implements AnalyzerInterface {
199195
message: errorsLogs.updateReviewPositions,
200196
bundleId: extension.remoteBundle.bundleId,
201197
data: {
202-
[updatedFile.filePathInWorkspace]: updatedFile.contentChanges,
198+
[updatedFile.fullPath]: updatedFile.contentChanges,
203199
},
204200
});
205201
}

src/deepcode/lib/watchers/EditorsWatcher.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class DeepCodeEditorsWatcher implements DeepCodeWatcherInterface {
1616
this.currentTextEditors[editor.document.fileName] = {
1717
fullPath: path,
1818
workspace: workspacePath || '',
19-
filePathInWorkspace: workspacePath ? editor.document.fileName.split(workspacePath)[1] : '',
2019
lineCount: {
2120
current: editor.document.lineCount,
2221
prevOffset: 0,

src/deepcode/utils/analysisUtils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@ export const updateFileReviewResultsPositions = (
9999
const offsetedline = changesRange.start.line + 1;
100100
const charOffset = 1;
101101

102-
const workspace = updatedFile.workspace;
103-
const filepath = updatedFile.filePathInWorkspace || updatedFile.fullPath.replace(workspace, '');
104102
const fileIssuesList = {
105-
...analysisResults.files[filepath],
103+
...analysisResults.files[updatedFile.fullPath],
106104
};
107105
for (const issue in fileIssuesList) {
108106
for (const [index, position] of fileIssuesList[issue].entries()) {

src/interfaces/DeepCodeInterfaces.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export type completeFileSuggestionType = ISuggestion & IFileSuggestion & {
100100
export type openedTextEditorType = {
101101
fullPath: string;
102102
workspace: string;
103-
filePathInWorkspace: string;
104103
lineCount: {
105104
current: number;
106105
prevOffset: number;

0 commit comments

Comments
 (0)