Merge branch 'master' into referencesDogfood_1

This commit is contained in:
Ryan Cavanaugh
2018-04-11 16:17:38 -07:00
120 changed files with 3082 additions and 1867 deletions
+2 -2
View File
@@ -1834,11 +1834,11 @@ namespace ts.server {
this.logger.info(`Host information ${args.hostInfo}`);
}
if (args.formatOptions) {
mergeMapLikes(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions));
this.hostConfiguration.formatCodeOptions = { ...this.hostConfiguration.formatCodeOptions, ...convertFormatOptions(args.formatOptions) };
this.logger.info("Format host information updated");
}
if (args.preferences) {
mergeMapLikes(this.hostConfiguration.preferences, args.preferences);
this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
}
if (args.extraFileExtensions) {
this.hostConfiguration.extraFileExtensions = args.extraFileExtensions;
+1
View File
@@ -2640,6 +2640,7 @@ namespace ts.server.protocol {
}
export interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
/**
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
+6 -3
View File
@@ -395,15 +395,18 @@ namespace ts.server {
if (formatSettings) {
if (!this.formatSettings) {
this.formatSettings = getDefaultFormatCodeSettings(this.host);
assign(this.formatSettings, formatSettings);
}
else {
this.formatSettings = { ...this.formatSettings, ...formatSettings };
}
mergeMapLikes(this.formatSettings, formatSettings);
}
if (preferences) {
if (!this.preferences) {
this.preferences = clone(defaultPreferences);
this.preferences = defaultPreferences;
}
mergeMapLikes(this.preferences, preferences);
this.preferences = { ...this.preferences, ...preferences };
}
}
+11 -3
View File
@@ -523,12 +523,20 @@ namespace ts.server {
return;
}
next.immediate(() => {
this.suggestionCheck(fileName, project);
const goNext = () => {
if (checkList.length > index) {
next.delay(followMs, checkOne);
}
});
};
if (this.getPreferences(fileName).disableSuggestions) {
goNext();
}
else {
next.immediate(() => {
this.suggestionCheck(fileName, project);
goNext();
});
}
});
};
-8
View File
@@ -80,14 +80,6 @@ namespace ts.server {
};
}
export function mergeMapLikes<T extends object>(target: T, source: Partial<T>): void {
for (const key in source) {
if (hasProperty(source, key)) {
target[key] = source[key];
}
}
}
export type NormalizedPath = string & { __normalizedPathTag: any };
export function toNormalizedPath(fileName: string): NormalizedPath {