@@ -1799,7 +1799,6 @@ namespace ts.projectSystem {
17991799 } ) ;
18001800
18011801 it ( "language service disabled state is updated in external projects" , ( ) => {
1802- debugger
18031802 const f1 = {
18041803 path : "/a/app.js" ,
18051804 content : "var x = 1"
@@ -1940,6 +1939,32 @@ namespace ts.projectSystem {
19401939 const edits = project . getLanguageService ( ) . getFormattingEditsForDocument ( f1 . path , options ) ;
19411940 assert . deepEqual ( edits , [ { span : createTextSpan ( /*start*/ 7 , /*length*/ 3 ) , newText : " " } ] ) ;
19421941 } ) ;
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+ debugger
1949+ const host = createServerHost ( [ f1 ] ) ;
1950+ const projectFileName = "/a/b/proj.csproj" ;
1951+ const projectService = createProjectService ( host ) ;
1952+ projectService . openExternalProject ( {
1953+ projectFileName,
1954+ rootFiles : [ toExternalFile ( f1 . path ) ] ,
1955+ options : { }
1956+ } )
1957+ projectService . openClientFile ( f1 . path , "let x = 1;\nlet y = 2;" ) ;
1958+
1959+ projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
1960+ projectService . externalProjects [ 0 ] . getLanguageService ( /*ensureSynchronized*/ false ) . getNavigationBarItems ( f1 . path ) ;
1961+ projectService . closeClientFile ( f1 . path ) ;
1962+
1963+ projectService . openClientFile ( f1 . path ) ;
1964+ projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
1965+ const navbar = projectService . externalProjects [ 0 ] . getLanguageService ( /*ensureSynchronized*/ false ) . getNavigationBarItems ( f1 . path ) ;
1966+ assert . equal ( navbar [ 0 ] . spans [ 0 ] . length , f1 . content . length ) ;
1967+ } ) ;
19431968 } ) ;
19441969
19451970 describe ( "Proper errors" , ( ) => {
0 commit comments