Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { SModelRoot } from "../model/smodel";
import { TYPES } from "../types";
import { Action } from "../actions/action";
import { AnimationFrameSyncer } from "../animations/animation-frame-syncer";
import { IViewer } from "./viewer";
/**
* Updating the view is rather expensive, and it doesn't make sense to calculate
* more then one update per animation (rendering) frame. So this class batches
* all incoming model changes and only renders the last one when the next animation
* frame comes.
*/
@injectable()
export class ViewerCache implements IViewer {
@inject(TYPES.IViewer) protected delegate: IViewer;
@inject(TYPES.AnimationFrameSyncer) protected syncer: AnimationFrameSyncer;
protected cachedModel?: SModelRoot;
update(model: SModelRoot, cause?: Action): void {
if (cause !== undefined) {
// Forward the update immediately in order to pass the cause action
this.delegate.update(model, cause);
this.cachedModel = undefined;
} else {
const isCacheEmpty = this.cachedModel === undefined;
this.cachedModel = model;
if (isCacheEmpty) {
this.scheduleUpdate();
}
}
if (groups) {
groups.forEach(group => group.resources.forEach(resource => resources.push(resource)));
this.scmNodes = resources;
}
}
this.selectNode(change);
}
protected readonly handleEnter: () => void;
@inject(ScmTitleCommandRegistry) protected readonly scmTitleRegistry: ScmTitleCommandRegistry;
@inject(ScmResourceCommandRegistry) protected readonly scmResourceCommandRegistry: ScmResourceCommandRegistry;
@inject(ScmGroupCommandRegistry) protected readonly scmGroupCommandRegistry: ScmGroupCommandRegistry;
@inject(ScmService) private readonly scmService: ScmService;
@inject(CommandRegistry) private readonly commandRegistry: CommandRegistry;
@inject(ApplicationShell) protected readonly shell: ApplicationShell;
@inject(ContextMenuRenderer) protected readonly contextMenuRenderer: ContextMenuRenderer;
@inject(ScmAvatarService) protected readonly avatarService: ScmAvatarService;
@inject(StorageService) protected readonly storageService: StorageService;
constructor() {
super();
this.id = 'theia-scmContainer';
this.addClass('theia-scm');
this.scrollContainer = ScmWidget.Styles.GROUPS_CONTAINER;
this.update();
}
@postConstruct()
protected init() {
const changeHandler = (repository: ScmRepository) => {
repository.provider.onDidChangeResources(() => {
@injectable()
export class TypeScriptFrontendContribution implements FrontendApplicationContribution, CommandContribution, MenuContribution, KeybindingContribution {
@inject(StatusBar)
protected readonly statusBar: StatusBar;
@inject(EditorManager)
protected readonly editorManager: EditorManager;
@inject(QuickPickService)
protected readonly quickPickService: QuickPickService;
@inject(TypeScriptClientContribution)
protected readonly clientContribution: TypeScriptClientContribution;
@inject(FileSystemWatcher)
protected readonly fileSystemWatcher: FileSystemWatcher;
@inject(LabelProvider)
protected readonly labelProvider: LabelProvider;
@inject(StorageService)
protected readonly storage: StorageService;
@postConstruct()
protected init(): void {
this.fileSystemWatcher.onDidMove(event => this.renameFile(event));
}
onStart(): void {
this.restore();
this.updateStatusBar();
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import * as React from 'react';
import { TreeSource, TreeElement } from '@theia/core/lib/browser/source-tree';
import { ExpressionContainer, ExpressionItem, DebugVariable } from '../console/debug-console-items';
import { DebugSessionManager } from '../debug-session-manager';
import { injectable, inject } from 'inversify';
@injectable()
export class DebugHoverSource extends TreeSource {
@inject(DebugSessionManager)
protected readonly sessions: DebugSessionManager;
protected _expression: ExpressionItem | DebugVariable | undefined;
get expression(): ExpressionItem | DebugVariable | undefined {
return this._expression;
}
protected elements: TreeElement[] = [];
getElements(): IterableIterator {
return this.elements[Symbol.iterator]();
}
protected renderTitle(element: ExpressionItem | DebugVariable): React.ReactNode {
return <div title="{element.value}">{element.value}</div>;
}
constructor(@inject("IProjectionRouter") private router:IProjectionRouter,
@inject("IProjectionSelector") private projectionSelector:IProjectionSelector,
@inject("IProjectionRegistry") private projectionRegistry:IProjectionRegistry) {
}
constructor(@inject(IGitCommandExecutor) private gitCmdExecutor: IGitCommandExecutor,
@inject(ILogParser) private logParser: ILogParser,
@inject(IGitArgsService) private gitArgsService: IGitArgsService,
@inject(IServiceContainer) private serviceContainer: IServiceContainer) {
}
public async createGitService(workspaceRoot: string, resource: Uri | string): Promise {
constructor(
@inject(DiscoveryTypes.Cache) protected cache: CacheService,
@inject(DiscoveryTypes.MultiSource) protected multiSource: MultiSourceService
) {
this.cachedRemote = new CachedSourceService(cache, multiSource);
}
* The actual keybinding.
*/
keybinding: string,
/**
* The keybinding context.
*/
context: string,
}
@injectable()
export class KeymapsService {
@inject(ResourceProvider)
protected readonly resourceProvider: ResourceProvider;
@inject(KeybindingRegistry)
protected readonly keyBindingRegistry: KeybindingRegistry;
@inject(OpenerService)
protected readonly opener: OpenerService;
@inject(KeymapsParser)
protected readonly parser: KeymapsParser;
protected readonly changeKeymapEmitter = new Emitter();
onDidChangeKeymaps = this.changeKeymapEmitter.event;
protected resource: Resource;
/**
* Initialize the keybinding service.
*/
@inject(Symbols.generic.zschema)
public schema: z_schema;
@inject(Symbols.helpers.timeToEpoch)
public timeToEpoch: ITimeToEpoch;
@inject(Symbols.generic.hookSystem)
private hookSystem: WordPressHookSystem;
@inject(Symbols.modules.accounts)
private accountsModule: IAccountsModule;
@inject(Symbols.modules.blocks)
private blocksModule: IBlocksModule;
@inject(TXSymbols.module)
private transactionsModule: ITransactionsModule;
@inject(Symbols.modules.system)
private systemModule: ISystemModule;
@inject(ModelSymbols.model)
@named(TXSymbols.models.model)
private TXModel: typeof ITransactionsModel;
@inject(ModelSymbols.model)
@named(ModelSymbols.names.accounts)
private AccountsModel: typeof IAccountsModel;
@inject(TXSymbols.logic)
private txLogic: ITransactionLogic;
@inject(TXSymbols.pool)
private pool: TransactionPool;
@Get()
constructor(
@inject(TYPES.EventsConsumedByConnectedCDA) private readonly _dependencies: EventsConsumedBySkipFilesLogic,
@inject(TYPES.CDTPDiagnostics) private readonly chrome: CDTPDiagnostics,
@inject(TYPES.DeleteMeScriptsRegistry) private readonly _scriptsRegistry: DeleteMeScriptsRegistry,
@inject(new LazyServiceIdentifer(() => TYPES.StackTracesLogic)) private readonly stackTracesLogic: StackTracesLogic,
@inject(TYPES.BaseSourceMapTransformer) private readonly sourceMapTransformer: BaseSourceMapTransformer,
@inject(TYPES.BasePathTransformer) private readonly pathTransformer: BasePathTransformer,
) { }
}