Types Map WIP

This commit is contained in:
Ryan Cavanaugh
2017-07-27 16:07:50 -07:00
parent 70e5c6b1e5
commit 5272ec6309
12 changed files with 642 additions and 40 deletions

View File

@@ -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,