Skip to content

Commit f40051b

Browse files
authored
Port candidates to main (microsoft#203815)
* Port candidate to main Bringing in microsoft#203574 * Enable #file for stable (microsoft#203549) Fix microsoft#203548
1 parent 06a8ed6 commit f40051b

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ export class ChatMarkdownDecorationsRenderer {
2525
@IKeybindingService private readonly keybindingService: IKeybindingService,
2626
@ILabelService private readonly labelService: ILabelService,
2727
@ILogService private readonly logService: ILogService
28-
) {
29-
30-
}
28+
) { }
3129

3230
convertParsedRequestToMarkdown(parsedRequest: IParsedChatRequest): string {
3331
let result = '';
@@ -37,9 +35,9 @@ export class ChatMarkdownDecorationsRenderer {
3735
} else {
3836
const uri = part instanceof ChatRequestDynamicVariablePart && part.data.map(d => d.value).find((d): d is URI => d instanceof URI)
3937
|| undefined;
40-
const title = uri ? this.labelService.getUriLabel(uri, { relative: true }) : '';
38+
const title = uri ? encodeURIComponent(this.labelService.getUriLabel(uri, { relative: true })) : '';
4139

42-
result += `[${part.text}](${variableRefUrl}${title})`;
40+
result += `[${part.text}](${variableRefUrl}?${title})`;
4341
}
4442
}
4543

@@ -51,7 +49,7 @@ export class ChatMarkdownDecorationsRenderer {
5149
const href = a.getAttribute('data-href');
5250
if (href) {
5351
if (href.startsWith(variableRefUrl)) {
54-
const title = href.slice(variableRefUrl.length);
52+
const title = decodeURIComponent(href.slice(variableRefUrl.length + 1));
5553
a.parentElement!.replaceChild(
5654
this.renderResourceWidget(a.textContent!, title),
5755
a);

src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeat
1717
import { localize } from 'vs/nls';
1818
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
1919
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
20-
import { IProductService } from 'vs/platform/product/common/productService';
2120
import { Registry } from 'vs/platform/registry/common/platform';
2221
import { inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry';
2322
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -512,20 +511,13 @@ class BuiltinDynamicCompletions extends Disposable {
512511
constructor(
513512
@ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService,
514513
@IChatWidgetService private readonly chatWidgetService: IChatWidgetService,
515-
@IConfigurationService private readonly configurationService: IConfigurationService,
516-
@IProductService private readonly productService: IProductService,
517514
) {
518515
super();
519516

520517
this._register(this.languageFeaturesService.completionProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, hasAccessToAllModels: true }, {
521518
_debugDisplayName: 'chatDynamicCompletions',
522519
triggerCharacters: [chatVariableLeader],
523520
provideCompletionItems: async (model: ITextModel, position: Position, _context: CompletionContext, _token: CancellationToken) => {
524-
const fileVariablesEnabled = this.configurationService.getValue('chat.experimental.fileVariables') ?? this.productService.quality !== 'stable';
525-
if (!fileVariablesEnabled) {
526-
return;
527-
}
528-
529521
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
530522
if (!widget || !widget.supportsFileReferences) {
531523
return null;

0 commit comments

Comments
 (0)