vscode#EventEmitter TypeScript Examples
The following examples show how to use
vscode#EventEmitter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: karma-test-explorer.ts From karma-test-explorer with MIT License | 6 votes |
constructor(
public readonly workspaceFolder: WorkspaceFolder,
private readonly config: NonDisposable<ExtensionConfig>, // FIXME: get from factory
private readonly testManager: TestManager,
private readonly testLocator: TestLocator,
private readonly testStore: NonDisposable<TestStore>,
private readonly processHandler: ProcessHandler,
private readonly testDebugger: NonDisposable<Debugger>,
private readonly testLoadEmitter: NonDisposable<EventEmitter<TestLoadEvent>>,
private readonly testRunEmitter: NonDisposable<EventEmitter<TestRunEvent | TestResultEvent>>,
private readonly retireEmitter: NonDisposable<EventEmitter<RetireEvent>>,
private readonly notificationHandler: NonDisposable<NotificationHandler>,
private readonly logger: SimpleLogger
) {
this.disposables.push(logger);
}
Example #2
Source File: dbtProject.ts From vscode-dbt-power-user with MIT License | 6 votes |
constructor(
private dbtProjectContainer: DBTProjectContainer,
private sourceFileWatchersFactory: SourceFileWatchersFactory,
private dbtProjectLogFactory: DBTProjectLogFactory,
private targetWatchersFactory: TargetWatchersFactory,
private dbtCommandFactory: DBTCommandFactory,
private terminal: DBTTerminal,
path: Uri,
_onManifestChanged: EventEmitter<ManifestCacheChangedEvent>
) {
this.projectRoot = path;
const dbtProjectConfigWatcher = workspace.createFileSystemWatcher(
new RelativePattern(path, DBTProject.DBT_PROJECT_FILE)
);
setupWatcherHandler(dbtProjectConfigWatcher, () => this.tryRefresh());
this.sourceFileWatchers = this.sourceFileWatchersFactory.createSourceFileWatchers(
this.onProjectConfigChanged
);
this.onSourceFileChanged = this.sourceFileWatchers.onSourceFileChanged;
this.dbtProjectLog = this.dbtProjectLogFactory.createDBTProjectLog(
this.onProjectConfigChanged
);
this.disposables.push(
this.targetWatchersFactory.createTargetWatchers(
_onManifestChanged,
this.onProjectConfigChanged
),
dbtProjectConfigWatcher,
this.onSourceFileChanged(() => this.listModels()),
this.sourceFileWatchers,
this.dbtProjectLog
);
}
Example #3
Source File: karma-auto-watch-test-event-processor.ts From karma-test-explorer with MIT License | 6 votes |
public constructor(
private readonly testEventProcessor: KarmaTestEventProcessor,
private readonly testLoadEventEmitter: EventEmitter<TestLoadEvent>,
private readonly testRunEventEmitter: EventEmitter<TestRunEvent>,
private readonly testResultEventEmitter: EventEmitter<TestResultEvent>,
private readonly testRetireEventEmitter: EventEmitter<RetireEvent>,
private readonly testDiscoveryProcessor: TestDiscoveryProcessor,
private readonly testStore: TestStore,
private readonly logger: Logger
) {
this.disposables.push(logger);
}
Example #4
Source File: dbtWorkspaceFolder.ts From vscode-dbt-power-user with MIT License | 6 votes |
constructor(
@inject("DBTProjectFactory")
private dbtProjectFactory: (
path: Uri,
_onManifestChanged: EventEmitter<ManifestCacheChangedEvent>
) => DBTProject,
workspaceFolder: WorkspaceFolder,
_onManifestChanged: EventEmitter<ManifestCacheChangedEvent>
) {
this.workspaceFolder = workspaceFolder;
this.watcher = this.createConfigWatcher();
this.disposables.push(this.watcher);
this._onManifestChanged = _onManifestChanged;
}
Example #5
Source File: BacklinksTreeDataProvider.ts From dendron with GNU Affero General Public License v3.0 | 6 votes |
/**
*
* @param engineEvents - specifies when note state has been changed on the
* engine
*/
constructor(
engineEvents: EngineEventEmitter,
isLinkCandidateEnabled: boolean | undefined
) {
this._isLinkCandidateEnabled = isLinkCandidateEnabled;
// Set default sort order to use last updated
this.sortOrder =
MetadataService.instance().BacklinksPanelSortOrder ??
BacklinkPanelSortOrder.LastUpdated;
this._onDidChangeTreeDataEmitter = new EventEmitter<
Backlink | undefined | void
>();
this.onDidChangeTreeData = this._onDidChangeTreeDataEmitter.event;
this._engineEvents = engineEvents;
this.setupSubscriptions();
}
Example #6
Source File: targetWatchers.ts From vscode-dbt-power-user with MIT License | 6 votes |
constructor(
_onManifestChanged: EventEmitter<ManifestCacheChangedEvent>,
onProjectConfigChanged: Event<ProjectConfigChangedEvent>,
private manifestParser: ManifestParser
) {
this._onManifestChanged = _onManifestChanged;
this.disposables.push(
onProjectConfigChanged((event) => this.onProjectConfigChanged(event))
);
}
Example #7
Source File: adapter.ts From karma-test-explorer with MIT License | 5 votes |
constructor(
public readonly workspaceFolder: WorkspaceFolder,
private readonly projectDisplayName: string,
portAcquisitionManager: PortAcquisitionManager,
projectStatusDisplay: StatusDisplay,
private readonly options?: AdapterOptions
) {
let channelLog = options?.outputChannelLog;
if (!channelLog) {
const channelNamespaceLabel = options?.projectNamespace ? ` (${options.projectNamespace})` : '';
channelLog = new OutputChannelLog(`${EXTENSION_OUTPUT_CHANNEL_NAME}${channelNamespaceLabel}`);
this.disposables.push(channelLog);
}
this.outputChannelLog = channelLog;
const config = this.createConfig();
this.logger = new SimpleLogger(this.outputChannelLog, Adapter.name, config.logLevel);
this.logger.debug(() => 'Creating port acquisition client');
this.portAcquisitionClient = new PortAcquisitionClient(
portAcquisitionManager,
this.createLogger(PortAcquisitionClient.name)
);
this.logger.debug(() => 'Creating debugger');
this.debugger = new Debugger(this.createLogger(Debugger.name), {
debuggerNamespace: options?.projectNamespace ? projectDisplayName : undefined
});
this.disposables.push(this.debugger);
this.logger.debug(() => 'Creating project commands handler');
const commandsNamespace = options?.projectNamespace ? `.${options.projectNamespace}` : '';
this.projectCommands = new Commands<ProjectCommand>(
this.createLogger(Commands.name),
`${EXTENSION_CONFIG_PREFIX}${commandsNamespace}`
);
this.projectCommands.register(ProjectCommand.ShowLog, () => this.outputChannelLog.show());
this.projectCommands.register(ProjectCommand.Reset, () => this.reset());
this.disposables.push(this.projectCommands);
this.logger.debug(() => 'Creating notifications handler');
this.notificationHandler = new NotificationHandler(
projectStatusDisplay,
this.createLogger(NotificationHandler.name),
{
showLogCommand: this.projectCommands.getCommandName(ProjectCommand.ShowLog)
}
);
this.disposables.push(this.notificationHandler);
this.logger.debug(() => 'Creating test emitters');
this.testLoadEmitter = new EventEmitter();
this.testRunEmitter = new EventEmitter();
this.retireEmitter = new EventEmitter();
this.disposables.push(this.testLoadEmitter, this.testRunEmitter, this.retireEmitter);
const { testExplorer, testExplorerDisposables } = this.createTestExplorer(config);
this.karmaTestExplorer = testExplorer;
this.testExplorerDisposables = testExplorerDisposables;
}
Example #8
Source File: leanpkg.ts From vscode-lean4 with Apache License 2.0 | 5 votes |
// This event is raised if the 'lakefile.lean' file contents is changed.
// The event provides the lean package root Uri.
private lakeFileChangedEmitter = new EventEmitter<Uri>();
Example #9
Source File: ConsumptionCache.ts From al-objid with MIT License | 5 votes |
private readonly _onConsumptionUpdateEmitter = new EventEmitter<ConsumptionEventInfo>();
Example #10
Source File: connectionProvider.ts From vscode-ssh with MIT License | 5 votes |
_onDidChangeTreeData: EventEmitter<AbstractNode> = new EventEmitter<AbstractNode>();
Example #11
Source File: FileWatcher.ts From al-objid with MIT License | 5 votes |
private readonly _onDeleted = new EventEmitter<boolean>();
Example #12
Source File: leanclient.ts From vscode-lean4 with Apache License 2.0 | 5 votes |
private didSetLanguageEmitter = new EventEmitter<string>();
Example #13
Source File: taskProvider.ts From vscode-todo-md with MIT License | 5 votes |
private readonly _onDidChangeTreeData: EventEmitter<TaskTreeItem | undefined> = new EventEmitter<TaskTreeItem | undefined>();
Example #14
Source File: CompiledCodeContentProvider.ts From language-tools with MIT License | 5 votes |
private didChangeEmitter = new EventEmitter<Uri>();
Example #15
Source File: stripeTreeViewDataProvider.ts From vscode-stripe with MIT License | 5 votes |
private _onDidChangeTreeData: EventEmitter<TreeItem | null> = new EventEmitter<TreeItem | null>();
Example #16
Source File: fileDecorator.ts From vscode-swissknife with MIT License | 5 votes |
private eventEmitter: EventEmitter<Uri | Uri[]>
Example #17
Source File: suite-aggregate-test-result-processor.ts From karma-test-explorer with MIT License | 5 votes |
public constructor(
private readonly testResultEventEmitter: EventEmitter<TestResultEvent>,
private readonly testResolver: StoredTestResolver,
private readonly testTreeProcessor: TestTreeProcessor,
private readonly logger: Logger
) {}
Example #18
Source File: comment-view.ts From vscode-code-review with MIT License | 5 votes |
private _onDidChangeTreeData: EventEmitter<CommentListEntry | undefined> = new EventEmitter<
CommentListEntry | undefined
>();
Example #19
Source File: VirtualFileSystemProvider.ts From vscode-drawio with GNU General Public License v3.0 | 5 votes |
private readonly fileChangedEmitter = new EventEmitter();
Example #20
Source File: EngineNoteProvider.ts From dendron with GNU Affero General Public License v3.0 | 5 votes |
private _onDidChangeTreeDataEmitter: EventEmitter<
NoteProps | undefined | void
>;
Example #21
Source File: dbtTerminal.ts From vscode-dbt-power-user with MIT License | 5 votes |
private readonly writeEmitter = new EventEmitter<string>();
Example #22
Source File: utopia-fs.ts From utopia with MIT License | 5 votes |
function newEventQueue<T>(): EventQueue<T> {
return {
queue: [],
emitter: new EventEmitter<T[]>(),
handle: null,
}
}
Example #23
Source File: tree-data-provider.ts From plugin-vscode with Apache License 2.0 | 5 votes |
private _onDidChangeTreeData: EventEmitter<PackageTreeItem | undefined> = new EventEmitter<PackageTreeItem | undefined>();
Example #24
Source File: radio.ts From cloudmusic-vscode with MIT License | 5 votes |
_onDidChangeTreeData = new EventEmitter<
UserTreeItem | RadioTreeItem | ProgramTreeItem | void
>();
Example #25
Source File: logger.ts From lego-spikeprime-mindstorms-vscode with Apache License 2.0 | 5 votes |
constructor(private writeEvent: EventEmitter<string>) { }
Example #26
Source File: driveTreeDataProvider.ts From google-drive-vscode with MIT License | 5 votes |
/** Helper objects to refresh UI when a new monitor is added */
private _onDidChangeTreeData: EventEmitter<string | undefined> = new EventEmitter<string | undefined>();
Example #27
Source File: history.ts From vscode-q with MIT License | 5 votes |
private _onDidChangeTreeData: EventEmitter<HistoryTreeItem | undefined> = new EventEmitter<HistoryTreeItem | undefined>();
Example #28
Source File: leanclient.ts From vscode-lean4 with Apache License 2.0 | 5 votes |
private progressChangedEmitter = new EventEmitter<[string, LeanFileProgressProcessingInfo[]]>()
Example #29
Source File: driveFileSystemProvider.ts From google-drive-vscode with MIT License | 5 votes |
private _emitter = new EventEmitter<FileChangeEvent[]>();