From b707b067a1974c8875729fd34950929c761113d4 Mon Sep 17 00:00:00 2001 From: Erika Date: Tue, 12 Mar 2024 14:11:09 +0000 Subject: [PATCH] [ci] format --- packages/language-server/src/languageServerPlugin.ts | 8 ++------ packages/language-server/src/nodeServer.ts | 11 +++++------ packages/vscode/src/client.ts | 10 +++++----- packages/vscode/syntaxes/astro.tmLanguage.json | 4 +--- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/packages/language-server/src/languageServerPlugin.ts b/packages/language-server/src/languageServerPlugin.ts index 426ab6c9..c69e719a 100644 --- a/packages/language-server/src/languageServerPlugin.ts +++ b/packages/language-server/src/languageServerPlugin.ts @@ -25,7 +25,7 @@ import { create as createTypeScriptService } from './plugins/typescript/index.js export function createServerOptions( connection: Connection, - ts: typeof import("typescript") + ts: typeof import('typescript') ): ServerOptions { return { watchFileExtensions: [ @@ -64,11 +64,7 @@ export function createServerOptions( const rootPath = projectContext.typescript.configFileName ? projectContext.typescript.configFileName.split('/').slice(0, -1).join('/') : serviceEnv.typescript!.uriToFileName(serviceEnv.workspaceFolder); - const nearestPackageJson = ts.findConfigFile( - rootPath, - ts.sys.fileExists, - 'package.json' - ); + const nearestPackageJson = ts.findConfigFile(rootPath, ts.sys.fileExists, 'package.json'); const astroInstall = getAstroInstall([rootPath], { nearestPackageJson: nearestPackageJson, diff --git a/packages/language-server/src/nodeServer.ts b/packages/language-server/src/nodeServer.ts index 6a83f6c2..af9390fe 100644 --- a/packages/language-server/src/nodeServer.ts +++ b/packages/language-server/src/nodeServer.ts @@ -12,16 +12,15 @@ const server = createServer(connection); connection.listen(); connection.onInitialize((params) => { - const tsdk = params.initializationOptions?.typescript?.tsdk + const tsdk = params.initializationOptions?.typescript?.tsdk; if (!tsdk) { - throw new Error('The `typescript.tsdk` init option is required. It should point to a directory containing a `typescript.js` or `tsserverlibrary.js` file, such as `node_modules/typescript/lib`.'); + throw new Error( + 'The `typescript.tsdk` init option is required. It should point to a directory containing a `typescript.js` or `tsserverlibrary.js` file, such as `node_modules/typescript/lib`.' + ); } - const {typescript, diagnosticMessages} = loadTsdkByPath( - tsdk, - params.locale - ) + const { typescript, diagnosticMessages } = loadTsdkByPath(tsdk, params.locale); return server.initialize( params, diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts index d6640ed2..8b24c40e 100644 --- a/packages/vscode/src/client.ts +++ b/packages/vscode/src/client.ts @@ -9,7 +9,7 @@ import { activateTsConfigStatusItem, activateTsVersionStatusItem, createLabsInfo, - getTsdk + getTsdk, } from '@volar/vscode'; import * as vscode from 'vscode'; import * as lsp from 'vscode-languageclient/node'; @@ -72,7 +72,7 @@ export async function activate(context: vscode.ExtensionContext): Promise text ); - const volarLabs = createLabsInfo(protocol) - volarLabs.addLanguageClient(client) + const volarLabs = createLabsInfo(protocol); + volarLabs.addLanguageClient(client); - return volarLabs.extensionExports + return volarLabs.extensionExports; } export function deactivate(): Thenable | undefined { diff --git a/packages/vscode/syntaxes/astro.tmLanguage.json b/packages/vscode/syntaxes/astro.tmLanguage.json index 5de6aeec..36918168 100644 --- a/packages/vscode/syntaxes/astro.tmLanguage.json +++ b/packages/vscode/syntaxes/astro.tmLanguage.json @@ -1,9 +1,7 @@ { "name": "Astro", "scopeName": "source.astro", - "fileTypes": [ - "astro" - ], + "fileTypes": ["astro"], "injections": { "L:(meta.script.astro) (meta.lang.json) - (meta source)": { "patterns": [