Skip to content

Commit e39260a

Browse files
author
aiday-mar
committed
Merge branch 'main' into aiday/issue157165
2 parents d0e9677 + 41a6299 commit e39260a

File tree

103 files changed

+784
-534
lines changed

Some content is hidden

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

103 files changed

+784
-534
lines changed

.vscode/launch.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,9 @@
468468
"type": "node",
469469
"request": "launch",
470470
"name": "Launch Smoke Test",
471-
"program": "${workspaceFolder}/test/smoke/out/main.js",
471+
"program": "${workspaceFolder}/test/smoke/test/index.js",
472472
"cwd": "${workspaceFolder}/test/smoke",
473473
"timeout": 240000,
474-
"port": 9999,
475474
"args": [
476475
"-l",
477476
"${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron"

build/lib/compilation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function generateApiProposalNames() {
219219
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
220220
'',
221221
'export const allApiProposals = Object.freeze({',
222-
`${names.map(name => `\t${name}: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.${name}.d.ts'`).join(`,${os.EOL}`)}`,
222+
`${names.map(name => `\t${name}: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.${name}.d.ts'`).join(`,${eol}`)}`,
223223
'});',
224224
'export type ApiProposalName = keyof typeof allApiProposals;',
225225
'',

build/lib/compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function generateApiProposalNames() {
260260
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
261261
'',
262262
'export const allApiProposals = Object.freeze({',
263-
`${names.map(name => `\t${name}: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.${name}.d.ts'`).join(`,${os.EOL}`)}`,
263+
`${names.map(name => `\t${name}: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.${name}.d.ts'`).join(`,${eol}`)}`,
264264
'});',
265265
'export type ApiProposalName = keyof typeof allApiProposals;',
266266
'',

build/lib/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ export function loadSourcemaps(): NodeJS.ReadWriteStream {
207207
const contents = (<Buffer>f.contents).toString('utf8');
208208

209209
const reg = /\/\/# sourceMappingURL=(.*)$/g;
210-
let lastMatch: RegExpMatchArray | null = null;
211-
let match: RegExpMatchArray | null = null;
210+
let lastMatch: RegExpExecArray | null = null;
211+
let match: RegExpExecArray | null = null;
212212

213213
while (match = reg.exec(contents)) {
214214
lastMatch = match;

extensions/git/src/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class Git {
427427
let previousProgress = 0;
428428

429429
lineStream.on('data', (line: string) => {
430-
let match: RegExpMatchArray | null = null;
430+
let match: RegExpExecArray | null = null;
431431

432432
if (match = /Counting objects:\s*(\d+)%/i.exec(line)) {
433433
totalProgress = Math.floor(parseInt(match[1]) * 0.1);
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
html, body {
7+
width: 100%;
8+
height: 100%;
9+
text-align: center;
10+
}
11+
12+
body {
13+
padding: 5px 10px;
14+
box-sizing: border-box;
15+
-webkit-user-select: none;
16+
user-select: none;
17+
}
18+
19+
.audio-container {
20+
height: 100%;
21+
display: flex;
22+
justify-content: center;
23+
align-items: center;
24+
}
25+
26+
.container.loading,
27+
.container.error {
28+
display: flex;
29+
justify-content: center;
30+
align-items: center;
31+
}
32+
33+
.loading-indicator {
34+
width: 30px;
35+
height: 30px;
36+
background-image: url('./loading.svg');
37+
background-size: cover;
38+
}
39+
40+
.loading-indicator,
41+
.loading-error {
42+
display: none;
43+
}
44+
45+
.loading .loading-indicator,
46+
.error .loading-error {
47+
display: block;
48+
}
49+
50+
.loading-error {
51+
margin: 1em;
52+
}
53+
54+
.vscode-dark .loading-indicator {
55+
background-image: url('./loading-dark.svg');
56+
}
57+
58+
.vscode-high-contrast .loading-indicator {
59+
background-image: url('./loading-hc.svg');
60+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
// @ts-check
6+
"use strict";
7+
8+
(function () {
9+
const vscode = acquireVsCodeApi();
10+
11+
function getSettings() {
12+
const element = document.getElementById('settings');
13+
if (element) {
14+
const data = element.getAttribute('data-settings');
15+
if (data) {
16+
return JSON.parse(data);
17+
}
18+
}
19+
20+
throw new Error(`Could not load settings`);
21+
}
22+
23+
const settings = getSettings();
24+
25+
// State
26+
let hasLoadedMedia = false;
27+
28+
// Elements
29+
const container = document.createElement('div');
30+
container.className = 'audio-container';
31+
document.body.appendChild(container);
32+
33+
const audio = new Audio(settings.src);
34+
audio.controls = true;
35+
36+
audio.addEventListener('error', e => {
37+
if (hasLoadedMedia) {
38+
return;
39+
}
40+
41+
hasLoadedMedia = true;
42+
document.body.classList.add('error');
43+
document.body.classList.remove('loading');
44+
});
45+
46+
audio.addEventListener('canplaythrough', () => {
47+
if (hasLoadedMedia) {
48+
return;
49+
}
50+
hasLoadedMedia = true;
51+
52+
document.body.classList.remove('loading');
53+
document.body.classList.add('ready');
54+
container.append(audio);
55+
});
56+
57+
document.querySelector('.open-file-link').addEventListener('click', () => {
58+
vscode.postMessage({
59+
type: 'reopen-as-text',
60+
});
61+
});
62+
}());

extensions/image-preview/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"activationEvents": [
2323
"onCustomEditor:imagePreview.previewEditor",
2424
"onCommand:imagePreview.zoomIn",
25-
"onCommand:imagePreview.zoomOut"
25+
"onCommand:imagePreview.zoomOut",
26+
"onCustomEditor:vscode.mediaPreview.audioView"
2627
],
2728
"capabilities": {
2829
"virtualWorkspaces": true,
@@ -41,6 +42,16 @@
4142
"filenamePattern": "*.{jpg,jpe,jpeg,png,bmp,gif,ico,webp,avif}"
4243
}
4344
]
45+
},
46+
{
47+
"viewType": "vscode.mediaPreview.audioView",
48+
"displayName": "%customEditors.displayName%",
49+
"priority": "builtin",
50+
"selector": [
51+
{
52+
"filenamePattern": "*.{mp3,wav,opus,aac}"
53+
}
54+
]
4455
}
4556
],
4657
"commands": [

0 commit comments

Comments
 (0)