Use protocol.UserPreferences in server to store UserPreferences · microsoft/TypeScript@03bb5d1 · GitHub
Skip to content

Commit 03bb5d1

Browse files
committed
Use protocol.UserPreferences in server to store UserPreferences
1 parent 52fef42 commit 03bb5d1

4 files changed

Lines changed: 20 additions & 25 deletions

File tree

src/server/editorServices.ts

Lines changed: 9 additions & 9 deletions

src/server/scriptInfo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ namespace ts.server {
234234
*/
235235
readonly containingProjects: Project[] = [];
236236
private formatSettings: FormatCodeSettings | undefined;
237-
private preferences: UserPreferences | undefined;
237+
private preferences: protocol.UserPreferences | undefined;
238238

239239
/* @internal */
240240
fileWatcher: FileWatcher | undefined;
@@ -333,7 +333,7 @@ namespace ts.server {
333333
}
334334

335335
getFormatCodeSettings(): FormatCodeSettings | undefined { return this.formatSettings; }
336-
getPreferences(): UserPreferences | undefined { return this.preferences; }
336+
getPreferences(): protocol.UserPreferences | undefined { return this.preferences; }
337337

338338
attachToProject(project: Project): boolean {
339339
const isNew = !this.isAttached(project);
@@ -432,7 +432,7 @@ namespace ts.server {
432432
}
433433
}
434434

435-
setOptions(formatSettings: FormatCodeSettings, preferences: UserPreferences | undefined): void {
435+
setOptions(formatSettings: FormatCodeSettings, preferences: protocol.UserPreferences | undefined): void {
436436
if (formatSettings) {
437437
if (!this.formatSettings) {
438438
this.formatSettings = getDefaultFormatCodeSettings(this.host);

src/server/session.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ namespace ts.server {
14231423
const position = this.getPosition(args, scriptInfo);
14241424

14251425
const completions = project.getLanguageService().getCompletionsAtPosition(file, position, {
1426-
...this.getPreferences(file),
1426+
...convertUserPreferences(this.getPreferences(file)),
14271427
triggerCharacter: args.triggerCharacter,
14281428
includeExternalModuleExports: args.includeExternalModuleExports,
14291429
includeInsertTextCompletions: args.includeInsertTextCompletions
@@ -2352,15 +2352,15 @@ namespace ts.server {
23522352
return this.projectService.getFormatCodeOptions(file);
23532353
}
23542354

2355-
private getPreferences(file: NormalizedPath): UserPreferences {
2355+
private getPreferences(file: NormalizedPath): protocol.UserPreferences {
23562356
return this.projectService.getPreferences(file);
23572357
}
23582358

23592359
private getHostFormatOptions(): FormatCodeSettings {
23602360
return this.projectService.getHostFormatCodeOptions();
23612361
}
23622362

2363-
private getHostPreferences(): UserPreferences {
2363+
private getHostPreferences(): protocol.UserPreferences {
23642364
return this.projectService.getHostPreferences();
23652365
}
23662366
}

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 5 additions & 10 deletions

0 commit comments

Comments
 (0)