evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Create a JupyterLab extension module that turns on the built-in Language Server Protocol service (disabled by default) and exposes a thin API for registering language servers plus querying diagnostics, completions, and definition locations for notebooks or text editors. The solution should rely on the existing service instead of implementing the protocol manually.
pri, requesting completions returns suggestions that include print. @testexport interface LanguageServerConfig {
/** Unique identifier for the language server */
id: string;
/** Language identifiers handled by this server */
languages: string[];
/** Command and arguments used to start the server */
argv: string[];
}
export interface DiagnosticSummary {
message: string;
severity: 'error' | 'warning' | 'info';
/** 1-based line number */
line: number;
/** 1-based column number */
column: number;
}
export interface CompletionItem {
label: string;
detail?: string;
}
/**
* Turns on the JupyterLab LSP service and registers the provided language servers.
*/
export async function activateLspService(configs: LanguageServerConfig[]): Promise<void>;
/**
* Requests diagnostics for a given document path after the LSP service is active.
*/
export async function requestDiagnostics(documentPath: string): Promise<DiagnosticSummary[]>;
/**
* Requests completion items for a document and cursor offset using the active language server.
*/
export async function requestCompletions(
documentPath: string,
code: string,
cursorOffset: number
): Promise<CompletionItem[]>;
/**
* Resolves a definition location for a symbol within the document, if provided by the server.
*/
export async function locateDefinition(documentPath: string, symbol: string): Promise<string | null>;Provides the application shell and extension system needed to host the module. @satisfied-by
Provides the Language Server Protocol service and client-side hooks for diagnostics, completions, and navigation. @satisfied-by