Skip to content

Commit 8e45ab2

Browse files
committed
Merge remote-tracking branch 'upstream/main' into merge/1.104.0
2 parents 7d7d253 + 747483a commit 8e45ab2

File tree

318 files changed

+16586
-3567
lines changed

Some content is hidden

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

318 files changed

+16586
-3567
lines changed

.esbuild.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const baseNodeBuildOptions = {
4242
// --- Start Positron ---
4343
'@vscode/prompt-tsx',
4444
// --- End Positron ---
45+
'node-pty', // Required by @github/copilot
46+
'@github/copilot',
4547
...(isDev ? [] : ['dotenv', 'source-map-support'])
4648
],
4749
platform: 'node',

.eslint-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ test/scenarios/**
1111
.simulation/**
1212
.eslintplugin/**
1313
chat-lib/**
14+
test/aml/out/**
15+
.vscode-test/**
1416

1517
# ignore vs
1618
src/util/vs/**

.github/copilot-instructions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ x => x + x // ✓ Correct
238238
### Code Structure
239239
- Always surround loop and conditional bodies with curly braces
240240
- Open curly braces always go on the same line as whatever necessitates them
241+
- An open curly brace MUST be followed by a newline, with the body indented on the next line
241242
- Parenthesized constructs should have no surrounding whitespace
242243
- Single space follows commas, colons, and semicolons
243244

@@ -254,6 +255,10 @@ function f(x: number, y: string): void { }
254255
### Type Management
255256
- Do not export `types` or `functions` unless you need to share it across multiple components
256257
- Do not introduce new `types` or `values` to the global namespace
258+
- Use proper types. Do not use `any` unless absolutely necessary.
259+
- Use `readonly` whenever possible.
260+
- Avoid casts in TypeScript unless absolutely necessary. If you get type errors after your changes, look up the types of the variables involved and set up a proper system of types and interfaces instead of adding type casts.
261+
- Do not use `any` or `unknown` as the type for variables, parameters, or return values unless absolutely necessary. If they need type annotations, they should have proper types or interfaces defined.
257262

258263
## Key APIs and Integrations
259264

.github/instructions/vitest-unit-tests.instructions.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,34 @@ applyTo: '**/*.spec.ts'
33
description: Vitest unit testing guidelines
44
---
55

6-
Guidelines for writing unit tests using Vitest. These tests are `*.spec.ts`
6+
Please follow these guidelines when writing unit tests using Vitest. These tests are `*.spec.ts`
77

88
## Best Practices
99

