https://github.com/Microsoft/TypeScript
Raw File
Tip revision: b179c7c959a243ec4a1da30c095fb202578fe2cf authored by Sheetal Nandi on 10 December 2022, 04:15:31 UTC
Dont store originalPath as separate, instead store originalPath || resolvedFileName and resolve the symlinks on read
Tip revision: b179c7c
common.ts
import {
    Logger,
    LogLevel,
    ServerCancellationToken,
    SessionOptions,
} from "./_namespaces/ts.server";
import { LanguageServiceMode } from "./_namespaces/ts";

/** @internal */
export function getLogLevel(level: string | undefined) {
    if (level) {
        const l = level.toLowerCase();
        for (const name in LogLevel) {
            if (isNaN(+name) && l === name.toLowerCase()) {
                return LogLevel[name] as any as LogLevel;
            }
        }
    }
    return undefined;
}

/** @internal */
export interface StartSessionOptions {
    globalPlugins: SessionOptions["globalPlugins"];
    pluginProbeLocations: SessionOptions["pluginProbeLocations"];
    allowLocalPluginLoads: SessionOptions["allowLocalPluginLoads"];
    useSingleInferredProject: SessionOptions["useSingleInferredProject"];
    useInferredProjectPerProjectRoot: SessionOptions["useInferredProjectPerProjectRoot"];
    suppressDiagnosticEvents: SessionOptions["suppressDiagnosticEvents"];
    noGetErrOnBackgroundUpdate: SessionOptions["noGetErrOnBackgroundUpdate"];
    syntaxOnly: SessionOptions["syntaxOnly"];
    serverMode: SessionOptions["serverMode"];
}

/** @internal */
export interface StartInput {
    args: readonly string[];
    logger: Logger;
    cancellationToken: ServerCancellationToken;
    serverMode: LanguageServiceMode | undefined;
    unknownServerMode?: string;
    startSession: (option: StartSessionOptions, logger: Logger, cancellationToken: ServerCancellationToken) => void;
}
back to top