@@ -38,7 +38,6 @@ import { PLAINTEXT_LANGUAGE_ID } from '../../../../editor/common/languages/modes
38
38
import { createStyleSheet2 } from '../../../../base/browser/domStylesheets.js' ;
39
39
import { stringValue } from '../../../../base/browser/cssValue.js' ;
40
40
import { observableConfigValue } from '../../../../platform/observable/common/platformObservableUtils.js' ;
41
- import { Emitter } from '../../../../base/common/event.js' ;
42
41
import { ChatAgentLocation } from '../../chat/common/constants.js' ;
43
42
import { INSTRUCTIONS_LANGUAGE_ID , PROMPT_LANGUAGE_ID } from '../../chat/common/promptSyntax/constants.js' ;
44
43
import { MODE_FILE_EXTENSION } from '../../../../platform/prompts/common/prompts.js' ;
@@ -242,7 +241,7 @@ export class InlineChatHintsController extends Disposable implements IEditorCont
242
241
const ghostState = ghostCtrl ?. model . read ( r ) ?. state . read ( r ) ;
243
242
244
243
const textFocus = editorObs . isTextFocused . read ( r ) ;
245
- let position = editorObs . cursorPosition . read ( r ) ;
244
+ const position = editorObs . cursorPosition . read ( r ) ;
246
245
const model = editorObs . model . read ( r ) ;
247
246
248
247
const kb = keyObs . read ( r ) ;
@@ -255,14 +254,7 @@ export class InlineChatHintsController extends Disposable implements IEditorCont
255
254
return undefined ;
256
255
}
257
256
258
- // DEBT - I cannot use `model.onDidChangeContent` directly here
259
- // https://github.com/microsoft/vscode/issues/242059
260
- const emitter = r . store . add ( new Emitter < void > ( ) ) ;
261
- r . store . add ( model . onDidChangeContent ( ( ) => emitter . fire ( ) ) ) ;
262
- observableFromEvent ( emitter . event , ( ) => model . getVersionId ( ) ) . read ( r ) ;
263
-
264
- // position can be wrong
265
- position = model . validatePosition ( position ) ;
257
+ editorObs . versionId . read ( r ) ;
266
258
267
259
const visible = this . _visibilityObs . read ( r ) ;
268
260
const isEol = model . getLineMaxColumn ( position . lineNumber ) === position . column ;
0 commit comments