Skip to content

Commit da08595

Browse files
authored
Revert "Clear selections on KclPlugin.updateDoc" (#9173)
This reverts commit 9b2ec4b.
1 parent a47cb98 commit da08595

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/editor/plugins/lsp/kcl/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,8 @@ export class KclPlugin implements PluginValue {
153153
}
154154

155155
if (!this.client.ready) return
156-
157-
const clearSelections = true // no reason to keep them after a manual edit
158156
// eslint-disable-next-line @typescript-eslint/no-floating-promises
159-
this.kclManager.executeCode(clearSelections)
157+
this.kclManager.executeCode()
160158
}
161159

162160
ensureDocUpdated() {

src/lang/KclManager.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ export class KclManager extends EventTarget {
722722
this._cancelTokens.set(key, true)
723723
})
724724
}
725-
async executeCode(clearSelections = false): Promise<void> {
725+
async executeCode(): Promise<void> {
726726
const ast = await this.safeParse(this.code)
727727

728728
if (!ast) {
@@ -743,13 +743,6 @@ export class KclManager extends EventTarget {
743743
this.dispatchEvent(new CustomEvent(KclManagerEvents.LongExecution, {}))
744744
}, this.longExecutionTimeMs)
745745

746-
if (clearSelections) {
747-
this._modelingSend({
748-
type: 'Set selection',
749-
data: { selection: undefined, selectionType: 'singleCodeCursor' },
750-
})
751-
}
752-
753746
return this.executeAst({ ast })
754747
}
755748

0 commit comments

Comments
 (0)