File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,6 +223,13 @@ it.effect(
223223 title : "No project" ,
224224 workspaceRoot : resolvedRealRoot ,
225225 } ) ;
226+ // The empty duplicate older servers created under the configured spelling.
227+ yield * projects . create ( {
228+ commandId : CommandId . make ( "no-project-duplicate" ) ,
229+ projectId : ProjectId . make ( "project:no-project-duplicate" ) ,
230+ title : "No project" ,
231+ workspaceRoot : root ,
232+ } ) ;
226233
227234 assert . isTrue ( yield * scratch . isScratchProject ( projectId ) ) ;
228235 assert . equal ( ( yield * scratch . ensureScratchProject ) . projectId , projectId ) ;
@@ -236,7 +243,7 @@ it.effect(
236243 const snapshot = yield * projects . snapshot ;
237244 assert . lengthOf (
238245 snapshot . projects . filter ( ( project ) => project . title === "No project" ) ,
239- 1 ,
246+ 2 ,
240247 ) ;
241248 } ) ,
242249 ) ,
Original file line number Diff line number Diff line change @@ -278,11 +278,12 @@ const make = Effect.gen(function* () {
278278 . pipe ( Effect . mapError ( ( cause ) => new ScratchFolderError ( { folder, cause } ) ) ) ;
279279
280280 // A symlinked scratch folder has two spellings, and No project may be stored under either.
281+ // Real path first: older servers left an empty duplicate under the configured spelling.
281282 const realPathOrResolved = ( folder : string ) =>
282283 fileSystem . realPath ( folder ) . pipe ( Effect . orElseSucceed ( ( ) => path . resolve ( folder ) ) ) ;
283284
284285 const scratchRootSpellings = ( root : string ) =>
285- realPathOrResolved ( root ) . pipe ( Effect . map ( ( real ) => ( real === root ? [ root ] : [ root , real ] ) ) ) ;
286+ realPathOrResolved ( root ) . pipe ( Effect . map ( ( real ) => ( real === root ? [ root ] : [ real , root ] ) ) ) ;
286287
287288 const existingScratchProject = Effect . fn ( "ManagedProjectFolders.existingScratchProject" ) (
288289 function * ( root : string ) {
You can’t perform that action at this time.
0 commit comments