Skip to content

Commit f3cd08f

Browse files
authored
Merge branch 'main' into copilot/fix-icons-misalignment
2 parents 4b7d7be + 34c4d49 commit f3cd08f

File tree

118 files changed

+803
-434
lines changed

Some content is hidden

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

118 files changed

+803
-434
lines changed

.vscodeignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ azure-pipeline.*
2929
yarn.lock
3030
**/*.map
3131
**/*.svg
32-
!**/output.svg
33-
!**/pr_webview.svg
32+
!**/git-pull-request_webview.svg
3433
**/*.ts
3534
*.vsix
3635
**/*.bak

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.120.1
4+
5+
### Fixes
6+
7+
- Extension cannot find git repo when VS Code didn't open the git root directory. https://github.com/microsoft/vscode-pull-request-github/issues/7964
8+
39
## 0.120.0
410

511
### Changes

azure-pipeline.nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ trigger: none
33
pr: none
44

55
schedules:
6-
- cron: '0 4 * * Mon-Thu'
6+
- cron: '0 4 * * Mon-Fri'
77
displayName: Nightly Release Schedule
88
always: true
99
branches:

build/filters.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module.exports.copyrightFilter = [
6464
'!tsconfig.json',
6565
'!tsconfig.test.json',
6666
'!tsconfig.webviews.json',
67+
'!tsconfig.scripts.json',
6768
'!tsfmt.json',
6869
'!**/queries*.gql',
6970
'!**/*.yml',

build/update-codicons.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as fs from 'fs';
7+
import * as path from 'path';
8+
import * as https from 'https';
9+
10+
const CODICONS_DIR = path.join(__dirname, '..', 'resources', 'icons', 'codicons');
11+
const BASE_URL = 'https://raw.githubusercontent.com/microsoft/vscode-codicons/refs/heads/mrleemurray/new-icons/src/icons';
12+
13+
interface UpdateResult {
14+
filename: string;
15+
status: 'updated' | 'unchanged' | 'error';
16+
error?: string;
17+
}
18+
19+
function readLocalIconFilenames(): string[] {
20+
return fs.readdirSync(CODICONS_DIR).filter(f => f.endsWith('.svg'));
21+
}
22+
23+
function fetchRemoteIcon(filename: string): Promise<string> {
24+
const url = `${BASE_URL}/${encodeURIComponent(filename)}`;
25+
return new Promise((resolve, reject) => {
26+
https.get(url, res => {
27+
const { statusCode } = res;
28+
if (statusCode !== 200) {
29+
res.resume(); // drain
30+
return reject(new Error(`Failed to fetch ${filename}: HTTP ${statusCode}`));
31+
}
32+
let data = '';
33+
res.setEncoding('utf8');
34+
res.on('data', chunk => { data += chunk; });
35+
res.on('end', () => resolve(data));
36+
}).on('error', reject);
37+
});
38+
}
39+
40+
async function updateIcon(filename: string): Promise<UpdateResult> {
41+
const localPath = path.join(CODICONS_DIR, filename);
42+
const oldContent = fs.readFileSync(localPath, 'utf8');
43+
try {
44+
const newContent = await fetchRemoteIcon(filename);
45+
if (normalize(oldContent) === normalize(newContent)) {
46+
return { filename, status: 'unchanged' };
47+
}
48+
fs.writeFileSync(localPath, newContent, 'utf8');
49+
return { filename, status: 'updated' };
50+
} catch (err: any) {
51+
return { filename, status: 'error', error: err?.message ?? String(err) };
52+
}
53+
}
54+
55+
function normalize(svg: string): string {
56+
return svg.replace(/\r\n?/g, '\n').trim();
57+
}
58+
59+
async function main(): Promise<void> {
60+
const icons = readLocalIconFilenames();
61+
if (!icons.length) {
62+
console.log('No codicon SVGs found to update.');
63+
return;
64+
}
65+
console.log(`Updating ${icons.length} codicon(s) from upstream...`);
66+
67+
const concurrency = 8;
68+
const queue = icons.slice();
69+
const results: UpdateResult[] = [];
70+
71+
async function worker(): Promise<void> {
72+
while (queue.length) {
73+
const file = queue.shift();
74+
if (!file) {
75+
break;
76+
}
77+
const result = await updateIcon(file);
78+
results.push(result);
79+
if (result.status === 'updated') {
80+
console.log(` ✔ ${file} updated`);
81+
} else if (result.status === 'unchanged') {
82+
console.log(` • ${file} unchanged`);
83+
} else {
84+
// allow-any-unicode-next-line
85+
console.warn(` ✖ ${file} ${result.error}`);
86+
}
87+
}
88+
}
89+
90+
const workers = Array.from({ length: Math.min(concurrency, icons.length) }, () => worker());
91+
await Promise.all(workers);
92+
93+
const updated = results.filter(r => r.status === 'updated').length;
94+
const unchanged = results.filter(r => r.status === 'unchanged').length;
95+
const errored = results.filter(r => r.status === 'error').length;
96+
console.log(`Done. Updated: ${updated}, Unchanged: ${unchanged}, Errors: ${errored}.`);
97+
if (errored) {
98+
process.exitCode = 1;
99+
}
100+
}
101+
102+
main().catch(err => {
103+
console.error(err?.stack || err?.message || String(err));
104+
process.exit(1);
105+
});
106+
107+
export { }; // ensure this file is treated as a module

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default defineConfig([
1515
// Global ignore patterns
1616
{
1717
ignores: [
18+
'build',
1819
'dist/**/*',
1920
'out/**/*',
2021
'src/@types/**/*.d.ts',

package.json

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"activeComment",
1515
"chatParticipantAdditions",
1616
"chatParticipantPrivate",
17-
"chatSessionsProvider@2",
17+
"chatSessionsProvider@3",
1818
"codiconDecoration",
1919
"codeActionRanges",
2020
"commentingRangeHint",
@@ -75,7 +75,7 @@
7575
"name": "copilot",
7676
"displayName": "GitHub Copilot coding agent",
7777
"description": "Delegate tasks to the GitHub Copilot coding agent. The agent works asynchronously to implement changes, iterates via chat, and can create or update pull requests as needed.",
78-
"when": "config.chat.agentSessionsViewLocation && config.chat.agentSessionsViewLocation != 'disabled'",
78+
"when": "config.chat.agentSessionsViewLocation && config.chat.agentSessionsViewLocation != 'disabled' && config.github.copilot.chat.advanced.copilotCodingAgentV0.enabled",
7979
"capabilities": {
8080
"supportsFileAttachments": true
8181
}
@@ -88,7 +88,7 @@
8888
"displayName": "GitHub Copilot coding agent",
8989
"description": "Copilot coding agent is a remote, autonomous software development agent. Developers delegate tasks to the agent, which iterates on pull requests based on feedback and reviews.",
9090
"followUpRegex": "open-pull-request-webview.*((%7B.*?%7D)|(\\{.*?\\}))",
91-
"when": "config.githubPullRequests.codingAgent.enabled && config.githubPullRequests.codingAgent.uiIntegration && copilotCodingAgentAssignable"
91+
"when": "config.githubPullRequests.codingAgent.enabled && config.githubPullRequests.codingAgent.uiIntegration && copilotCodingAgentAssignable && config.github.copilot.chat.advanced.copilotCodingAgentV0.enabled"
9292
}
9393
],
9494
"chatParticipants": [
@@ -616,7 +616,7 @@
616616
},
617617
"githubPullRequests.codingAgent.codeLens": {
618618
"type": "boolean",
619-
"default": false,
619+
"default": true,
620620
"description": "%githubPullRequests.codingAgent.codeLens.description%"
621621
},
622622
"githubIssues.createInsertFormat": {
@@ -3529,33 +3529,34 @@
35293529
"chat/chatSessions": [
35303530
{
35313531
"command": "pr.openChanges",
3532-
"when": "chatSessionType == copilot-swe-agent",
3532+
"when": "resourceScheme == copilot-swe-agent || resourceScheme == copilot-cloud-agent",
35333533
"group": "inline"
35343534
},
35353535
{
35363536
"command": "pr.checkoutChatSessionPullRequest",
3537-
"when": "chatSessionType == copilot-swe-agent",
3537+
"when": "resourceScheme == copilot-swe-agent || resourceScheme == copilot-cloud-agent",
35383538
"group": "context"
35393539
},
35403540
{
35413541
"command": "pr.closeChatSessionPullRequest",
3542-
"when": "chatSessionType == copilot-swe-agent",
3542+
"when": "resourceScheme == copilot-swe-agent",
35433543
"group": "context"
35443544
},
35453545
{
35463546
"command": "pr.cancelCodingAgent",
3547-
"when": "chatSessionType == copilot-swe-agent",
3547+
"when": "resourceScheme == copilot-swe-agent",
35483548
"group": "context"
35493549
}
35503550
],
35513551
"chat/multiDiff/context": [
35523552
{
3553-
"command": "pr.checkoutFromDescription",
3554-
"when": "chatSessionType == copilot-swe-agent"
3553+
"command": "pr.checkoutFromDescription"
35553554
},
35563555
{
3557-
"command": "pr.applyChangesFromDescription",
3558-
"when": "chatSessionType == copilot-swe-agent"
3556+
"command": "pr.applyChangesFromDescription"
3557+
},
3558+
{
3559+
"command": "pr.openChanges"
35593560
}
35603561
]
35613562
},
@@ -4257,7 +4258,8 @@
42574258
"watch": "webpack --watch --mode development --env esbuild",
42584259
"watch:web": "webpack --watch --mode development --config-name extension:webworker --config-name webviews",
42594260
"hygiene": "node ./build/hygiene.js",
4260-
"prepare": "husky install"
4261+
"prepare": "husky install",
4262+
"update:codicons": "npx ts-node --project tsconfig.scripts.json build/update-codicons.ts"
42614263
},
42624264
"devDependencies": {
42634265
"@eslint/js": "^9.36.0",
@@ -4321,6 +4323,7 @@
43214323
"terser-webpack-plugin": "5.1.1",
43224324
"timers-browserify": "^2.0.12",
43234325
"ts-loader": "9.5.2",
4326+
"ts-node": "^10.9.2",
43244327
"tty": "1.0.1",
43254328
"typescript": "^5.9.2",
43264329
"typescript-eslint": "^8.44.0",
@@ -4364,4 +4367,4 @@
43644367
"string_decoder": "^1.3.0"
43654368
},
43664369
"license": "MIT"
4367-
}
4370+
}

resources/icons/alert.svg

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

resources/icons/assignee.svg

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

resources/icons/check.svg

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

0 commit comments

Comments
 (0)