@codingame/monaco-vscode-chat-service-override 16.1.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -6
- package/package.json +30 -27
- package/vscode/src/vs/base/common/objectCache.d.ts +1 -1
- package/vscode/src/vs/base/common/objectCache.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +41 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +410 -443
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +3 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +32 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.js +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.js +159 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.js +244 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +171 -168
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +48 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +46 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +118 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +45 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +48 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +53 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +32 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +9 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +80 -268
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +214 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +26 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +186 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +129 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +313 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +12 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +42 -181
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +484 -384
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +187 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +8 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +264 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +28 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +41 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +8 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +2 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +20 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.js +73 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +82 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +44 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +24 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +14 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +8 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +84 -80
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.js +27 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.js +74 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/types.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.js +121 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.js +65 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptLinkProvider.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptPathAutocompletion.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptPathAutocompletion.js +14 -19
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +17 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +223 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +28 -22
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.js +25 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +20 -31
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +15 -12
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +12 -12
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.d.ts +0 -2
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.js +1 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +0 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.js +0 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.js +0 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.js +0 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.js +0 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.js +0 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.js +0 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +0 -80
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +0 -64
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.js +0 -117
- /package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptLinkProvider.d.ts +0 -0
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
-
import { EDIT_BUTTON, DELETE_BUTTON } from '../constants.js';
|
|
4
|
-
import { assert } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
5
|
-
import { getCleanPromptName } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
6
|
-
|
|
7
|
-
async function handleButtonClick(options, context) {
|
|
8
|
-
const { quickPick, openerService, fileService, dialogService } = options;
|
|
9
|
-
const { item, button } = context;
|
|
10
|
-
const { value } = item;
|
|
11
|
-
if (button === EDIT_BUTTON) {
|
|
12
|
-
return await openerService.open(value);
|
|
13
|
-
}
|
|
14
|
-
if (button === DELETE_BUTTON) {
|
|
15
|
-
assert((quickPick.activeItems.length < 2), `Expected maximum one active item, got '${quickPick.activeItems.length}'.`);
|
|
16
|
-
const activeItem = quickPick.activeItems[0];
|
|
17
|
-
const info = await fileService.stat(value);
|
|
18
|
-
assert(info.isDirectory === false, `'${value.fsPath}' points to a folder.`);
|
|
19
|
-
const previousIgnoreFocusOut = quickPick.ignoreFocusOut;
|
|
20
|
-
quickPick.ignoreFocusOut = true;
|
|
21
|
-
const filename = getCleanPromptName(value);
|
|
22
|
-
const { confirmed } = await dialogService.confirm({
|
|
23
|
-
message: ( localize(4365, "Are you sure you want to delete '{0}'?", filename)),
|
|
24
|
-
});
|
|
25
|
-
quickPick.ignoreFocusOut = previousIgnoreFocusOut;
|
|
26
|
-
if (!confirmed) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
await fileService.del(value);
|
|
30
|
-
let removedIndex = -1;
|
|
31
|
-
quickPick.items = quickPick.items.filter((option, index) => {
|
|
32
|
-
if (option === item) {
|
|
33
|
-
removedIndex = index;
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
});
|
|
38
|
-
if (activeItem && (activeItem === item)) {
|
|
39
|
-
assert(removedIndex >= 0, 'Removed item index must be a valid index.');
|
|
40
|
-
const newActiveItemIndex = Math.max(removedIndex - 1, 0);
|
|
41
|
-
const newActiveItem = quickPick.items[newActiveItemIndex];
|
|
42
|
-
quickPick.activeItems = newActiveItem ? [newActiveItem] : [];
|
|
43
|
-
}
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
throw ( new Error(`Unknown button '${JSON.stringify(button)}'.`));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { handleButtonClick };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IChatWidget } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
2
|
-
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
-
import { IActiveCodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
|
|
4
|
-
export declare const COMMAND_ID = "workbench.command.prompts.use";
|
|
5
|
-
export declare function getFocusedChatWidget(accessor: ServicesAccessor): IChatWidget | undefined;
|
|
6
|
-
export declare function getActiveCodeEditor(accessor: ServicesAccessor): IActiveCodeEditor | undefined;
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
-
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
4
|
-
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
5
|
-
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
6
|
-
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
7
|
-
import { PromptsConfig } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/config';
|
|
8
|
-
import { isPromptFile } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
9
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
10
|
-
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
11
|
-
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
12
|
-
import { MenuRegistry, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
13
|
-
import { isCodeEditor, isDiffEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
|
|
14
|
-
import { KeybindingsRegistry, KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
15
|
-
import { ATTACH_PROMPT_ACTION_ID } from '../../actions/chatAttachPromptAction/chatAttachPromptAction.js';
|
|
16
|
-
|
|
17
|
-
const COMMAND_ID = 'workbench.command.prompts.use';
|
|
18
|
-
const COMMAND_KEY_BINDING = KeyMod.CtrlCmd | KeyCode.Slash | KeyMod.Alt;
|
|
19
|
-
const command = async (accessor) => {
|
|
20
|
-
const commandService = accessor.get(ICommandService);
|
|
21
|
-
const options = {
|
|
22
|
-
resource: getActivePromptUri(accessor),
|
|
23
|
-
widget: getFocusedChatWidget(accessor),
|
|
24
|
-
};
|
|
25
|
-
await commandService.executeCommand(ATTACH_PROMPT_ACTION_ID, options);
|
|
26
|
-
};
|
|
27
|
-
function getFocusedChatWidget(accessor) {
|
|
28
|
-
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
29
|
-
const { lastFocusedWidget } = chatWidgetService;
|
|
30
|
-
if (!lastFocusedWidget) {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
if (!lastFocusedWidget.hasInputFocus()) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
return lastFocusedWidget;
|
|
37
|
-
}
|
|
38
|
-
function getActiveCodeEditor(accessor) {
|
|
39
|
-
const editorService = accessor.get(IEditorService);
|
|
40
|
-
const { activeTextEditorControl } = editorService;
|
|
41
|
-
if (isCodeEditor(activeTextEditorControl) && activeTextEditorControl.hasModel()) {
|
|
42
|
-
return activeTextEditorControl;
|
|
43
|
-
}
|
|
44
|
-
if (isDiffEditor(activeTextEditorControl)) {
|
|
45
|
-
const originalEditor = activeTextEditorControl.getOriginalEditor();
|
|
46
|
-
if (!originalEditor.hasModel()) {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
return originalEditor;
|
|
50
|
-
}
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
const getActivePromptUri = (accessor) => {
|
|
54
|
-
const activeEditor = getActiveCodeEditor(accessor);
|
|
55
|
-
if (!activeEditor) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
const { uri } = activeEditor.getModel();
|
|
59
|
-
if (isPromptFile(uri)) {
|
|
60
|
-
return uri;
|
|
61
|
-
}
|
|
62
|
-
return undefined;
|
|
63
|
-
};
|
|
64
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
65
|
-
id: COMMAND_ID,
|
|
66
|
-
weight: KeybindingWeight.WorkbenchContrib,
|
|
67
|
-
primary: COMMAND_KEY_BINDING,
|
|
68
|
-
handler: command,
|
|
69
|
-
when: ( ContextKeyExpr.and(PromptsConfig.enabledCtx, ChatContextKeys.enabled)),
|
|
70
|
-
});
|
|
71
|
-
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
72
|
-
command: {
|
|
73
|
-
id: COMMAND_ID,
|
|
74
|
-
title: ( localize(4920, "Use Prompt")),
|
|
75
|
-
category: CHAT_CATEGORY
|
|
76
|
-
},
|
|
77
|
-
when: ( ContextKeyExpr.and(PromptsConfig.enabledCtx, ChatContextKeys.enabled))
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
export { COMMAND_ID, getActiveCodeEditor, getFocusedChatWidget };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { PROMPT_FILE_EXTENSION, COPILOT_CUSTOM_INSTRUCTIONS_FILENAME } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
3
|
-
|
|
4
|
-
const DOCUMENTATION_URL = 'https://aka.ms/vscode-ghcp-prompt-snippets';
|
|
5
|
-
const REUSABLE_PROMPT_FILE_PATTERNS = ( Object.freeze([
|
|
6
|
-
`**/*${PROMPT_FILE_EXTENSION}`,
|
|
7
|
-
`**/.github/${COPILOT_CUSTOM_INSTRUCTIONS_FILENAME}`,
|
|
8
|
-
]));
|
|
9
|
-
const LANGUAGE_SELECTOR = ( Object.freeze({
|
|
10
|
-
pattern: `{${REUSABLE_PROMPT_FILE_PATTERNS.join(',')}}`,
|
|
11
|
-
}));
|
|
12
|
-
|
|
13
|
-
export { DOCUMENTATION_URL, LANGUAGE_SELECTOR };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IPromptContentsProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/types";
|
|
2
|
-
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
-
import { VSBuffer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/buffer";
|
|
4
|
-
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
5
|
-
import { PromptContentsProviderBase } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase";
|
|
6
|
-
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
7
|
-
import { ReadableStream } from "@codingame/monaco-vscode-api/vscode/vs/base/common/stream";
|
|
8
|
-
import { IModelContentChangedEvent } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/textModelEvents";
|
|
9
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
10
|
-
import { TextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel";
|
|
11
|
-
export declare class TextModelContentsProvider extends PromptContentsProviderBase<IModelContentChangedEvent> {
|
|
12
|
-
private readonly model;
|
|
13
|
-
private readonly initService;
|
|
14
|
-
readonly uri: URI;
|
|
15
|
-
constructor(model: ITextModel, initService: IInstantiationService);
|
|
16
|
-
protected getContentsStream(_event: IModelContentChangedEvent | "full", cancellationToken?: CancellationToken): Promise<ReadableStream<VSBuffer>>;
|
|
17
|
-
createNew(promptContentsSource: TextModel | {
|
|
18
|
-
uri: URI;
|
|
19
|
-
}): IPromptContentsProvider;
|
|
20
|
-
toString(): string;
|
|
21
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
-
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
|
-
import { FilePromptContentProvider } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/filePromptContentsProvider';
|
|
6
|
-
import { PromptContentsProviderBase } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase';
|
|
7
|
-
import { newWriteableStream } from '@codingame/monaco-vscode-api/vscode/vs/base/common/stream';
|
|
8
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
|
-
import { TextModel } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
10
|
-
|
|
11
|
-
var TextModelContentsProvider_1;
|
|
12
|
-
let TextModelContentsProvider = TextModelContentsProvider_1 = class TextModelContentsProvider extends PromptContentsProviderBase {
|
|
13
|
-
constructor(model, initService) {
|
|
14
|
-
super();
|
|
15
|
-
this.model = model;
|
|
16
|
-
this.initService = initService;
|
|
17
|
-
this.uri = this.model.uri;
|
|
18
|
-
this._register(this.model.onWillDispose(this.dispose.bind(this)));
|
|
19
|
-
this._register(this.model.onDidChangeContent(this.onChangeEmitter.fire));
|
|
20
|
-
}
|
|
21
|
-
async getContentsStream(_event, cancellationToken) {
|
|
22
|
-
const stream = newWriteableStream(null);
|
|
23
|
-
const linesCount = this.model.getLineCount();
|
|
24
|
-
let i = 1;
|
|
25
|
-
const interval = setInterval(() => {
|
|
26
|
-
if (i >= linesCount) {
|
|
27
|
-
clearInterval(interval);
|
|
28
|
-
stream.end();
|
|
29
|
-
stream.destroy();
|
|
30
|
-
}
|
|
31
|
-
if (this.model.isDisposed() || cancellationToken?.isCancellationRequested) {
|
|
32
|
-
clearInterval(interval);
|
|
33
|
-
stream.error(( new CancellationError()));
|
|
34
|
-
stream.destroy();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
stream.write(VSBuffer.fromString(this.model.getLineContent(i)));
|
|
39
|
-
if (i !== linesCount) {
|
|
40
|
-
stream.write(VSBuffer.fromString(this.model.getEOL()));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
console.log(this.uri, i, error);
|
|
45
|
-
}
|
|
46
|
-
i++;
|
|
47
|
-
}, 1);
|
|
48
|
-
return stream;
|
|
49
|
-
}
|
|
50
|
-
createNew(promptContentsSource) {
|
|
51
|
-
if (promptContentsSource instanceof TextModel) {
|
|
52
|
-
return this.initService.createInstance(TextModelContentsProvider_1, promptContentsSource);
|
|
53
|
-
}
|
|
54
|
-
return this.initService.createInstance(FilePromptContentProvider, promptContentsSource.uri);
|
|
55
|
-
}
|
|
56
|
-
toString() {
|
|
57
|
-
return `text-model-prompt-contents-provider:${this.uri.path}`;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
TextModelContentsProvider = TextModelContentsProvider_1 = ( __decorate([
|
|
61
|
-
( __param(1, IInstantiationService))
|
|
62
|
-
], TextModelContentsProvider));
|
|
63
|
-
|
|
64
|
-
export { TextModelContentsProvider };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
3
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
-
export declare class PromptLinkDiagnosticsInstanceManager extends Disposable {
|
|
6
|
-
private readonly providers;
|
|
7
|
-
constructor(editorService: IEditorService, initService: IInstantiationService, configService: IConfigurationService);
|
|
8
|
-
private handleNewEditor;
|
|
9
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/types.service';
|
|
4
|
-
import { assert } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
5
|
-
import { NotPromptFile } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/promptFileReferenceErrors';
|
|
6
|
-
import { assertDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
-
import { ObjectCache } from '../../../../../../base/common/objectCache.js';
|
|
9
|
-
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
10
|
-
import { PromptsConfig } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/config';
|
|
11
|
-
import { isPromptFile } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
12
|
-
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
13
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
14
|
-
import { ObservableDisposable } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/base/common/observableDisposable';
|
|
15
|
-
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
16
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
17
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
18
|
-
import { MarkerSeverity } from '@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers';
|
|
19
|
-
import { IMarkerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers.service';
|
|
20
|
-
|
|
21
|
-
const MARKERS_OWNER_ID = 'reusable-prompts-syntax';
|
|
22
|
-
let PromptLinkDiagnosticsProvider = class PromptLinkDiagnosticsProvider extends ObservableDisposable {
|
|
23
|
-
constructor(editor, markerService, promptsService) {
|
|
24
|
-
super();
|
|
25
|
-
this.editor = editor;
|
|
26
|
-
this.markerService = markerService;
|
|
27
|
-
this.promptsService = promptsService;
|
|
28
|
-
this.parser = this.promptsService
|
|
29
|
-
.getSyntaxParserFor(this.editor)
|
|
30
|
-
.onUpdate(this.updateMarkers.bind(this))
|
|
31
|
-
.onDispose(this.dispose.bind(this))
|
|
32
|
-
.start();
|
|
33
|
-
this.updateMarkers();
|
|
34
|
-
}
|
|
35
|
-
async updateMarkers() {
|
|
36
|
-
await this.parser.allSettled();
|
|
37
|
-
this.markerService.remove(MARKERS_OWNER_ID, [this.editor.uri]);
|
|
38
|
-
const markers = [];
|
|
39
|
-
for (const link of this.parser.references) {
|
|
40
|
-
const { topError, linkRange } = link;
|
|
41
|
-
if (!topError || !linkRange) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
const { originalError } = topError;
|
|
45
|
-
if (originalError instanceof NotPromptFile) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
markers.push(toMarker(link));
|
|
49
|
-
}
|
|
50
|
-
this.markerService.changeOne(MARKERS_OWNER_ID, this.editor.uri, markers);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
PromptLinkDiagnosticsProvider = ( __decorate([
|
|
54
|
-
( __param(1, IMarkerService)),
|
|
55
|
-
( __param(2, IPromptsService))
|
|
56
|
-
], PromptLinkDiagnosticsProvider));
|
|
57
|
-
const toMarker = (link) => {
|
|
58
|
-
const { topError, linkRange } = link;
|
|
59
|
-
assertDefined(topError, 'Top error must to be defined.');
|
|
60
|
-
assertDefined(linkRange, 'Link range must to be defined.');
|
|
61
|
-
const { originalError } = topError;
|
|
62
|
-
assert(!(originalError instanceof NotPromptFile), 'Error must not be of "not prompt file" type.');
|
|
63
|
-
const severity = (topError.errorSubject === 'root')
|
|
64
|
-
? MarkerSeverity.Error
|
|
65
|
-
: MarkerSeverity.Warning;
|
|
66
|
-
return {
|
|
67
|
-
message: topError.localizedMessage,
|
|
68
|
-
severity,
|
|
69
|
-
...linkRange,
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
let PromptLinkDiagnosticsInstanceManager = class PromptLinkDiagnosticsInstanceManager extends Disposable {
|
|
73
|
-
constructor(editorService, initService, configService) {
|
|
74
|
-
super();
|
|
75
|
-
this.providers = this._register(( new ObjectCache((editor) => {
|
|
76
|
-
const parser = initService.createInstance(PromptLinkDiagnosticsProvider, editor);
|
|
77
|
-
parser.assertNotDisposed('Created prompt parser must not be disposed.');
|
|
78
|
-
return parser;
|
|
79
|
-
})));
|
|
80
|
-
if (!PromptsConfig.enabled(configService)) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
this._register(editorService.onDidActiveEditorChange(() => {
|
|
84
|
-
const { activeTextEditorControl } = editorService;
|
|
85
|
-
if (!activeTextEditorControl) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
this.handleNewEditor(activeTextEditorControl);
|
|
89
|
-
}));
|
|
90
|
-
editorService
|
|
91
|
-
.visibleTextEditorControls
|
|
92
|
-
.forEach(this.handleNewEditor.bind(this));
|
|
93
|
-
}
|
|
94
|
-
handleNewEditor(editor) {
|
|
95
|
-
const model = editor.getModel();
|
|
96
|
-
if (!model) {
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
if ('modified' in model || 'model' in model) {
|
|
100
|
-
return this;
|
|
101
|
-
}
|
|
102
|
-
if (!isPromptFile(model.uri)) {
|
|
103
|
-
return this;
|
|
104
|
-
}
|
|
105
|
-
this.providers.get(model);
|
|
106
|
-
return this;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
PromptLinkDiagnosticsInstanceManager = ( __decorate([
|
|
110
|
-
( __param(0, IEditorService)),
|
|
111
|
-
( __param(1, IInstantiationService)),
|
|
112
|
-
( __param(2, IConfigurationService))
|
|
113
|
-
], PromptLinkDiagnosticsInstanceManager));
|
|
114
|
-
( Registry.as(Extensions.Workbench))
|
|
115
|
-
.registerWorkbenchContribution(PromptLinkDiagnosticsInstanceManager, LifecyclePhase.Eventually);
|
|
116
|
-
|
|
117
|
-
export { PromptLinkDiagnosticsInstanceManager };
|