一帘幽梦是什么意思| 鱼非念什么| 视力5.3是什么概念| bruce是什么意思| 舌头热灼是什么原因| 生蛇是什么病| 黑色素瘤是什么| 梦到自己孩子死了是什么征兆| 鸡眼去医院挂什么科| 眼镜什么品牌好| 出口伤人是什么生肖| 加盟店是什么意思| 解解乏是什么意思| 八五年属什么生肖| 五行什么生木| 蛋白肉是什么东西做的| 幼儿园什么时候开学| 感染艾滋病有什么症状| 白细胞计数偏低是什么原因| 五月天主唱叫什么名字| jeep是什么意思| 右胸上部隐痛什么原因| 羊膜囊是什么| 什么是牙线| 尿蛋白高吃什么食物好| 什么检查需要空腹| 头皮上长疣是什么原因造成的| 心血管病人吃什么最好| 吃什么排铜最快| 四点半是什么时辰| 丹凤眼是什么样的| 气短气喘吃什么药| 医生代表什么生肖| 老师为什么叫老师| 中元节又叫什么节| 谨记是什么意思| 双鱼座有什么特点| 18k是什么意思| 吃什么可以淡化黄褐斑| 高危性行为是什么意思| 包饺子剩下的面团能做什么| 七月四号是什么星座| 临床表现是什么意思| 小孩荨麻疹吃什么药| 绿色食品是什么意思| 屎壳郎吃什么| 猪肉馅饺子配什么菜| 孕早期生气对胎儿有什么影响| 立字五行属什么| 冷泡茶用什么茶叶| 气的什么| 什么可以保护眼睛| 狂鸟读什么| 男性内分泌失调吃什么药| 尿酸高会得什么病| 阳瘘的最佳治疗方法是什么| 塑料是什么材质| 卡针是什么| 晚上睡觉腿酸难受是什么原因| 黄体不足吃什么补最快| 荧惑守心是什么意思| 肉筋是什么| nb是什么意思| 散光是什么症状| 输血四项检查是什么| 吉可以加什么偏旁| 1213是什么日子| 超市属于什么行业| 今天什么日子老黄历| 女人吃葛根粉有什么好处| 化痰止咳吃什么药最好| 阴道有褐色分泌物是什么原因| 今天突然拉稀拉出血什么原因| 甲状腺结节吃什么药| ryan是什么意思| 孕检唐筛是检查什么的| 日柱灾煞是什么意思| 逍遥丸什么时候吃| 韩信属什么生肖| 鹿的角像什么| 辟邪剑谱和葵花宝典有什么关系| 口腔黏膜挂什么科| 展望未来什么意思| 为什么不能天天做有氧运动| 南辕北辙是什么意思| 口腔出血是什么原因| 什么是小针刀治疗| 黄豆什么时候播种| 荷花象征什么| 久站腰疼是什么原因| 槟榔是什么味道的| 后背不舒服是什么原因| 吃什么可以增加免疫力| 病毒感染发烧吃什么药| 坐月子什么不可以吃| 血热皮肤瘙痒吃什么药| 孕妇感冒可以吃什么感冒药| 柠檬水什么时候喝最好| 肾阴虚吃什么食物最好| 深渊什么意思| 心肌酶能查出什么病| b站的硬币有什么用| 大姨妈来了喝红糖水有什么功效| ppsu是什么材质| 不下面一个一念什么| 钛色是什么颜色| 空调用什么插座| 什么是便秘| 恶病质是什么意思| 玉树临风是什么意思| 检查肠胃挂什么科| 唐氏儿是什么意思| 厮守是什么意思| 牙齿深覆合是什么意思| 眼尖什么意思| 鱼鳔是什么| 维生素e和维生素c一起吃有什么效果| 考试前吃什么| 脱氧核苷酸是什么| 什么是宦官| 芝士是什么东西| 颈椎退行性病变是什么意思| 梦见很多人是什么意思| 红颜知己是什么意思| 欧了是什么意思| 办理护照需要什么| 浮白是什么意思| 世界八大奇迹是什么| 五月二十是什么星座| 667什么意思| 八月节是什么节| 耦合是什么意思| 皮肤软组织感染用什么消炎药| 菠萝蜜和什么不能一起吃| 吃什么食物对肝好| 1950年属什么生肖| 边界是什么意思| 家财万贯是什么生肖| 耳鸣吃什么中成药| 汗疱疹是什么原因引起| miu是什么意思| 死亡是什么感觉| 姨妈不正常是什么原因| 97年属什么的生肖| 风湿性心脏病是什么原因引起的| 朱砂是什么材质| 太妃糖为什么叫太妃糖| bw是什么意思| 牙虫是什么样的图片| gl值是什么意思| 2001年出生属什么| 泰迪哼哼唧唧表示什么| 上吐下泻是什么原因| 鹌鹑蛋是什么动物的蛋| 吃芒果过敏吃什么药| 后背沉重感是什么原因引起的| 中字五行属什么| 梦见和亲人吵架是什么意思| 双卵巢是什么意思| 冒菜和麻辣烫有什么区别| 芝柏手表什么档次| 伊玛目是什么意思| 喝中药可以吃什么水果| 胆固醇高是什么引起的| 甘油三酯高吃什么好| 推特为什么注册不了| 黑色屎是什么原因| 尼姑庵是什么意思| 韬光养晦是什么意思| hrp是什么意思| hg是什么元素| 氧化剂是什么| 亚型是什么意思| 八三年属什么生肖| 支原体是什么病| 大便稀溏是什么意思| 2010年是什么生肖| 恐龙为什么会灭绝| 以身相许是什么意思| 女人一般什么时候容易怀孕| 大脚趾发黑是什么原因| 四月十八日是什么日子| 女性白带有血丝是什么原因| 脚心热吃什么药| 有个性是什么意思| 夏令时是什么意思| 虎皮鹦鹉吃什么食物| 坐飞机不能带什么物品| 借刀杀人是什么生肖| 治疗阳痿早泄用什么药| 玮是什么意思| 喝酒头疼是什么原因| 胡萝卜吃多了有什么坏处| 葡萄的茎属于什么茎| 钛合金是什么材料| 酒量越来越差什么原因| 被蛇咬了挂什么科| 仙是什么意思| iu什么意思| 为什么睡觉会磨牙| 胎位不正是什么原因导致的| 什么花香| 喜上眉梢是什么意思| 卫青为什么被灭九族| 云南小黄姜有什么功效| 五角硬币是什么材质| 什么精神| 梦见死人什么意思| 神经梅毒有什么症状| 财不外露什么意思| 400年前是什么朝代| 股票套牢是什么意思| zero什么意思| 干咳无痰吃什么药好| 小腿抽筋什么原因| 化学阉割什么意思| 清炖鸡放什么调料| flour是什么意思| 喝酒吐血是什么原因| 贫血喝什么口服液| 为什么经常口腔溃疡| 动物的尾巴有什么作用| 抑郁症是什么| 身份证号码最后一位代表什么| 牙龈肿痛看什么科| 抗ccp抗体高说明什么| 北极熊为什么不怕冷| 闲鱼转卖什么意思| 拔牙之后吃什么消炎药| 祖宗是什么意思| 狐狸是什么动物| 为什么不建议光子嫩肤| 软件开发属于什么行业| 三伏天是什么时候开始| 皮下水肿是什么原因| river是什么意思| 干邑是什么意思| 小基数是什么意思| 更年期什么时候结束| 法院起诉离婚需要什么材料| 判处死刑缓期二年执行是什么意思| 天麻加什么治头晕| 尿出红色的尿是什么原因| 塔姆是什么动物| 春天像什么的比喻句| 1912年属什么生肖| 胰腺炎吃什么食物| 脂肪瘤长什么样| 小脑延髓池是什么意思| t1是什么意思| 见利忘义是什么意思| 蛤蚧是什么动物| 猴子偷桃是什么意思| 隐血试验阴性是什么意思| 大饼脸适合什么发型| 丁亥日五行属什么| 11月生日是什么星座| 什么人不宜吃石斛| 零七年属什么生肖| 怀孕前三个月需要注意什么| 兔唇是什么原因造成的| 肚子饱胀是什么原因| 脑梗死吃什么药| 佬是什么意思| 百度