10-
- Use proper mocks when possible rather than ad-hoc objects injected as dependencies. For example, call `createExtensionUnitTestingServices` to get some mock services, and `IInstantiationService` to create instances with those mocks.
11-
- If there is no preexisting implementation of a service that is appropriate to reuse in the test, then you can create a simple mock or stub implementation.
12-
- Avoid casting to `any` whenever possible.
13-
- When asked to write new tests, add tests for things that are interesting and nontrivial. Don't add a test that just verifies that a setter/getter work.
14-
- Prefer the runTests tool to run tests over a terminal command.
10+
- Prefer explicit Test/Mock classes over mutating real instances or creating adhoc one-off mocks.
11+
- Never use `as any` to override private methods or assign properties on real objects.
12+
- Mock versions of services are typically named `Mock*` or `Test*`, you can search to find whether one already exists.
13+
- Some examples: `MockFileSystemService`, `MockChatResponseStream`, `TestTasksService`.
14+
15+
- If there is no preexisting implementation of a service that is appropriate to reuse in the test, then you can create a simple mock or stub implementation in a file under a `test/` folder near the interface definition.
16+
- A mock class should be configurable so that it can be shared and set up for different test scenarios.
17+
18+
- The helper `createExtensionUnitTestingServices` returns a `TestingServiceCollection` preconfigured with some common mock services, use `IInstantiationService` to create instances with those mocks. Here's an example of using it properly
19+
20+
```ts
21+
const serviceCollection = store.add(createExtensionUnitTestingServices());
22+
instantiationService = serviceCollection.createTestingAccessor().get(IInstantiationService);
23+
const mockFs = accessor.get(IFileSystemService) as MockFileSystemService;
24+
const testService = instantiationService.createInstance(SomeServiceToTest);
25+
```
26+
27+
- When asked to write new tests, add tests to cover the behavior of the code under test, especially things that are interesting, unexpected, or edge cases.
28+
- Avoid adding tests that simply repeat existing tests or cover trivial code paths.
29+
30+
- If available, prefer the runTests tool to run tests over a terminal command.
31+
32+
- Keep tests deterministic and fast.
33+
- Avoid starting real servers or performing network I/O.
34+
35+
- Avoid excessive repetition in tests, use `beforeEach` to set up common state.
36+
- Use helper functions to encapsulate common test logic.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Copilot Setup Steps
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
copilot-setup-steps:
16+
name: Setup Development Environment
17+
runs-on: vscode-large-runners
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
lfs: true
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '22.14.x'
28+
29+
- name: Setup Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.12'
33+
architecture: 'x64'
34+
35+
- name: Setup .NET
36+
uses: actions/setup-dotnet@v4
37+
with:
38+
dotnet-version: '10.0'
39+
40+
- name: Install setuptools
41+
run: pip install setuptools
42+
43+
- name: Restore build cache
44+
uses: actions/cache/restore@v4
45+
id: build-cache
46+
with:
47+
key: build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}
48+
path: .build/build_cache
49+
50+
- name: Extract build cache
51+
if: steps.build-cache.outputs.cache-hit == 'true'
52+
run: tar -xzf .build/build_cache/cache.tgz
53+
54+
- name: Install dependencies
55+
if: steps.build-cache.outputs.cache-hit != 'true'
56+
run: npm ci
57+
58+
- name: Create build cache archive
59+
if: steps.build-cache.outputs.cache-hit != 'true'
60+
run: |
61+
set -e
62+
mkdir -p .build
63+
node build/listBuildCacheFiles.js .build/build_cache_list.txt
64+
mkdir -p .build/build_cache
65+
tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt
66+
67+
- name: Verify installation
68+
run: |
69+
node --version
70+
npm --version
71+
python --version
72+
dotnet --version

.vscode/launch.json

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,49 @@
297297
"presentation": {
298298
"group": "2_launch"
299299
}
300-
}
300+
},
301+
{
302+
"name": "Attach to Extension Host - Code OSS",
303+
"type": "node",
304+
"request": "attach",
305+
"restart": true,
306+
"timeout": 0,
307+
"port": 5870,
308+
"sourceMaps": true,
309+
"outFiles": [
310+
"${workspaceFolder}/../vscode/out/**/*.js",
311+
"${workspaceFolder}/../vscode/extensions/*/out/**/*.js",
312+
"${workspaceFolder}/dist/**/*.js",
313+
"!**/node_modules/**"
314+
],
315+
"presentation": {
316+
"group": "2_launch"
317+
}
318+
},
319+
{
320+
"name": "Run Completions-Core Extension Tests",
321+
"type": "extensionHost",
322+
"request": "launch",
323+
"args": [
324+
"--extensionDevelopmentPath=${workspaceFolder}",
325+
"--extensionTestsPath=${workspaceFolder}/src/extension/completions-core/extension/test/run",
326+
"--disable-extensions"
327+
],
328+
"env": {
329+
"TSX_TSCONFIG_PATH": "${workspaceFolder}/tsconfig.json",
330+
"VITEST": "true"
331+
},
332+
"internalConsoleOptions": "openOnSessionStart",
333+
"outFiles": [
334+
"${workspaceFolder}/**/*.ts",
335+
"${workspaceFolder}/dist/**/*.js",
336+
"!**/node_modules/**"
337+
],
338+
"autoAttachChildProcesses": true,
339+
"presentation": {
340+
"group": "1_launch"
341+
}
342+
},
301343
],
302344
"compounds": [
303345
{
@@ -312,4 +354,4 @@
312354
}
313355
}
314356
]
315-
}
357+
}

.vscodeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ assets/walkthroughs/**
1818
!dist/cli.js
1919
!node_modules/@vscode/copilot-typescript-server-plugin/package.json
2020
!node_modules/@vscode/copilot-typescript-server-plugin/dist/*.js
21+
!node_modules/@github/copilot/**/package.json
22+
!node_modules/@github/copilot/**/*.js
23+
!node_modules/@github/copilot/**/*.wasm
2124
!CHANGELOG.md
2225
!README.md
2326
!package.json

0 commit comments

Comments
 (0)