Skip to content

Commit ee88620

Browse files
authored
debt - improve workspace settings and copilot configuration (microsoft#255359)
1 parent 462ce94 commit ee88620

File tree

6 files changed

+260
-198
lines changed

6 files changed

+260
-198
lines changed

.github/chatmodes/learn.chatmode.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: 'Save learnings from conversation'
33
tools: ['codebase', 'editFiles', 'githubRepo', 'runCommands', 'search', 'searchResults', 'usages']
44
---
5+
# Learn mode instructions
56
Please take a moment and deeply reflect on all the steps you took and think if there would have been a piece of information which would have allowed you to work faster (take less steps).
67

7-
The file .vscode/project.instructions.md has been already provided to you. Edit the file such that it would contain information which would have made you work faster. Please don't make this too specific to this task, but rather something that is generic but useful enought to ensure speed-ups in the future for other tasks.
8+
The file .github/copilot-instructions.md has been already provided to you. Edit the file such that it would contain information which would have made you work faster. Please don't make this too specific to this task, but rather something that is generic but useful enought to ensure speed-ups in the future for other tasks.

.github/chatmodes/plan.chatmode.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
---
22
description: 'Plan the solution for a problem.'
3-
tools: ['codebase', 'findTestFiles', 'githubRepo', 'search', 'searchResults', 'usages']
3+
tools: ['codebase', 'fetch', 'findTestFiles', 'githubRepo', 'get_issue', 'get_issue_comments', 'get_me', 'search', 'searchResults', 'usages', 'vscodeAPI']
44
---
5-
I need your help with the following problem. Please take a look, understand the request in depth, and if the request makes sense, research it, understand the existing code, then suggest a clear plan with steps to take to address the request.
5+
# Planning mode instructions
6+
You are an expert software engineer tasked with fixing a bug or adding a new feature in the codebase.
7+
Your goal is to prepare a detailed plan to fix the bug or add the new feature, for this you first need to:
8+
* Understand the context of the bug by reading the issue description and comments.
9+
* Understand the codebase by reading the relevant instruction files.
10+
* If its a bug, then identify the root cause of the bug, and explain this to the user.
11+
12+
Based on your above understanding generate a plan to fix the bug or add the new feature.
13+
Ensure the plan consists of a Markdown document that has the following sections:
14+
15+
* Overview: A brief description of the bug/feature.
16+
* Root Cause: A detailed explanation of the root cause of the bug, including any relevant code snippets or references to the codebase. (only if it's a bug)
17+
* Requirements: A list of requirements to resolve the bug or add the new feature.
18+
* Implementation Steps: A detailed list of steps to implement the bug fix or new feature.
19+
20+
Remember, do not make any code edits, just generate a plan.

.github/copilot-instructions.md

Lines changed: 89 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,115 @@
1-
# Coding Guidelines
2-
3-
## Introduction
4-
5-
These are VS Code coding guidelines. Please also review our [Source Code Organisation](https://github.com/microsoft/vscode/wiki/Source-Code-Organization) page.
6-
7-
## Indentation
1+
# VS Code Copilot Instructions
2+
3+
## Project Overview
4+
5+
Visual Studio Code is built with a layered architecture using TypeScript, web APIs and Electron, combining web technologies with native app capabilities. The codebase is organized into key architectural layers:
6+
7+
### Root Folders
8+
- `src/`: Main TypeScript source code with unit tests in `src/vs/*/test/` folders
9+
- `build/`: Build scripts and CI/CD tools
10+
- `extensions/`: Built-in extensions that ship with VS Code
11+
- `test/`: Integration tests and test infrastructure
12+
- `scripts/`: Development and build scripts
13+
- `resources/`: Static resources (icons, themes, etc.)
14+
- `out/`: Compiled JavaScript output (generated during build)
15+
16+
### Core Architecture (`src/` folder)
17+
- `src/vs/base/` - Foundation utilities and cross-platform abstractions
18+
- `src/vs/platform/` - Platform services and dependency injection infrastructure
19+
- `src/vs/editor/` - Text editor implementation with language services, syntax highlighting, and editing features
20+
- `src/vs/workbench/` - Main application workbench for web and desktop
21+
- `workbench/browser/` - Core workbench UI components (parts, layout, actions)
22+
- `workbench/services/` - Service implementations
23+
- `workbench/contrib/` - Feature contributions (git, debug, search, terminal, etc.)
24+
- `workbench/api/` - Extension host and VS Code API implementation
25+
- `src/vs/code/` - Electron main process specific implementation
26+
- `src/vs/server/` - Server specific implementation
27+
28+
The core architecture follows these principles:
29+
- **Layered architecture** - from `base`, `platform`, `editor`, to `workbench`
30+
- **Dependency injection** - Services are injected through constructor parameters
31+
- **Contribution model** - Features contribute to registries and extension points
32+
- **Cross-platform compatibility** - Abstractions separate platform-specific code
33+
34+
### Built-in Extensions (`extensions/` folder)
35+
The `extensions/` directory contains first-party extensions that ship with VS Code:
36+
- **Language support** - `typescript-language-features/`, `html-language-features/`, `css-language-features/`, etc.
37+
- **Core features** - `git/`, `debug-auto-launch/`, `emmet/`, `markdown-language-features/`
38+
- **Themes** - `theme-*` folders for default color themes
39+
- **Development tools** - `extension-editing/`, `vscode-api-tests/`
40+
41+
Each extension follows the standard VS Code extension structure with `package.json`, TypeScript sources, and contribution points to extend the workbench through the Extension API.
42+
43+
### Finding Related Code
44+
1. **Semantic search first**: Use file search for general concepts
45+
2. **Grep for exact strings**: Use grep for error messages or specific function names
46+
3. **Follow imports**: Check what files import the problematic module
47+
4. **Check test files**: Often reveal usage patterns and expected behavior
48+
49+
## Coding Guidelines
50+
51+
### Indentation
852

953
We use tabs, not spaces.
1054

11-
## Naming Conventions
55+
### Naming Conventions
56+
57+
- Use PascalCase for `type` names
58+
- Use PascalCase for `enum` values
59+
- Use camelCase for `function` and `method` names
60+
- Use camelCase for `property` names and `local variables`
61+
- Use whole words in names when possible
1262

13-
* Use PascalCase for `type` names
14-
* Use PascalCase for `enum` values
15-
* Use camelCase for `function` and `method` names
16-
* Use camelCase for `property` names and `local variables`
17-
* Use whole words in names when possible
63+
### Types
1864

19-
## Types
65+
- Do not export `types` or `functions` unless you need to share it across multiple components
66+
- Do not introduce new `types` or `values` to the global namespace
2067

21-
* Do not export `types` or `functions` unless you need to share it across multiple components
22-
* Do not introduce new `types` or `values` to the global namespace
68+
### Comments
2369

24-
## Comments
70+
- Use JSDoc style comments for `functions`, `interfaces`, `enums`, and `classes`
2571

26-
* When there are comments for `functions`, `interfaces`, `enums`, and `classes` use JSDoc style comments
72+
### Strings
2773

28-
## Strings
74+
- Use "double quotes" for strings shown to the user that need to be externalized (localized)
75+
- Use 'single quotes' otherwise
76+
- All strings visible to the user need to be externalized
2977

30-
* Use "double quotes" for strings shown to the user that need to be externalized (localized)
31-
* Use 'single quotes' otherwise
32-
* All strings visible to the user need to be externalized
78+
### UI labels
79+
- Use title-style capitalization for command labels, buttons and menu items (each word is capitalized).
80+
- Don't capitalize prepositions of four or fewer letters unless it's the first or last word (e.g. "in", "with", "for").
3381

34-
## Style
82+
### Style
3583

36-
* Use arrow functions `=>` over anonymous function expressions
37-
* Only surround arrow function parameters when necessary. For example, `(x) => x + x` is wrong but the following are correct:
84+
- Use arrow functions `=>` over anonymous function expressions
85+
- Only surround arrow function parameters when necessary. For example, `(x) => x + x` is wrong but the following are correct:
3886

39-
```javascript
87+
```typescript
4088
x => x + x
4189
(x, y) => x + y
4290
<T>(x: T, y: T) => x === y
4391
```
4492

45-
* Always surround loop and conditional bodies with curly braces
46-
* Open curly braces always go on the same line as whatever necessitates them
47-
* Parenthesized constructs should have no surrounding whitespace. A single space follows commas, colons, and semicolons in those constructs. For example:
93+
- Always surround loop and conditional bodies with curly braces
94+
- Open curly braces always go on the same line as whatever necessitates them
95+
- Parenthesized constructs should have no surrounding whitespace. A single space follows commas, colons, and semicolons in those constructs. For example:
4896

49-
```javascript
97+
```typescript
5098
for (let i = 0, n = str.length; i < 10; i++) {
5199
if (x < 10) {
52100
foo();
53101
}
54102
}
55-
56103
function f(x: number, y: string): void { }
57104
```
105+
106+
- Whenever possible, use in top-level scopes `export function x(…) {…}` instead of `export const x = (…) => {…}`. One advantage of using the `function` keyword is that the stack-trace shows a good name when debugging.
107+
108+
### Code Quality
109+
110+
- All files must include Microsoft copyright header
111+
- Prefer async/await over Promises, handle cancellation with `CancellationToken`
112+
- All user facing messages must be localized using the applicable localization framework (for example `nls.localize()` method)
113+
- Don't add tests to the wrong test suite (e.g., adding to end of file instead of inside relevant suite)
114+
- Look for existing test patterns before creating new structures
115+
- Use `describe` and `test` consistently with existing patterns
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
applyTo: '**/*.ts'
3+
---
4+
5+
# VS Code Copilot Development Instructions
6+
7+
## ⚠️ MANDATORY COMPILATION CHECK
8+
9+
**CRITICAL: You MUST check compilation output before running ANY script or declaring work complete!**
10+
11+
### Before running any command:
12+
1. **ALWAYS** check the "Core - Build" task output for compilation errors
13+
2. **ALWAYS** check the "Ext - Build" task output for compilation errors
14+
3. **NEVER** run tests if there are compilation errors
15+
4. **FIX** all compilation errors before moving forward
16+
17+
## Scripts
18+
- Use `npm install` to install dependencies if you changed `package.json`
19+
- Use `scripts/test.sh` (or `scripts\test.bat` on Windows) for unit tests (add `--grep <pattern>` to filter tests)
20+
- Use `scripts/test-integration.sh` (or `scripts\test-integration.bat` on Windows) for integration tests
21+
- Use `npm run valid-layers-check` to check for layering issues
22+
23+
## Compilation Tasks
24+
Typescript compilation errors can be found by running the "Core - Build" and "Ext - Build" tasks:
25+
- **Core - Build**: Compiles the main VS Code TypeScript sources
26+
- **Ext - Build**: Compiles the built-in extensions
27+
- These background tasks may already be running from previous development sessions
28+
- If not already running, start them to get real-time compilation feedback
29+
- The tasks provide incremental compilation, so they will automatically recompile when files change

.vscode/project.instructions.md

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)