Try to extend agent mode in VS Code!

一级军士长什么待遇

百度 不仅如此,吴镇宇还凭借这次的表演获得了第36届香港电影金像奖最佳男主角提名,得到了专业评委的认可。

This article provides tips and tricks to optimize your development experience for using GitHub Copilot in Visual Studio Code.

Checklist for using Copilot in VS Code

Use the following checklist to get the most out of Copilot:

  1. Choose the right tool. Use the tool that's optimized for editing, asking questions, or staying in the flow of writing code.

  2. Personalize Copilot. Use custom instructions to get code suggestions that match your style and coding practices.

  3. Write effective prompts and provide context. Get the most relevant responses.

  4. Index your workspace. Receive accurate responses to questions about your codebase.

  5. Choose your AI model. Choose between models for fast coding or planning/reasoning.

  6. Reuse prompts. Save time by saving and reusing task-specific prompts across your team.

Choose the right Copilot tool

Depending on your task, you can choose between different Copilot tools.

Tool Use case
Code completions Streamline coding while staying in the flow.
Receive inline suggestions for code snippets, variable names, and functions as you write them in the editor.
Chat Have an ongoing chat conversation for brainstorming design ideas or getting code suggestions, optionally calling on domain-specific chat participants.
Choose to apply specific code suggestions to your codebase.
Edits Use natural language to start a coding editing session.
Automatically apply large code changes across multiple files in your workspace.
Agent mode Implement high-level requirements by starting an agentic coding flow.
Copilot autonomously invokes multiple tools to plan and implement the code changes and tasks that are needed.

