mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into referencesDogfood_1
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
@@ -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();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user