Skip to content

Commit 7f0c1f0

Browse files
committed
Merge branch 'main' into code-server-v2
2 parents ef8f1c6 + 40fbc4e commit 7f0c1f0

File tree

508 files changed

+8612
-5433
lines changed

Some content is hidden

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

508 files changed

+8612
-5433
lines changed

.vscode/settings.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,14 @@
7979
},
8080
"typescript.tsc.autoDetect": "off",
8181
"testing.autoRun.mode": "rerun",
82-
"conventionalCommits.scopes": ["tree"]
82+
"conventionalCommits.scopes": [
83+
"tree",
84+
"scm",
85+
"grid",
86+
"splitview",
87+
"table",
88+
"list",
89+
"git",
90+
"sash"
91+
]
8392
}

build/azure-pipelines/darwin/product-build-darwin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ steps:
233233
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
234234
APP_NAME="`ls $APP_ROOT | head -n 1`"
235235
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
236-
yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests
236+
yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests-remote
237237
timeoutInMinutes: 5
238238
displayName: Run smoke tests (Remote)
239239
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

build/azure-pipelines/linux/product-build-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ steps:
220220
set -e
221221
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
222222
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
223-
yarn smoketest-no-compile --build "$APP_PATH" --remote --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests
223+
yarn smoketest-no-compile --build "$APP_PATH" --remote --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests-remote
224224
timeoutInMinutes: 5
225225
displayName: Run smoke tests (Remote)
226226
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

build/azure-pipelines/publish-types/update-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ try {
1313
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
1414
.toString()
1515
.trim();
16-
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
16+
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vscode-dts/vscode.d.ts`;
1717
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
1818
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
1919
updateDTSFile(outPath, tag);

build/azure-pipelines/publish-types/update-types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ try {
1616
.toString()
1717
.trim();
1818

19-
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
19+
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vscode-dts/vscode.d.ts`;
2020
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
2121
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
2222

build/azure-pipelines/win32/product-build-win32.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ steps:
216216
$ErrorActionPreference = "Stop"
217217
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
218218
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"
219-
exec { yarn smoketest-no-compile --build "$AppRoot" --remote }
219+
exec { yarn smoketest-no-compile --build "$AppRoot" --remote --screenshots $(Build.SourcesDirectory)\.build\logs\smoke-tests-remote }
220220
displayName: Run smoke tests (Remote)
221221
timeoutInMinutes: 5
222222
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))

build/gulpfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./gulpf
1616
const { compileExtensionsTask, watchExtensionsTask, compileExtensionMediaTask } = require('./gulpfile.extensions');
1717

1818
// Fast compile for development time
19-
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compilation.compileTask('src', 'out', false)));
19+
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compilation.compileApiProposalNames(), compilation.compileTask('src', 'out', false)));
2020
gulp.task(compileClientTask);
2121

22-
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compilation.watchTask('out', false)));
22+
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(compilation.watchTask('out', false), compilation.watchApiProposalNames())));
2323
gulp.task(watchClientTask);
2424

2525
// All

