From bbcdd939d9a21e0a9998362e2462814c745b9ce8 Mon Sep 17 00:00:00 2001 From: "Lyu, Wei Da" Date: Mon, 23 Dec 2024 12:45:15 +0800 Subject: [PATCH] cleanup --- .../src/plugins/typescript/service.ts | 2 +- .../test/plugins/typescript/service.test.ts | 104 ------------------ 2 files changed, 1 insertion(+), 105 deletions(-) diff --git a/packages/language-server/src/plugins/typescript/service.ts b/packages/language-server/src/plugins/typescript/service.ts index e4d9a6280..fe2ff3a91 100644 --- a/packages/language-server/src/plugins/typescript/service.ts +++ b/packages/language-server/src/plugins/typescript/service.ts @@ -1406,7 +1406,7 @@ function getOrCreateDocumentRegistry( compilationSettings ); - // sourceFileOptions.impliedNodeFormat = format; + sourceFileOptions.impliedNodeFormat = format; } return acquireDocumentWithKey( diff --git a/packages/language-server/test/plugins/typescript/service.test.ts b/packages/language-server/test/plugins/typescript/service.test.ts index 656de8b5d..d2832bc33 100644 --- a/packages/language-server/test/plugins/typescript/service.test.ts +++ b/packages/language-server/test/plugins/typescript/service.test.ts @@ -332,110 +332,6 @@ describe('service', () => { ls.getService(); }); - it.skip('do not throw when ScriptKind changes before new service is created', async () => { - // testing this because the patch rely on ts implementation details - // and we want to be aware of the changes - - const dirPath = getRandomVirtualDirPath(testDir); - const { virtualSystem, lsDocumentContext, rootUris } = setup(); - const package1Path = path.join(dirPath, 'package1'); - const package2Path = path.join(dirPath, 'package2'); - - virtualSystem.writeFile( - path.join(package1Path, 'tsconfig.json'), - JSON.stringify({ - compilerOptions: { - allowJs: true - } - }) - ); - - virtualSystem.writeFile( - path.join(package2Path, 'tsconfig.json'), - JSON.stringify({ - compilerOptions: { - allowJs: true - } - }) - ); - - const usagePath = path.join(package1Path, 'usage.svelte'); - virtualSystem.writeFile( - usagePath, - '' - ); - - const libraryPath = path.join(package2Path, 'Library.svelte'); - virtualSystem.writeFile(libraryPath, ''); - - const lsLibrary = await getService(libraryPath, rootUris, lsDocumentContext); - lsLibrary.getService(); - - const documentLibrary = new Document( - pathToUrl(libraryPath), - virtualSystem.readFile(libraryPath)! - ); - documentLibrary.openedByClient = true; - documentLibrary.update(' ', 0, documentLibrary.getTextLength()); - lsLibrary.updateSnapshot(documentLibrary); - - - const lsUsage = await getService(usagePath, rootUris, lsDocumentContext); - lsUsage.getService(); - }); - - it.skip('do not throw when ScriptKind changes referenced service is updated', async () => { - // testing this because the patch rely on ts implementation details - // and we want to be aware of the changes - - const dirPath = getRandomVirtualDirPath(testDir); - const { virtualSystem, lsDocumentContext, rootUris } = setup(); - const package1Path = path.join(dirPath, 'package1'); - const package2Path = path.join(dirPath, 'package2'); - - virtualSystem.writeFile( - path.join(package1Path, 'tsconfig.json'), - JSON.stringify({ - compilerOptions: { - allowJs: true - } - }) - ); - - virtualSystem.writeFile( - path.join(package2Path, 'tsconfig.json'), - JSON.stringify({ - compilerOptions: { - allowJs: true - } - }) - ); - - const usagePath = path.join(package1Path, 'usage.svelte'); - virtualSystem.writeFile( - usagePath, - '' - ); - - const libraryPath = path.join(package2Path, 'Library.svelte'); - virtualSystem.writeFile(libraryPath, ''); - - const lsLibrary = await getService(libraryPath, rootUris, lsDocumentContext); - lsLibrary.getService().getProgram(); - const lsUsage = await getService(usagePath, rootUris, lsDocumentContext); - lsUsage.getService(); - - const documentLibrary = new Document( - pathToUrl(libraryPath), - virtualSystem.readFile(libraryPath)! - ); - documentLibrary.openedByClient = true; - documentLibrary.update(' ', 0, documentLibrary.getTextLength()); - lsLibrary.updateSnapshot(documentLibrary); - - lsLibrary.getService(); - }); - function createReloadTester( docContext: LanguageServiceDocumentContext, testAfterReload: (reloadingConfigs: string[]) => Promise