Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
let tsConfigPath: string | undefined;
let servicesHost: LanguageServiceHost;
let service: tsTypes.LanguageService;
let documentRegistry: tsTypes.DocumentRegistry; // keep the same DocumentRegistry between watch cycles
let noErrors = true;
const declarations: { [name: string]: { type: tsTypes.OutputFile; map?: tsTypes.OutputFile } } = {};
const checkedFiles = new Set<string>();
Expand Down Expand Up @@ -98,6 +99,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
pluginOptions.typescript = require("typescript");
}
setTypescriptModule(pluginOptions.typescript);
documentRegistry = tsModule.createDocumentRegistry();

const self: Plugin = {

Expand Down Expand Up @@ -135,8 +137,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
filter = createFilter(context, pluginOptions, parsedConfig);

servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers, pluginOptions.cwd);

service = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());
service = tsModule.createLanguageService(servicesHost, documentRegistry);
servicesHost.setLanguageService(service);

// printing compiler option errors
Expand Down