mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Expose ProjectService to plugins (#23824)
Add refreshDiagnostics() method to Project
This commit is contained in:
@@ -577,7 +577,8 @@ namespace ts.server {
|
||||
return this.pendingProjectUpdates.has(project.getProjectName());
|
||||
}
|
||||
|
||||
private sendProjectsUpdatedInBackgroundEvent() {
|
||||
/* @internal */
|
||||
sendProjectsUpdatedInBackgroundEvent() {
|
||||
if (!this.eventHandler) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace ts.server {
|
||||
return hasOneOrMoreJsAndNoTsFiles(this);
|
||||
}
|
||||
|
||||
public static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} {
|
||||
public static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined {
|
||||
const resolvedPath = normalizeSlashes(host.resolvePath(combinePaths(initialDir, "node_modules")));
|
||||
log(`Loading ${moduleName} from ${initialDir} (resolved to ${resolvedPath})`);
|
||||
const result = host.require(resolvedPath, moduleName);
|
||||
@@ -1102,6 +1102,11 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
/** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
|
||||
refreshDiagnostics() {
|
||||
this.projectService.sendProjectsUpdatedInBackgroundEvent();
|
||||
}
|
||||
|
||||
private enableProxy(pluginModuleFactory: PluginModuleFactory, configEntry: PluginImport) {
|
||||
try {
|
||||
if (typeof pluginModuleFactory !== "function") {
|
||||
|
||||
Reference in New Issue
Block a user