Skip to content

Commit 871d0be

Browse files
committed
Merge branch 'main' into merogge/bring-back-voice
2 parents 75e992c + 92d3278 commit 871d0be

File tree

252 files changed

+4307
-2073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+4307
-2073
lines changed

.github/chatmodes/learn.chatmode.md

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

.github/chatmodes/plan.chatmode.md

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

.github/copilot-instructions.md

Lines changed: 90 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,116 @@
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` and `await` over `Promise` and `then` calls
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
116+
- If you create any temporary new files, scripts, or helper files for iteration, clean up these files by removing them at the end of the task
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
applyTo: '**/*.ts'
3+
---
4+
5+
# VS Code Copilot Development Instructions for TypeScript
6+
7+
You MUST check compilation output before running ANY script or declaring work complete!
8+
9+
1. **ALWAYS** check the "Core - Build" task output for compilation errors
10+
2. **ALWAYS** check the "Ext - Build" task output for compilation errors
11+
3. **NEVER** run tests if there are compilation errors
12+
4. **FIX** all compilation errors before moving forward
13+
14+
## TypeScript compilation steps
15+
16+
Typescript compilation errors can be found by running the "Core - Build" and "Ext - Build" tasks:
17+
- **Core - Build**: Compiles the main VS Code TypeScript sources
18+
- **Ext - Build**: Compiles the built-in extensions
19+
- These background tasks may already be running from previous development sessions
20+
- If not already running, start them to get real-time compilation feedback
21+
- The tasks provide incremental compilation, so they will automatically recompile when files change
22+
23+
## TypeScript validation steps
24+
- Use `scripts/test.sh` (or `scripts\test.bat` on Windows) for unit tests (add `--grep <pattern>` to filter tests)
25+
- Use `scripts/test-integration.sh` (or `scripts\test-integration.bat` on Windows) for integration tests
26+
- Use `npm run valid-layers-check` to check for layering issues
27+

.github/prompts/implement.prompt.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
mode: agent
3+
description: 'Implement the solution for a problem.'
4+
tools: ['changes', 'codebase', 'editFiles', 'fetch', 'findTestFiles', 'openSimpleBrowser', 'problems', 'readNotebookCellOutput', 'runCommands', 'runNotebooks', 'runTasks', 'runTests', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'usages', 'vscodeAPI']
5+
---
6+
Please write a high quality, general purpose solution. Implement a solution that works correctly for all valid inputs, not just the test cases. Do not hard-code values or create solutions that only work for specific test inputs. Instead, implement the actual logic that solves the problem generally.
7+
8+
Focus on understanding the problem requirements and implementing the correct algorithm. Tests are there to verify correctness, not to define the solution. Provide a principled implementation that follows best practices and software design principles.
9+
10+
If the task is unreasonable or infeasible, or if any of the tests are incorrect, please tell me. The solution should be robust, maintainable, and extendable.

.github/prompts/plan.prompt.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
mode: agent
3+
description: 'Plan the solution for a problem.'
4+
tools: ['codebase', 'fetch', 'findTestFiles', 'githubRepo', 'get_issue', 'get_issue_comments', 'get_me', 'search', 'searchResults', 'usages', 'vscodeAPI']
5+
---
6+
Your goal is to prepare a detailed plan to fix the bug or add the new feature, for this you first need to:
7+
* Understand the context of the bug or feature by reading the issue description and comments.
8+
* Understand the codebase by reading the relevant instruction files.
9+
* If its a bug, then identify the root cause of the bug, and explain this to the user.
10+
11+
Based on your above understanding generate a plan to fix the bug or add the new feature.
12+
Ensure the plan consists of a Markdown document that has the following sections:
13+
14+
* Overview: A brief description of the bug/feature.
15+
* 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)
16+
* Requirements: A list of requirements to resolve the bug or add the new feature.
17+
* Implementation Steps: A detailed list of steps to implement the bug fix or new feature.
18+
19+
Remember, do not make any code edits, just generate a plan. Use thinking and reasoning skills to outline the steps needed to achieve the desired outcome.

.github/workflows/pr-darwin-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
id: cache-builtin-extensions
9494
uses: actions/cache/restore@v4
9595
with:
96+
enableCrossOsArchive: true
9697
path: .build/builtInExtensions
9798
key: "builtin-extensions-${{ hashFiles('.build/builtindepshash') }}"
9899

.github/workflows/pr-linux-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ jobs:
121121
id: cache-builtin-extensions
122122
uses: actions/cache/restore@v4
123123
with:
124+
enableCrossOsArchive: true
124125
path: .build/builtInExtensions
125126
key: "builtin-extensions-${{ hashFiles('.build/builtindepshash') }}"
126127

.github/workflows/pr-node-modules.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
id: cache-builtin-extensions
7373
uses: actions/cache@v4
7474
with:
75+
enableCrossOsArchive: true
7576
path: .build/builtInExtensions
7677
key: "builtin-extensions-${{ hashFiles('.build/builtindepshash') }}"
7778

.github/workflows/pr-win32-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
id: cache-builtin-extensions
103103
uses: actions/cache/restore@v4
104104
with:
105+
enableCrossOsArchive: true
105106
path: .build/builtInExtensions
106107
key: "builtin-extensions-${{ hashFiles('.build/builtindepshash') }}"
107108

0 commit comments

Comments
 (0)