Skip to content

Commit c7a5a21

Browse files
author
Deep Furiya
committed
rev-3 fixed entire deletion of document with just deleting the indentation setting
1 parent 10818d2 commit c7a5a21

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/document/DocumentManager.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,14 @@ export class DocumentManager implements Configurable {
104104
return document.getEditorSettings(this.editorSettings);
105105
}
106106

107-
clearIndentationForDocument(uri: string): void {
108-
const document = this.documentMap.get(uri);
109-
if (document) {
110-
document.clearIndentation();
111-
this.documentMap.delete(uri);
112-
}
107+
removeDocument(uri: string): void {
108+
this.documentMap.delete(uri);
113109
}
114110

115111
clearAllStoredIndentation(): void {
116112
for (const document of this.documentMap.values()) {
117113
document.clearIndentation();
118114
}
119-
this.documentMap.clear();
120115
}
121116

122117
private onEditorSettingsChanged(newEditorSettings: EditorSettings): void {

src/handlers/DocumentHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ export function didCloseHandler(components: ServerComponents): (event: TextDocum
131131
// Cancel any pending delayed Guard validation for this document
132132
components.guardService.cancelDelayedValidation(documentUri);
133133

134-
// Clear stored indentation detection for this document
135-
components.documentManager.clearIndentationForDocument(documentUri);
134+
// Remove document from DocumentManager map
135+
components.documentManager.removeDocument(documentUri);
136136

137137
components.syntaxTreeManager.deleteSyntaxTree(documentUri);
138138

0 commit comments

Comments
 (0)