|
14 | 14 | // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
15 | 15 | // *****************************************************************************
|
16 | 16 |
|
17 |
| -import { inject, injectable, named } from '@theia/core/shared/inversify'; |
| 17 | +import { inject, injectable } from '@theia/core/shared/inversify'; |
18 | 18 | import { GrammarDefinition, GrammarDefinitionProvider, LanguageGrammarDefinitionContribution, TextmateRegistry } from '@theia/monaco/lib/browser/textmate';
|
19 | 19 | import * as monaco from '@theia/monaco-editor-core';
|
20 |
| -import { Command, CommandContribution, CommandRegistry, ContributionProvider, MessageService } from '@theia/core'; |
| 20 | +import { Command, CommandContribution, CommandRegistry, MessageService } from '@theia/core'; |
21 | 21 | import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
22 | 22 |
|
23 | 23 | import { codicon, Widget } from '@theia/core/lib/browser';
|
24 | 24 | import { EditorWidget, ReplaceOperation } from '@theia/editor/lib/browser';
|
25 |
| -import { PromptCustomizationService, PromptService, ToolProvider } from '../common'; |
| 25 | +import { PromptCustomizationService, PromptService, ToolInvocationRegistry } from '../common'; |
26 | 26 | import { ProviderResult } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
|
27 | 27 |
|
28 | 28 | const PROMPT_TEMPLATE_LANGUAGE_ID = 'theia-ai-prompt-template';
|
@@ -56,9 +56,8 @@ export class PromptTemplateContribution implements LanguageGrammarDefinitionCont
|
56 | 56 | @inject(PromptCustomizationService)
|
57 | 57 | protected readonly customizationService: PromptCustomizationService;
|
58 | 58 |
|
59 |
| - @inject(ContributionProvider) |
60 |
| - @named(ToolProvider) |
61 |
| - private toolProviders: ContributionProvider<ToolProvider>; |
| 59 | + @inject(ToolInvocationRegistry) |
| 60 | + protected readonly toolInvocationRegistry: ToolInvocationRegistry; |
62 | 61 |
|
63 | 62 | readonly config: monaco.languages.LanguageConfiguration =
|
64 | 63 | {
|
@@ -115,7 +114,7 @@ export class PromptTemplateContribution implements LanguageGrammarDefinitionCont
|
115 | 114 | model,
|
116 | 115 | position,
|
117 | 116 | '~{',
|
118 |
| - this.toolProviders.getContributions().map(provider => provider.getTool()), |
| 117 | + this.toolInvocationRegistry.getAllFunctions(), |
119 | 118 | monaco.languages.CompletionItemKind.Function,
|
120 | 119 | tool => tool.id,
|
121 | 120 | tool => tool.name,
|
|
0 commit comments