Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate text editor entry #14238

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/ai-chat-ui/src/browser/ai-chat-ui-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { ChatViewMenuContribution } from './chat-view-contribution';
import { ChatViewLanguageContribution } from './chat-view-language-contribution';
import { ChatViewWidget } from './chat-view-widget';
import { ChatViewWidgetToolbarContribution } from './chat-view-widget-toolbar-contribution';
import { EditorPreviewManager } from '@theia/editor-preview/lib/browser/editor-preview-manager';

export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
bindViewContribution(bind, AIChatContribution);
Expand Down Expand Up @@ -71,6 +72,7 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {

bind(AIEditorManager).toSelf().inSingletonScope();
rebind(EditorManager).toService(AIEditorManager);
rebind(EditorPreviewManager).toService(AIEditorManager);

bindContributionProvider(bind, AIEditorSelectionResolver);
bind(AIEditorSelectionResolver).to(GitHubSelectionResolver).inSingletonScope();
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/browser/open-with-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export class OpenWithService {
protected readonly handlers: OpenWithHandler[] = [];

registerHandler(handler: OpenWithHandler): Disposable {
if (this.handlers.some(h => h.id === handler.id)) {
console.warn('Duplicate OpenWithHandler registration: ' + handler.id);
return Disposable.NULL;
}
this.handlers.push(handler);
return Disposable.create(() => {
const index = this.handlers.indexOf(handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import {
import { Disposable } from '@theia/core/lib/common';
import { OpenEditorNode } from '@theia/navigator/lib/browser/open-editors-widget/navigator-open-editors-tree-model';
import { EditorPreviewWidget } from './editor-preview-widget';
import { EditorPreviewManager } from './editor-preview-manager';

@injectable()
export class EditorPreviewTreeDecorator implements TreeDecorator, FrontendApplicationContribution {
@inject(EditorPreviewManager) protected readonly editorPreviewManager: EditorPreviewManager;

@inject(ApplicationShell) protected readonly shell: ApplicationShell;

readonly id = 'theia-open-editors-file-decorator';
Expand Down
Loading