Skip to content

Commit 6baed39

Browse files
rebornixamungerCopilot
authored
Re #269153. Ensure the file pill for notebook always renders (#1200)
* Re #269153. Ensure the file pill for notebook always renders * Update src/extension/tools/node/editNotebookTool.tsx Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Aaron Munger <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 51a07fb commit 6baed39

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/extension/tools/node/editNotebookTool.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ import { createSingleCallFunction } from '../../../util/vs/base/common/functiona
2626
import { DisposableStore, toDisposable } from '../../../util/vs/base/common/lifecycle';
2727
import { isEqual } from '../../../util/vs/base/common/resources';
2828
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
29-
import { EndOfLine, EventEmitter, LanguageModelPromptTsxPart, LanguageModelTextPart, LanguageModelToolResult, NotebookCellData, NotebookCellKind, NotebookEdit, NotebookRange, Position, Range, TextEdit } from '../../../vscodeTypes';
29+
import { EndOfLine, EventEmitter, LanguageModelPromptTsxPart, LanguageModelTextPart, LanguageModelToolResult, MarkdownString, NotebookCellData, NotebookCellKind, NotebookEdit, NotebookRange, Position, Range, TextEdit } from '../../../vscodeTypes';
3030
import { IBuildPromptContext } from '../../prompt/common/intents';
3131
import { renderPromptElementJSON } from '../../prompts/node/base/promptRenderer';
3232
import { Tag } from '../../prompts/node/base/tag';
3333
import { EXISTING_CODE_MARKER } from '../../prompts/node/panel/codeBlockFormattingRules';
3434
import { CodeBlock } from '../../prompts/node/panel/safeElements';
3535
import { ToolName } from '../common/toolNames';
3636
import { ICopilotTool, ToolRegistry } from '../common/toolsRegistry';
37+
import { formatUriForFileWidget, resolveToolInputPath } from './toolUtils';
3738

3839
export interface IEditNotebookToolParams {
3940
filePath: string;
@@ -298,9 +299,9 @@ export class EditNotebookTool implements ICopilotTool<IEditNotebookToolParams> {
298299
}
299300

300301
prepareInvocation(options: vscode.LanguageModelToolInvocationPrepareOptions<IEditNotebookToolParams>, token: vscode.CancellationToken): vscode.ProviderResult<vscode.PreparedToolInvocation> {
302+
const uri = resolveToolInputPath(options.input.filePath, this.promptPathRepresentationService);
301303
return {
302-
invocationMessage: l10n.t('Editing notebook'),
303-
presentation: 'hidden'
304+
invocationMessage: new MarkdownString(l10n.t('Edit {0}', formatUriForFileWidget(uri)))
304305
};
305306
}
306307

0 commit comments

Comments
 (0)