Personalize Copilot with instructions files

When Copilot generates code or answers questions, it tries to match your coding practices and preferences such as which libraries you use or how you name your variables. However, it might not always have enough context to do this effectively. For example, if you work with a specific framework version, you need to provide additional context in your prompts.

To enhance AI responses, you can use instructions files to provide contextual details about your team's coding practices, tools, or project specifics. You can then attach these instructions to your chat prompt, or have them applied automatically.

To enable instructions files for your workspace:

  1. Run the Chat: New Instructions File command from the Command Palette.

    This command creates a .instructions.md file in .github/instructions folder.

  2. Add your instructions in Markdown format to the file. For example:

    # Custom instructions for Copilot
    
    ## Project context
    This project is a web application built with React and Node.js.
    
    ## Indentation
    We use tabs, not spaces.
    
    ## Coding style
    Use camelCase for variable names and prefer arrow functions over traditional function expressions.
    
    ## Testing
    We use Jest for unit testing and Playwright for end-to-end testing.
    
  3. Optionally, add a glob pattern to the applyTo metadata field to specify which files the instructions apply to.

    ---
    applyTo: "**/*.ts"
    ---
    Coding practices for TypeScript files.
    ...
    

Get more details about using instructions files in VS Code.

Prompt engineering

You can enhance the quality of Copilot's responses by using effective prompts. A well-crafted prompt can help Copilot understand your requirements better and generate more relevant code suggestions.

  • Start general, then get specific.

    Generate a Calculator class.
    Add methods for addition, subtraction, multiplication, division, and factorial.
    Don't use any external libraries and don't use recursion.
    
  • Give examples of what you want.

    Generate a function that takes a string and returns the number of vowels in it.
    Example:
    findVowels("hello") returns 2
    findVowels("sky") returns 0
    
  • Break down complex tasks into simpler tasks.

    Instead of asking Copilot to generate a meal planner app, break it down into smaller tasks:

    • Generate a function that takes a list of ingredients and returns a list of recipes.
    • Generate a function that takes a list of recipes and returns a shopping list.
    • Generate a function that takes a list of recipes and returns a meal plan for the week.
  • Provide the right context, such as code selections, files, terminal output, and more.

    Example, use the #codebase variable to refer to the entire codebase:

    Where is the database connection string used in #codebase?
    
  • Iterate on your prompts.

    Provide follow-up prompts to refine or modify the response. For example:

    • "Write a function to calculate the factorial of a number."
    • "Don't use recursion and optimize by using caching."
    • "Use meaningful variable names."
  • Keep chat history relevant.

    Copilot uses history of the conversation to provide context. Remove past questions and responses from the history if they're not relevant. Or, start a new session if you want to change the context.

Get more details about prompt engineering.

Find practical examples of prompts to use with Copilot in the GitHub Copilot documentation.

Provide the right context and tools

Enrich your prompts with relevant context to get more accurate and relevant responses in chat. Withe the right tools, you can boost your developer productivity.

  • In agent mode, select the tools button to configure the tools you want to use or explicitly add then to your prompt.
  • Use #codebase to let Copilot find the right files automatically by performing a code search.
  • Use the #fetch tool to fetch content from a web page or use #githubRepo to perform a code search on a GitHub repository.
  • Reference files, folders, or symbols in your prompt by using #<file name>, #<folder name>, or #<symbol>.
  • Drag and drop files, folders, or editor tabs onto the chat prompt.
  • Add problems, test failures, or terminal output to your chat prompt for scenario-specific context.
  • Add images or screenshots to your prompt to let Copilot analyze the image.
  • In agent mode, prompt to preview your app to directly open it with the built-in simple browser.

