client.ts — astro Source File
Architecture documentation for client.ts, a typescript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 399ea951_6c03_e083_9630_2d53da33e239["client.ts"] c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"] 399ea951_6c03_e083_9630_2d53da33e239 --> c52a5f83_66e3_37d7_9ebb_767f7129bc62 f3cce8a9_2ebe_0e28_97dc_4324cd2846c8["protocol"] 399ea951_6c03_e083_9630_2d53da33e239 --> f3cce8a9_2ebe_0e28_97dc_4324cd2846c8 33f0a031_3b84_2e5f_6a93_8f4394195665["vscode"] 399ea951_6c03_e083_9630_2d53da33e239 --> 33f0a031_3b84_2e5f_6a93_8f4394195665 70f079fd_fc82_e0d7_40c3_85a23422d290["vscode"] 399ea951_6c03_e083_9630_2d53da33e239 --> 70f079fd_fc82_e0d7_40c3_85a23422d290 5afaa7be_ce47_2880_429f_deb9142cbbae["node"] 399ea951_6c03_e083_9630_2d53da33e239 --> 5afaa7be_ce47_2880_429f_deb9142cbbae style 399ea951_6c03_e083_9630_2d53da33e239 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import * as path from 'node:path';
import * as protocol from '@volar/language-server/protocol';
import type { LabsInfo } from '@volar/vscode';
import {
activateAutoInsertion,
activateFindFileReferences,
activateReloadProjects,
activateTsConfigStatusItem,
activateTsVersionStatusItem,
createLabsInfo,
getTsdk,
} from '@volar/vscode';
import * as vscode from 'vscode';
import * as lsp from 'vscode-languageclient/node';
let client: lsp.BaseLanguageClient;
type InitOptions = {
typescript: {
tsdk: string;
};
} & Record<string, unknown>;
export async function activate(context: vscode.ExtensionContext): Promise<LabsInfo> {
const runtimeConfig = vscode.workspace.getConfiguration('astro.language-server');
const { workspaceFolders } = vscode.workspace;
const rootPath = workspaceFolders?.[0].uri.fsPath;
let lsPath = await getConfiguredServerPath(context.workspaceState);
if (typeof lsPath === 'string' && lsPath.trim() !== '' && typeof rootPath === 'string') {
lsPath = path.isAbsolute(lsPath) ? lsPath : path.join(rootPath, lsPath);
console.info(`Using language server at ${lsPath}`);
} else {
lsPath = undefined;
}
const serverModule = lsPath
? require.resolve(lsPath)
: vscode.Uri.joinPath(context.extensionUri, 'dist/node/server.js').fsPath;
const runOptions = { execArgv: [] };
const debugOptions = {
execArgv: ['--nolazy', '--inspect=' + Math.floor(Math.random() * 20000 + 10000)],
};
const serverOptions: lsp.ServerOptions = {
run: {
module: serverModule,
transport: lsp.TransportKind.ipc,
options: runOptions,
},
debug: {
module: serverModule,
transport: lsp.TransportKind.ipc,
options: debugOptions,
},
};
const serverRuntime = runtimeConfig.get<string>('runtime');
if (serverRuntime) {
// ... (97 more lines)
Domain
Subdomains
Types
Dependencies
- node
- node:path
- protocol
- vscode
- vscode
Source
Frequently Asked Questions
What does client.ts do?
client.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in client.ts?
client.ts defines 3 function(s): activate, deactivate, getConfiguredServerPath.
What does client.ts depend on?
client.ts imports 5 module(s): node, node:path, protocol, vscode, vscode.
Where is client.ts in the architecture?
client.ts is located at packages/language-tools/vscode/src/client.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/language-tools/vscode/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free