@@ -1799,7 +1799,6 @@ namespace ts.projectSystem {
1799
1799
} ) ;
1800
1800
1801
1801
it ( "language service disabled state is updated in external projects" , ( ) => {
1802
- debugger
1803
1802
const f1 = {
1804
1803
path : "/a/app.js" ,
1805
1804
content : "var x = 1"
@@ -1940,6 +1939,31 @@ namespace ts.projectSystem {
1940
1939
const edits = project . getLanguageService ( ) . getFormattingEditsForDocument ( f1 . path , options ) ;
1941
1940
assert . deepEqual ( edits , [ { span : createTextSpan ( /*start*/ 7 , /*length*/ 3 ) , newText : " " } ] ) ;
1942
1941
} ) ;
1942
+
1943
+ it ( "snapshot from different caches are incompatible" , ( ) => {
1944
+ const f1 = {
1945
+ path : "/a/b/app.ts" ,
1946
+ content : "let x = 1;"
1947
+ } ;
1948
+ const host = createServerHost ( [ f1 ] ) ;
1949
+ const projectFileName = "/a/b/proj.csproj" ;
1950
+ const projectService = createProjectService ( host ) ;
1951
+ projectService . openExternalProject ( {
1952
+ projectFileName,
1953
+ rootFiles : [ toExternalFile ( f1 . path ) ] ,
1954
+ options : { }
1955
+ } )
1956
+ projectService . openClientFile ( f1 . path , "let x = 1;\nlet y = 2;" ) ;
1957
+
1958
+ projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
1959
+ projectService . externalProjects [ 0 ] . getLanguageService ( /*ensureSynchronized*/ false ) . getNavigationBarItems ( f1 . path ) ;
1960
+ projectService . closeClientFile ( f1 . path ) ;
1961
+
1962
+ projectService . openClientFile ( f1 . path ) ;
1963
+ projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
1964
+ const navbar = projectService . externalProjects [ 0 ] . getLanguageService ( /*ensureSynchronized*/ false ) . getNavigationBarItems ( f1 . path ) ;
1965
+ assert . equal ( navbar [ 0 ] . spans [ 0 ] . length , f1 . content . length ) ;
1966
+ } ) ;
1943
1967
} ) ;
1944
1968
1945
1969
describe ( "Proper errors" , ( ) => {
0 commit comments