@@ -1760,6 +1760,28 @@ namespace ts.projectSystem {
1760
1760
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path , file3 . path ] ) ;
1761
1761
} ) ;
1762
1762
1763
+ it ( "regression test for crash in acquireOrUpdateDocument" , ( ) => {
1764
+ const tsFile = {
1765
+ fileName : "/a/b/file1.ts" ,
1766
+ path : "/a/b/file1.ts" ,
1767
+ content : ""
1768
+ } ;
1769
+ const jsFile = {
1770
+ path : "/a/b/file1.js" ,
1771
+ content : "var x = 10;" ,
1772
+ fileName : "/a/b/file1.js" ,
1773
+ scriptKind : "JS" as "JS"
1774
+ } ;
1775
+
1776
+ const host = createServerHost ( [ ] ) ;
1777
+ const projectService = createProjectService ( host ) ;
1778
+ projectService . applyChangesInOpenFiles ( [ tsFile ] , [ ] , [ ] ) ;
1779
+ const projs = projectService . synchronizeProjectList ( [ ] ) ;
1780
+ projectService . findProject ( projs [ 0 ] . info . projectName ) . getLanguageService ( ) . getNavigationBarItems ( tsFile . fileName ) ;
1781
+ projectService . synchronizeProjectList ( [ projs [ 0 ] . info ] ) ;
1782
+ projectService . applyChangesInOpenFiles ( [ jsFile ] , [ ] , [ ] ) ;
1783
+ } ) ;
1784
+
1763
1785
it ( "config file is deleted" , ( ) => {
1764
1786
const file1 = {
1765
1787
path : "/a/b/f1.ts" ,
@@ -1860,7 +1882,7 @@ namespace ts.projectSystem {
1860
1882
1861
1883
// Open HTML file
1862
1884
projectService . applyChangesInOpenFiles (
1863
- /*openFiles*/ [ { fileName : file2 . path , hasMixedContent : true , scriptKind : ScriptKind . JS , content : `var hello = "hello";` } ] ,
1885
+ /*openFiles*/ [ { fileName : file2 . path , hasMixedContent : true , scriptKind : ScriptKind . JS , content : `var hello = "hello";` } ] ,
1864
1886
/*changedFiles*/ undefined ,
1865
1887
/*closedFiles*/ undefined ) ;
1866
1888
@@ -1877,7 +1899,7 @@ namespace ts.projectSystem {
1877
1899
projectService . applyChangesInOpenFiles (
1878
1900
/*openFiles*/ undefined ,
1879
1901
/*changedFiles*/ undefined ,
1880
- /*closedFiles*/ [ file2 . path ] ) ;
1902
+ /*closedFiles*/ [ file2 . path ] ) ;
1881
1903
1882
1904
// HTML file is still included in project
1883
1905
checkNumberOfProjects ( projectService , { configuredProjects : 1 } ) ;
@@ -3308,7 +3330,7 @@ namespace ts.projectSystem {
3308
3330
const error1Result = < protocol . Diagnostic [ ] > session . executeCommand ( dTsFile1GetErrRequest ) . response ;
3309
3331
assert . isTrue ( error1Result . length === 0 ) ;
3310
3332
3311
- const dTsFile2GetErrRequest = makeSessionRequest < protocol . SemanticDiagnosticsSyncRequestArgs > (
3333
+ const dTsFile2GetErrRequest = makeSessionRequest < protocol . SemanticDiagnosticsSyncRequestArgs > (
3312
3334
CommandNames . SemanticDiagnosticsSync ,
3313
3335
{ file : dTsFile2 . path }
3314
3336
) ;
0 commit comments