Skip to content

Commit d11c7ae

Browse files
author
Andy
authored
class Project: implement log and error from LanguageServiceHost (microsoft#21635)
* class Project: implement `log` and `error` from `LanguageServiceHost` * Update API baseline
1 parent c1a2adc commit d11c7ae

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/server/project.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,14 @@ namespace ts.server {
428428
this.projectService.logger.info(s);
429429
}
430430

431+
log(s: string) {
432+
this.writeLog(s);
433+
}
434+
435+
error(s: string) {
436+
this.projectService.logger.msg(s, Msg.Err);
437+
}
438+
431439
private setInternalCompilerOptionsForEmittingJsFiles() {
432440
if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) {
433441
this.compilerOptions.noEmitForJsFiles = true;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7500,6 +7500,8 @@ declare namespace ts.server {
75007500
resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
75017501
directoryExists(path: string): boolean;
75027502
getDirectories(path: string): string[];
7503+
log(s: string): void;
7504+
error(s: string): void;
75037505
private setInternalCompilerOptionsForEmittingJsFiles();
75047506
/**
75057507
* Get the errors that dont have any file name associated

0 commit comments

Comments
 (0)