build/gulpfile.vscode.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const vscodeResources = [
6464
'out-build/vs/base/browser/ui/codicons/codicon/**',
6565
'out-build/vs/base/parts/sandbox/electron-browser/preload.js',
6666
'out-build/vs/platform/environment/node/userDataPath.js',
67+
'out-build/vs/platform/extensions/node/extensionHostStarterWorkerMain.js',
6768
'out-build/vs/workbench/browser/media/*-theme.css',
6869
'out-build/vs/workbench/contrib/debug/**/*.json',
6970
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
@@ -214,7 +215,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
214215
const license = gulp.src(['LICENSES.chromium.html', product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
215216

216217
// TODO the API should be copied to `out` during compile, not here
217-
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
218+
const api = gulp.src('src/vscode-dts/vscode.d.ts').pipe(rename('out/vscode-dts/vscode.d.ts'));
218219

219220
const telemetry = gulp.src('.build/telemetry/**', { base: '.build/telemetry', dot: true });
220221

build/lib/bundle.js

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const vm = require("vm");
1414
function bundle(entryPoints, config, callback) {
1515
const entryPointsMap = {};
1616
entryPoints.forEach((module) => {
17+
if (entryPointsMap[module.name]) {
18+
throw new Error(`Cannot have two entry points with the same name '${module.name}'`);
19+
}
1720
entryPointsMap[module.name] = module;
1821
});
1922
const allMentionedModulesMap = {};

build/lib/bundle.ts

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ export interface ILoaderConfig {
100100
export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callback: (err: any, result: IBundleResult | null) => void): void {
101101
const entryPointsMap: IEntryPointMap = {};
102102
entryPoints.forEach((module: IEntryPoint) => {
103+
if (entryPointsMap[module.name]) {
104+
throw new Error(`Cannot have two entry points with the same name '${module.name}'`);
105+
}
103106
entryPointsMap[module.name] = module;
104107
});
105108

build/lib/compilation.js

+63-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
66
Object.defineProperty(exports, "__esModule", { value: true });
7-
exports.watchTask = exports.compileTask = void 0;
7+
exports.watchApiProposalNames = exports.compileApiProposalNames = exports.watchTask = exports.compileTask = void 0;
88
const es = require("event-stream");
99
const fs = require("fs");
1010
const gulp = require("gulp");
@@ -175,3 +175,65 @@ class MonacoGenerator {
175175
}
176176
}
177177
}
178+
function apiProposalNamesGenerator() {
179+
const stream = es.through();
180+
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts/;
181+
const dtsFolder = path.join(REPO_SRC_FOLDER, 'vscode-dts');
182+
const generateFile = () => {
183+
try {
184+
const t1 = Date.now();
185+
const proposalNames = [];
186+
for (let file of fs.readdirSync(dtsFolder)) {
187+
const match = pattern.exec(file);
188+
if (match) {
189+
proposalNames.push([match[1], `https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/${file}`]);
190+
}
191+
}
192+
const source = [
193+
'/*---------------------------------------------------------------------------------------------',
194+
' * Copyright (c) Microsoft Corporation. All rights reserved.',
195+
' * Licensed under the MIT License. See License.txt in the project root for license information.',
196+
' *--------------------------------------------------------------------------------------------*/',
197+
'',
198+
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
199+
'',
200+
'export const allApiProposals = Object.freeze({',
201+
`${proposalNames.map(t => `\t${t[0]}: '${t[1]}'`).join(',\n')}`,
202+
'});',
203+
'export type ApiProposalName = keyof typeof allApiProposals;',
204+
'',
205+
].join('\n');
206+
const outFile = path.join(dtsFolder, '../vs/workbench/services/extensions/common/extensionsApiProposals.ts');
207+
if (fs.readFileSync(outFile).toString() !== source) {
208+
fs.writeFileSync(outFile, source);
209+
console.log(`Generated 'extensionsApiProposals.ts' in ${Date.now() - t1}ms`);
210+
}
211+
}
212+
catch (err) {
213+
stream.emit('error', err);
214+
}
215+
};
216+
let handle;
217+
stream.on('data', () => {
218+
clearTimeout(handle);
219+
handle = setTimeout(generateFile, 250);
220+
});
221+
return stream;
222+
}
223+
function compileApiProposalNames() {
224+
return function () {
225+
const srcPipe = gulp.src('src/vscode-dts/**', { base: 'src' });
226+
const proposals = apiProposalNamesGenerator();
227+
return srcPipe.pipe(proposals);
228+
};
229+
}
230+
exports.compileApiProposalNames = compileApiProposalNames;
231+
function watchApiProposalNames() {
232+
return function () {
233+
const watchSrc = watch('src/vscode-dts/**', { base: 'src', readDelay: 200 });
234+
const proposals = apiProposalNamesGenerator();
235+
proposals.write(undefined); // send something to trigger initial generate
236+
return watchSrc.pipe(proposals);
237+
};
238+
}
239+
exports.watchApiProposalNames = watchApiProposalNames;

build/lib/compilation.ts

+72
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,75 @@ class MonacoGenerator {
211211
}
212212
}
213213
}
214+
215+
function apiProposalNamesGenerator() {
216+
const stream = es.through();
217+
218+
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts/;
219+
const dtsFolder = path.join(REPO_SRC_FOLDER, 'vscode-dts');
220+
221+
const generateFile = () => {
222+
223+
try {
224+
225+
const t1 = Date.now();
226+
const proposalNames: [name: string, url: string][] = [];
227+
for (let file of fs.readdirSync(dtsFolder)) {
228+
const match = pattern.exec(file);
229+
if (match) {
230+
proposalNames.push([match[1], `https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/${file}`]);
231+
}
232+
}
233+
234+
const source = [
235+
'/*---------------------------------------------------------------------------------------------',
236+
' * Copyright (c) Microsoft Corporation. All rights reserved.',
237+
' * Licensed under the MIT License. See License.txt in the project root for license information.',
238+
' *--------------------------------------------------------------------------------------------*/',
239+
'',
240+
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
241+
'',
242+
'export const allApiProposals = Object.freeze({',
243+
`${proposalNames.map(t => `\t${t[0]}: '${t[1]}'`).join(',\n')}`,
244+
'});',
245+
'export type ApiProposalName = keyof typeof allApiProposals;',
246+
'',
247+
].join('\n');
248+
249+
const outFile = path.join(dtsFolder, '../vs/workbench/services/extensions/common/extensionsApiProposals.ts');
250+
251+
if (fs.readFileSync(outFile).toString() !== source) {
252+
fs.writeFileSync(outFile, source);
253+
console.log(`Generated 'extensionsApiProposals.ts' in ${Date.now() - t1}ms`);
254+
}
255+
256+
} catch (err) {
257+
stream.emit('error', err);
258+
}
259+
};
260+
261+
let handle: NodeJS.Timeout;
262+
stream.on('data', () => {
263+
clearTimeout(handle);
264+
handle = setTimeout(generateFile, 250);
265+
});
266+
267+
return stream;
268+
}
269+
270+
export function compileApiProposalNames(): () => NodeJS.ReadWriteStream {
271+
return function () {
272+
const srcPipe = gulp.src('src/vscode-dts/**', { base: 'src' });
273+
const proposals = apiProposalNamesGenerator();
274+
return srcPipe.pipe(proposals);
275+
};
276+
}
277+
278+
export function watchApiProposalNames(): () => NodeJS.ReadWriteStream {
279+
return function () {
280+
const watchSrc = watch('src/vscode-dts/**', { base: 'src', readDelay: 200 });
281+
const proposals = apiProposalNamesGenerator();
282+
proposals.write(undefined); // send something to trigger initial generate
283+
return watchSrc.pipe(proposals);
284+
};
285+
}

build/lib/eslint/vscode-dts-region-comments.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ module.exports = new class ApiEventNaming {
77
constructor() {
88
this.meta = {
99
messages: {
10-
comment: 'region comments should start with the GH issue link, e.g #region https://github.com/microsoft/vscode/issues/<number>',
10+
comment: 'region comments should start with a camel case identifier, `:`, then either a GH issue link or owner, e.g #region myProposalName: https://github.com/microsoft/vscode/issues/<number>',
1111
}
1212
};
1313
}
1414
create(context) {
1515
const sourceCode = context.getSourceCode();
1616
return {
1717
['Program']: (_node) => {
18-
for (let comment of sourceCode.getAllComments()) {
18+
for (const comment of sourceCode.getAllComments()) {
1919
if (comment.type !== 'Line') {
2020
continue;
2121
}
22-
if (!comment.value.match(/^\s*#region /)) {
22+
if (!/^\s*#region /.test(comment.value)) {
2323
continue;
2424
}
25-
if (!comment.value.match(/https:\/\/github.com\/microsoft\/vscode\/issues\/\d+/i)) {
25+
if (!/^\s*#region ([a-z]+): (@[a-z]+|https:\/\/github.com\/microsoft\/vscode\/issues\/\d+)/i.test(comment.value)) {
2626
context.report({
2727
node: comment,
2828
messageId: 'comment',

build/lib/eslint/vscode-dts-region-comments.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,24 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {
99

1010
readonly meta: eslint.Rule.RuleMetaData = {
1111
messages: {
12-
comment: 'region comments should start with the GH issue link, e.g #region https://github.com/microsoft/vscode/issues/<number>',
12+
comment: 'region comments should start with a camel case identifier, `:`, then either a GH issue link or owner, e.g #region myProposalName: https://github.com/microsoft/vscode/issues/<number>',
1313
}
1414
};
1515

1616
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
1717

1818
const sourceCode = context.getSourceCode();
1919

20-
2120
return {
2221
['Program']: (_node: any) => {
23-
24-
for (let comment of sourceCode.getAllComments()) {
22+
for (const comment of sourceCode.getAllComments()) {
2523
if (comment.type !== 'Line') {
2624
continue;
2725
}
28-
if (!comment.value.match(/^\s*#region /)) {
26+
if (!/^\s*#region /.test(comment.value)) {
2927
continue;
3028
}
31-
if (!comment.value.match(/https:\/\/github.com\/microsoft\/vscode\/issues\/\d+/i)) {
29+
if (!/^\s*#region ([a-z]+): (@[a-z]+|https:\/\/github.com\/microsoft\/vscode\/issues\/\d+)/i.test(comment.value)) {
3230
context.report({
3331
node: <any>comment,
3432
messageId: 'comment',

build/monaco/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "monaco-editor-core",
33
"private": true,
4-
"version": "0.29.2",
4+
"version": "0.30.0",
55
"description": "A browser based code editor",
66
"author": "Microsoft Corporation",
77
"license": "MIT",

build/npm/preinstall.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let err = false;
88
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);
99

1010
if (majorNodeVersion < 14 || majorNodeVersion >= 17) {
11-
console.error('\033[1;31m*** Please use node.js versions >=14 and <=17.\033[0;0m');
11+
console.error('\033[1;31m*** Please use node.js versions >=14 and <17.\033[0;0m');
1212
err = true;
1313
}
1414

@@ -23,7 +23,7 @@ if (majorYarnVersion < 1 || minorYarnVersion < 10) {
2323
err = true;
2424
}
2525

26-
if (!/yarn[\w-.]*\.js$|yarnpkg$/.test(process.env['npm_execpath'])) {
26+
if (!/yarn[\w-.]*\.c?js$|yarnpkg$/.test(process.env['npm_execpath'])) {
2727
console.error('\033[1;31m*** Please use yarn to install dependencies.\033[0;0m');
2828
err = true;
2929
}

build/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"plist": "^3.0.1",
6363
"source-map": "0.6.1",
6464
"tmp": "^0.2.1",
65-
"typescript": "^4.5.0-dev.20211029",
65+
"typescript": "^4.6.0-dev.20211108",
6666
"vsce": "^1.100.0",
6767
"vscode-universal-bundler": "^0.0.2"
6868
},

build/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2557,10 +2557,10 @@ typed-rest-client@^1.8.4:
25572557
tunnel "0.0.6"
25582558
underscore "^1.12.1"
25592559

2560-
typescript@^4.5.0-dev.20211029:
2561-
version "4.5.0-dev.20211029"
2562-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.0-dev.20211029.tgz#ec4619ab136bd70ddd9ec1a7c18783b7ce9990a3"
2563-
integrity sha512-N+2wLMbTq+jQmad78i4wKBGcXudBFWy+QdV1Xu9cx+F5Xi6hubBotFEzS7zA7G1Eevy6NJwlsNy0G8ok2GQ9nw==
2560+
typescript@^4.6.0-dev.20211108:
2561+
version "4.6.0-dev.20211108"
2562+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.0-dev.20211108.tgz#d9e65b39f0876ba9d5e82b7955d1183c38d1e40b"
2563+
integrity sha512-5a0mWJq05zNPSb0vF4s6OJbCxT0Cz6XIjgkaiYy5pkSXlu2E8mYRnYlo9IKKn34eUFO5FiO0uwm0Z3dsbcEgDw==
25642564

25652565
uc.micro@^1.0.1, uc.micro@^1.0.5:
25662566
version "1.0.5"

extensions/configuration-editing/src/typings/ref.d.ts

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "./out"
4+
"outDir": "./out",
5+
"types": [
6+
"node"
7+
]
58
},
69
"include": [
7-
"src/**/*"
10+
"src/**/*",
11+
"../../src/vscode-dts/vscode.d.ts"
812
]
913
}

0 commit comments

Comments
 (0)