mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Types Map WIP
This commit is contained in:
@@ -13,6 +13,7 @@ namespace ts.server {
|
||||
globalTypingsCacheLocation: string;
|
||||
logger: Logger;
|
||||
typingSafeListLocation: string;
|
||||
typesMapLocation: string | undefined;
|
||||
npmLocation: string | undefined;
|
||||
telemetryEnabled: boolean;
|
||||
globalPlugins: string[];
|
||||
@@ -243,6 +244,7 @@ namespace ts.server {
|
||||
eventPort: number,
|
||||
readonly globalTypingsCacheLocation: string,
|
||||
readonly typingSafeListLocation: string,
|
||||
readonly typesMapLocation: string,
|
||||
private readonly npmLocation: string | undefined,
|
||||
private newLine: string) {
|
||||
this.throttledOperations = new ThrottledOperations(host);
|
||||
@@ -288,6 +290,9 @@ namespace ts.server {
|
||||
if (this.typingSafeListLocation) {
|
||||
args.push(Arguments.TypingSafeListLocation, this.typingSafeListLocation);
|
||||
}
|
||||
if (this.typesMapLocation) {
|
||||
args.push(Arguments.TypesMapLocation, this.typesMapLocation);
|
||||
}
|
||||
if (this.npmLocation) {
|
||||
args.push(Arguments.NpmLocation, this.npmLocation);
|
||||
}
|
||||
@@ -401,10 +406,10 @@ namespace ts.server {
|
||||
|
||||
class IOSession extends Session {
|
||||
constructor(options: IOSessionOptions) {
|
||||
const { host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, npmLocation, canUseEvents } = options;
|
||||
const { host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, canUseEvents } = options;
|
||||
const typingsInstaller = disableAutomaticTypingAcquisition
|
||||
? undefined
|
||||
: new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, npmLocation, host.newLine);
|
||||
: new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, host.newLine);
|
||||
|
||||
super({
|
||||
host,
|
||||
@@ -758,6 +763,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation);
|
||||
const typesMapLocation = findArgument(Arguments.TypesMapLocation) || combinePaths(sys.getExecutingFilePath(), '../typesMap.json');
|
||||
const npmLocation = findArgument(Arguments.NpmLocation);
|
||||
|
||||
const globalPlugins = (findArgument("--globalPlugins") || "").split(",");
|
||||
@@ -777,6 +783,7 @@ namespace ts.server {
|
||||
disableAutomaticTypingAcquisition,
|
||||
globalTypingsCacheLocation: getGlobalTypingsCacheLocation(),
|
||||
typingSafeListLocation,
|
||||
typesMapLocation,
|
||||
npmLocation,
|
||||
telemetryEnabled,
|
||||
logger,
|
||||
|
||||
Reference in New Issue
Block a user