When you use agent mode, Copilot autonomously finds the relevant files and context for you.

Get more details about adding context to chat prompts.

Reusable prompts

Prompt files enable you to save a prompt for a specific task with its context and instructions in a Markdown file. You can then attach and reuse that prompt in chat. If you store the prompt in your workspace, you can also share it with your team.

To create a reusable prompt:

  1. Create a prompt file with the Chat: New Prompt File command in the Command Palette.

    This command creates a .prompt.md file in the .github/prompts folder at the root of your workspace.

  2. Describe your prompt and relevant context in Markdown format.

    For example, use this prompt to generate a new React form component.

    Your goal is to generate a new React form component.
    
    Ask for the form name and fields if not provided.
    
    Requirements for the form:
    * Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
    * Use `react-hook-form` for form state management:
    * Always define TypeScript types for your form data
    * Prefer *uncontrolled* components using register
    * Use `defaultValues` to prevent unnecessary rerenders
    * Use `yup` for validation:
    * Create reusable validation schemas in separate files
    * Use TypeScript types to ensure type safety
    * Customize UX-friendly validation rules
    
  3. Optionally, add metadata about how to run the prompt in chat. Use the mode field to specify the chat mode, and the tools field to specify which agent mode tools to use.

    ---
    mode: 'agent'
    tools: ['githubRepo', 'codebase']
    description: 'Generate a new React form component'
    ---
    Your goal is to generate a new React form component based on the templates in #githubRepo contoso/react-templates.
    
    Requirements for the form:
    * Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
    * Use `react-hook-form` for form state management:
    * Always define TypeScript types for your form data
    
  4. Run the command by typing /, followed by the prompt file name in the chat input field.

    For example, type /new-react-form to run the prompt file named new-react-form.prompt.md.

Get started with prompt files.

Choose your AI model

Copilot offers different AI models to choose from. Some models are optimized for fast coding tasks, while others are better suited for slower planning and reasoning tasks.

Model type Models
Fast coding
  • GPT-4o
  • Claude Sonnet 3.5
  • Claude Sonnet 3.7
  • Gemini 2.0 Flash
Reasoning/planning
  • Claude Sonnet 3.7 Thinking
  • o1
  • o3-mini

Choose the model that best fits your needs by using the model picker in the chat input field.

Learn more about AI models for Copilot Chat in the GitHub Copilot documentation.

Workspace indexing

Copilot uses an index to quickly and accurately search your codebase for relevant code snippets. This index can either be maintained by GitHub or stored locally on your machine.

For GitHub repositories, you can use a remote index of your workspace, based on GitHub code search. This allows Copilot to search your entire codebase very quickly, even if the codebase is very large.

Get more details about workspace indexing.

为什么喝完酒头疼 鹿几念什么 右脸麻木是什么原因 黄色搭配什么颜色 茶鱼是什么鱼
吃了头孢不能吃什么 炎字五行属什么 体检胸透主要检查什么 气虚的人适合什么运动 割包皮是什么意思
什么茶降血压 红楼梦是一部什么小说 生理期为什么会肚子疼 什么叫甘油三酯 头晕拉肚子是什么情况
申时属什么 血脂厚有什么症状 尖锐湿疣是什么病 一直倒霉预示着什么 什么的松树
女性吃什么改善更年期hcv9jop4ns8r.cn 什么是眼底病hcv7jop5ns5r.cn 瞳距是什么hcv8jop4ns2r.cn 中国防御系统叫什么hcv8jop7ns1r.cn 女命劫财代表什么hcv9jop6ns8r.cn
南瓜子有什么功效hcv9jop2ns9r.cn 小孩头晕是什么原因hcv8jop2ns2r.cn 九孔藕和七孔藕有什么区别hcv9jop3ns3r.cn 喝桑叶茶有什么好处hcv9jop2ns9r.cn 哮喘有什么症状hcv9jop1ns0r.cn
阿戈美拉汀片是什么药hcv7jop7ns0r.cn 筋膜炎吃什么药好得快hcv9jop4ns3r.cn 2018年是什么命hcv8jop8ns8r.cn 人为什么会发烧hcv9jop7ns9r.cn 白球比例偏高说明什么hcv7jop7ns4r.cn
蕊字五行属什么hcv9jop4ns9r.cn 什么是石女mmeoe.com 处女膜是什么颜色hcv8jop7ns6r.cn 魏大勋和李沁什么关系hcv9jop6ns9r.cn 皮肤上有小白斑点是什么原因gysmod.com
百度