@@ -50,25 +50,25 @@ describe("DocumentRegistry", () => {
50
50
} ) ;
51
51
52
52
it ( "Acquiring document gets correct version 2" , ( ) => {
53
- debugger ;
54
53
var documentRegistry = ts . createDocumentRegistry ( ) ;
55
54
var defaultCompilerOptions = ts . getDefaultCompilerOptions ( ) ;
56
55
57
56
var contents = "var x = 1;"
58
57
var snapshot = ts . ScriptSnapshot . fromString ( contents ) ;
59
58
59
+ // Always treat any change as a full change.
60
+ snapshot . getChangeRange = old => ts . createTextChangeRange ( ts . createTextSpan ( 0 , contents . length ) , contents . length ) ;
61
+
60
62
// Simulate one LS getting the document.
61
63
var f1 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "1" ) ;
62
64
63
65
// Simulate another LS getting that document.
64
66
var f2 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , snapshot , /* version */ "1" ) ;
65
67
66
68
// 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" ) ;
69
70
70
71
// 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" ) ;
73
73
} ) ;
74
74
} ) ;
0 commit comments