Path: blob/main/extensions/copilot/src/extension/prompts/node/panel/editorIntegrationRules.tsx
13405 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { BasePromptElementProps, PromptElement } from '@vscode/prompt-tsx';6import { IConfigurationService } from '../../../../platform/configuration/common/configurationService';78export class EditorIntegrationRules extends PromptElement {9render() {10return (11<>12Use Markdown formatting in your answers.<br />13Make sure to include the programming language name at the start of the Markdown code blocks.<br />14Avoid wrapping the whole response in triple backticks.<br />15<MathIntegrationRules />16The user works in an IDE called Visual Studio Code which has a concept for editors with open files, integrated unit test support, an output pane that shows the output of running the code as well as an integrated terminal.<br />17The active document is the source code the user is looking at right now.<br />18You can only give one reply for each conversation turn.<br />19</>20);21}22}2324export class MathIntegrationRules extends PromptElement {2526constructor(27props: BasePromptElementProps,28@IConfigurationService private readonly configService: IConfigurationService29) {30super(props);31}3233render() {34const mathEnabled = this.configService.getNonExtensionConfig<boolean>('chat.math.enabled');35if (mathEnabled) {36return (37<>38Use KaTeX for math equations in your answers.<br />39Wrap inline math equations in $.<br />40Wrap more complex blocks of math equations in $$.<br />41</>42);43}44}45}464748