Skip to content

Commit b2feb82

Browse files
authored
ignore prompt-lang for inline chat hint (microsoft#248991)
1 parent 6947b69 commit b2feb82

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ import { stringValue } from '../../../../base/browser/cssValue.js';
4040
import { observableConfigValue } from '../../../../platform/observable/common/platformObservableUtils.js';
4141
import { Emitter } from '../../../../base/common/event.js';
4242
import { ChatAgentLocation } from '../../chat/common/constants.js';
43+
import { INSTRUCTIONS_LANGUAGE_ID } from '../../chat/common/promptSyntax/constants.js';
44+
45+
/**
46+
* Set of language IDs where inline chat hints should not be shown.
47+
*/
48+
const IGNORED_LANGUAGE_IDS = new Set([
49+
PLAINTEXT_LANGUAGE_ID,
50+
'markdown',
51+
'search-result',
52+
INSTRUCTIONS_LANGUAGE_ID
53+
]);
4354

4455
export const CTX_INLINE_CHAT_SHOWING_HINT = new RawContextKey<boolean>('inlineChatShowingHint', false, localize('inlineChatShowingHint', "Whether inline chat shows a contextual hint"));
4556

@@ -237,11 +248,10 @@ export class InlineChatHintsController extends Disposable implements IEditorCont
237248
return undefined;
238249
}
239250

240-
if (model.getLanguageId() === PLAINTEXT_LANGUAGE_ID || model.getLanguageId() === 'markdown' || model.getLanguageId() === 'search-result') {
251+
if (IGNORED_LANGUAGE_IDS.has(model.getLanguageId())) {
241252
return undefined;
242253
}
243254

244-
245255
// DEBT - I cannot use `model.onDidChangeContent` directly here
246256
// https://github.com/microsoft/vscode/issues/242059
247257
const emitter = r.store.add(new Emitter<void>());

0 commit comments

Comments
 (0)