@@ -15,7 +15,7 @@ import { mapObservableArrayCached } from '../../../util/vs/base/common/observabl
1515import { AnnotatedStringReplacement , StringEdit , StringReplacement } from '../../../util/vs/editor/common/core/edits/stringEdit' ;
1616import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange' ;
1717import { StringText } from '../../../util/vs/editor/common/core/text/abstractText' ;
18- import { checkEditConsistency , EditDataWithIndex , NesRebaseConfigs , tryRebase } from '../common/editRebase' ;
18+ import { checkEditConsistency , EditDataWithIndex , tryRebase } from '../common/editRebase' ;
1919import { NextEditFetchRequest } from './nextEditProvider' ;
2020
2121export interface CachedEditOpts {
@@ -62,8 +62,8 @@ export class NextEditCache extends Disposable {
6262 constructor (
6363 public readonly workspace : ObservableWorkspace ,
6464 private readonly _logService : ILogService ,
65- private readonly _configService : IConfigurationService ,
66- private readonly _expService : IExperimentationService ,
65+ configService : IConfigurationService ,
66+ expService : IExperimentationService ,
6767 ) {
6868 super ( ) ;
6969
@@ -81,7 +81,7 @@ export class NextEditCache extends Disposable {
8181 }
8282 // if editor-change triggering is allowed,
8383 // it means an edit in file A can result in a cached edit for file B to be less relevant than with the edits in file A included
84- if ( this . _configService . getExperimentBasedConfig ( ConfigKey . Advanced . InlineEditsTriggerOnEditorChangeAfterSeconds , this . _expService ) !== undefined ) {
84+ if ( configService . getExperimentBasedConfig ( ConfigKey . Advanced . InlineEditsTriggerOnEditorChangeAfterSeconds , expService ) !== undefined ) {
8585 for ( const [ k , v ] of this . _sharedCache . entries ( ) ) {
8686 if ( v . docId !== doc . id ) {
8787 this . _sharedCache . deleteKey ( k ) ;
@@ -112,26 +112,20 @@ export class NextEditCache extends Disposable {
112112 docCache . setNoNextEdit ( documentContents , editWindow , source ) ;
113113 }
114114
115- private _getNesRebaseConfigs ( ) : NesRebaseConfigs {
116- return {
117- absorbSubsequenceTyping : this . _configService . getExperimentBasedConfig ( ConfigKey . TeamInternal . InlineEditsAbsorbSubsequenceTyping , this . _expService ) ,
118- } ;
119- }
120-
121115 public lookupNextEdit ( docId : DocumentId , currentDocumentContents : StringText , currentSelection : readonly OffsetRange [ ] ) : CachedOrRebasedEdit | undefined {
122116 const docCache = this . _documentCaches . get ( docId ) ;
123117 if ( ! docCache ) {
124118 return undefined ;
125119 }
126- return docCache . lookupNextEdit ( currentDocumentContents , currentSelection , this . _getNesRebaseConfigs ( ) ) ;
120+ return docCache . lookupNextEdit ( currentDocumentContents , currentSelection ) ;
127121 }
128122
129123 public tryRebaseCacheEntry ( cachedEdit : CachedEdit , currentDocumentContents : StringText , currentSelection : readonly OffsetRange [ ] ) : CachedOrRebasedEdit | undefined {
130124 const docCache = this . _documentCaches . get ( cachedEdit . docId ) ;
131125 if ( ! docCache ) {
132126 return undefined ;
133127 }
134- return docCache . tryRebaseCacheEntry ( cachedEdit , currentDocumentContents , currentSelection , this . _getNesRebaseConfigs ( ) ) ;
128+ return docCache . tryRebaseCacheEntry ( cachedEdit , currentDocumentContents , currentSelection ) ;
135129 }
136130
137131 public rejectedNextEdit ( requestId : string ) : void {
@@ -234,7 +228,7 @@ class DocumentEditCache {
234228 }
235229 }
236230
237- public lookupNextEdit ( currentDocumentContents : StringText , currentSelection : readonly OffsetRange [ ] , nesRebaseConfigs : NesRebaseConfigs ) : CachedOrRebasedEdit | undefined {
231+ public lookupNextEdit ( currentDocumentContents : StringText , currentSelection : readonly OffsetRange [ ] ) : CachedOrRebasedEdit | undefined {
238232 // TODO@chrmarti : Update entries i > 1 with user edits and edit window and start tracking.
239233 const key = this . _getKey ( currentDocumentContents . value ) ;
240234 const cachedEdit = this . _sharedCache . get ( key ) ;
@@ -252,15 +246,15 @@ class DocumentEditCache {
252246 return cachedEdit ;
253247 }
254248 for ( const cachedEdit of this . _trackedCachedEdits ) {
255- const rebased = this . tryRebaseCacheEntry ( cachedEdit , currentDocumentContents , currentSelection , nesRebaseConfigs ) ;
249+ const rebased = this . tryRebaseCacheEntry ( cachedEdit , currentDocumentContents , currentSelection ) ;
256250 if ( rebased ) {
257251 return rebased ;
258252 }
259253 }
260254 return undefined ;
261255 }
262256
263- public tryRebaseCacheEntry ( cachedEdit : CachedEdit , currentDocumentContents : StringText , currentSelection : readonly OffsetRange [ ] , nesRebaseConfigs : NesRebaseConfigs ) : CachedEdit | undefined {
257+ public tryRebaseCacheEntry ( cachedEdit : CachedEdit , currentDocumentContents : StringText , currentSelection : readonly OffsetRange [ ] ) : CachedEdit | undefined {
264258 const logger = this . _logger . createSubLogger ( 'tryRebaseCacheEntry' ) ;
265259 if ( cachedEdit . userEditSince && ! cachedEdit . rebaseFailed ) {
266260 const originalEdits = cachedEdit . edits || ( cachedEdit . edit ? [ cachedEdit . edit ] : [ ] ) ;
@@ -273,7 +267,7 @@ class DocumentEditCache {
273267 : [ cachedEdit . editWindow ] ;
274268
275269 for ( const window of windowsToTry ) {
276- const res = tryRebase ( cachedEdit . documentBeforeEdit . value , window , originalEdits , cachedEdit . detailedEdits , cachedEdit . userEditSince , currentDocumentContents . value , currentSelection , 'strict' , logger , nesRebaseConfigs ) ;
270+ const res = tryRebase ( cachedEdit . documentBeforeEdit . value , window , originalEdits , cachedEdit . detailedEdits , cachedEdit . userEditSince , currentDocumentContents . value , currentSelection , 'strict' , logger ) ;
277271 if ( res === 'rebaseFailed' ) {
278272 cachedEdit . rebaseFailed = true ;
279273 return undefined ;
0 commit comments