@@ -50,25 +50,25 @@ describe("DocumentRegistry", () => {
5050 } ) ;
5151
5252 it ( "Acquiring document gets correct version 2" , ( ) => {
53- debugger ;
5453 var documentRegistry = ts . createDocumentRegistry ( ) ;
5554 var defaultCompilerOptions = ts . getDefaultCompilerOptions ( ) ;
5655
5756 var contents = "var x = 1;"
5857 var snapshot = ts . ScriptSnapshot . fromString ( contents ) ;
5958
59+ // Always treat any change as a full change.
60+ snapshot . getChangeRange = old => ts . createTextChangeRange ( ts . createTextSpan ( 0 , contents . length ) , contents . length ) ;
61+
6062 // Simulate one LS getting the document.
6163 var f1 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "1" ) ;
6264
6365 // Simulate another LS getting that document.
6466 var f2 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "1" ) ;
6567
6668 // Now LS1 updates their document.
67- var f3 = documentRegistry . updateDocument ( f1 , "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "2" ,
68- ts . createTextChangeRange ( ts . createTextSpan ( 0 , contents . length ) , contents . length ) ) ;
69+ var f3 = documentRegistry . updateDocument ( "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "2" ) ;
6970
7071 // Now LS2 tries to update their document.
71- var f4 = documentRegistry . updateDocument ( f1 , "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "3" ,
72- ts . createTextChangeRange ( ts . createTextSpan ( 0 , contents . length ) , contents . length ) ) ;
72+ var f4 = documentRegistry . updateDocument ( "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "3" ) ;
7373 } ) ;
7474} ) ;
0 commit comments