Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into tyriar/smoke_test_imp…
Browse files Browse the repository at this point in the history
…rovements
  • Loading branch information
Tyriar committed Nov 12, 2021
2 parents e6caf0d + 23f7918 commit 634dae7
Show file tree
Hide file tree
Showing 416 changed files with 8,603 additions and 5,713 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@
{
"files": [
"**/vscode.d.ts",
"**/vscode.proposed.d.ts"
"**/vscode.proposed.*.d.ts"
],
"rules": {
"vscode-dts-create-func": "warn",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"splitview",
"table",
"list",
"git"
"git",
"sash"
]
}
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
disturl "https://electronjs.org/headers"
target "13.5.1"
target "13.5.2"
runtime "electron"
build_from_source "true"
2 changes: 1 addition & 1 deletion build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ steps:
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
APP_NAME="`ls $APP_ROOT | head -n 1`"
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests
yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests-remote
timeoutInMinutes: 5
displayName: Run smoke tests (Remote)
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/product-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ steps:
set -e
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
yarn smoketest-no-compile --build "$APP_PATH" --remote --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests
yarn smoketest-no-compile --build "$APP_PATH" --remote --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests-remote
timeoutInMinutes: 5
displayName: Run smoke tests (Remote)
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/publish-types/update-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ try {
.execSync('git describe --tags `git rev-list --tags --max-count=1`')
.toString()
.trim();
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vs/vscode.d.ts`;
const dtsUri = `https://raw.githubusercontent.com/microsoft/vscode/${tag}/src/vscode-dts/vscode.d.ts`;
const outPath = path.resolve(process.cwd(), 'DefinitelyTyped/types/vscode/index.d.ts');
cp.execSync(`curl ${dtsUri} --output ${outPath}`);
updateDTSFile(outPath, tag);
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/publish-types/update-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ try {
.toString()
.trim();

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

Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/win32/product-build-win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ steps:
$ErrorActionPreference = "Stop"
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"
exec { yarn smoketest-no-compile --build "$AppRoot" --remote }
exec { yarn smoketest-no-compile --build "$AppRoot" --remote --screenshots $(Build.SourcesDirectory)\.build\logs\smoke-tests-remote }
displayName: Run smoke tests (Remote)
timeoutInMinutes: 5
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
Expand Down
4 changes: 2 additions & 2 deletions build/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./gulpf
const { compileExtensionsTask, watchExtensionsTask, compileExtensionMediaTask } = require('./gulpfile.extensions');

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

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

// All
Expand Down
3 changes: 2 additions & 1 deletion build/gulpfile.vscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const vscodeResources = [
'out-build/vs/base/browser/ui/codicons/codicon/**',
'out-build/vs/base/parts/sandbox/electron-browser/preload.js',
'out-build/vs/platform/environment/node/userDataPath.js',
'out-build/vs/platform/extensions/node/extensionHostStarterWorkerMain.js',
'out-build/vs/workbench/browser/media/*-theme.css',
'out-build/vs/workbench/contrib/debug/**/*.json',
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
Expand Down Expand Up @@ -214,7 +215,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const license = gulp.src(['LICENSES.chromium.html', product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });

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

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

Expand Down
3 changes: 3 additions & 0 deletions build/lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const vm = require("vm");
function bundle(entryPoints, config, callback) {
const entryPointsMap = {};
entryPoints.forEach((module) => {
if (entryPointsMap[module.name]) {
throw new Error(`Cannot have two entry points with the same name '${module.name}'`);
}
entryPointsMap[module.name] = module;
});
const allMentionedModulesMap = {};
Expand Down
3 changes: 3 additions & 0 deletions build/lib/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export interface ILoaderConfig {
export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callback: (err: any, result: IBundleResult | null) => void): void {
const entryPointsMap: IEntryPointMap = {};
entryPoints.forEach((module: IEntryPoint) => {
if (entryPointsMap[module.name]) {
throw new Error(`Cannot have two entry points with the same name '${module.name}'`);
}
entryPointsMap[module.name] = module;
});

Expand Down
64 changes: 63 additions & 1 deletion build/lib/compilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchTask = exports.compileTask = void 0;
exports.watchApiProposalNames = exports.compileApiProposalNames = exports.watchTask = exports.compileTask = void 0;
const es = require("event-stream");
const fs = require("fs");
const gulp = require("gulp");
Expand Down Expand Up @@ -175,3 +175,65 @@ class MonacoGenerator {
}
}
}
function apiProposalNamesGenerator() {
const stream = es.through();
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts/;
const dtsFolder = path.join(REPO_SRC_FOLDER, 'vscode-dts');
const generateFile = () => {
try {
const t1 = Date.now();
const proposalNames = [];
for (let file of fs.readdirSync(dtsFolder).sort()) {
const match = pattern.exec(file);
if (match) {
proposalNames.push([match[1], `https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/${file}`]);
}
}
const source = [
'/*---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
' * Licensed under the MIT License. See License.txt in the project root for license information.',
' *--------------------------------------------------------------------------------------------*/',
'',
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
'',
'export const allApiProposals = Object.freeze({',
`${proposalNames.map(t => `\t${t[0]}: '${t[1]}'`).join(',\n')}`,
'});',
'export type ApiProposalName = keyof typeof allApiProposals;',
'',
].join('\n');
const outFile = path.join(dtsFolder, '../vs/workbench/services/extensions/common/extensionsApiProposals.ts');
if (fs.readFileSync(outFile).toString() !== source) {
fs.writeFileSync(outFile, source);
console.log(`Generated 'extensionsApiProposals.ts' in ${Date.now() - t1}ms`);
}
}
catch (err) {
stream.emit('error', err);
}
};
let handle;
stream.on('data', () => {
clearTimeout(handle);
handle = setTimeout(generateFile, 250);
});
return stream;
}
function compileApiProposalNames() {
return function () {
const srcPipe = gulp.src('src/vscode-dts/**', { base: 'src' });
const proposals = apiProposalNamesGenerator();
return srcPipe.pipe(proposals);
};
}
exports.compileApiProposalNames = compileApiProposalNames;
function watchApiProposalNames() {
return function () {
const watchSrc = watch('src/vscode-dts/**', { base: 'src', readDelay: 200 });
const proposals = apiProposalNamesGenerator();
proposals.write(undefined); // send something to trigger initial generate
return watchSrc.pipe(proposals);
};
}
exports.watchApiProposalNames = watchApiProposalNames;
72 changes: 72 additions & 0 deletions build/lib/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,75 @@ class MonacoGenerator {
}
}
}

function apiProposalNamesGenerator() {
const stream = es.through();

const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts/;
const dtsFolder = path.join(REPO_SRC_FOLDER, 'vscode-dts');

const generateFile = () => {

try {

const t1 = Date.now();
const proposalNames: [name: string, url: string][] = [];
for (let file of fs.readdirSync(dtsFolder).sort()) {
const match = pattern.exec(file);
if (match) {
proposalNames.push([match[1], `https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/${file}`]);
}
}

const source = [
'/*---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
' * Licensed under the MIT License. See License.txt in the project root for license information.',
' *--------------------------------------------------------------------------------------------*/',
'',
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
'',
'export const allApiProposals = Object.freeze({',
`${proposalNames.map(t => `\t${t[0]}: '${t[1]}'`).join(',\n')}`,
'});',
'export type ApiProposalName = keyof typeof allApiProposals;',
'',
].join('\n');

const outFile = path.join(dtsFolder, '../vs/workbench/services/extensions/common/extensionsApiProposals.ts');

if (fs.readFileSync(outFile).toString() !== source) {
fs.writeFileSync(outFile, source);
console.log(`Generated 'extensionsApiProposals.ts' in ${Date.now() - t1}ms`);
}

} catch (err) {
stream.emit('error', err);
}
};

let handle: NodeJS.Timeout;
stream.on('data', () => {
clearTimeout(handle);
handle = setTimeout(generateFile, 250);
});

return stream;
}

export function compileApiProposalNames(): () => NodeJS.ReadWriteStream {
return function () {
const srcPipe = gulp.src('src/vscode-dts/**', { base: 'src' });
const proposals = apiProposalNamesGenerator();
return srcPipe.pipe(proposals);
};
}

export function watchApiProposalNames(): () => NodeJS.ReadWriteStream {
return function () {
const watchSrc = watch('src/vscode-dts/**', { base: 'src', readDelay: 200 });
const proposals = apiProposalNamesGenerator();
proposals.write(undefined); // send something to trigger initial generate
return watchSrc.pipe(proposals);
};
}
8 changes: 4 additions & 4 deletions build/lib/eslint/vscode-dts-region-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ module.exports = new class ApiEventNaming {
constructor() {
this.meta = {
messages: {
comment: 'region comments should start with the GH issue link, e.g #region https://github.com/microsoft/vscode/issues/<number>',
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>',
}
};
}
create(context) {
const sourceCode = context.getSourceCode();
return {
['Program']: (_node) => {
for (let comment of sourceCode.getAllComments()) {
for (const comment of sourceCode.getAllComments()) {
if (comment.type !== 'Line') {
continue;
}
if (!comment.value.match(/^\s*#region /)) {
if (!/^\s*#region /.test(comment.value)) {
continue;
}
if (!comment.value.match(/https:\/\/github.com\/microsoft\/vscode\/issues\/\d+/i)) {
if (!/^\s*#region ([a-z]+): (@[a-z]+|https:\/\/github.com\/microsoft\/vscode\/issues\/\d+)/i.test(comment.value)) {
context.report({
node: comment,
messageId: 'comment',
Expand Down
10 changes: 4 additions & 6 deletions build/lib/eslint/vscode-dts-region-comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {

readonly meta: eslint.Rule.RuleMetaData = {
messages: {
comment: 'region comments should start with the GH issue link, e.g #region https://github.com/microsoft/vscode/issues/<number>',
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>',
}
};

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

const sourceCode = context.getSourceCode();


return {
['Program']: (_node: any) => {

for (let comment of sourceCode.getAllComments()) {
for (const comment of sourceCode.getAllComments()) {
if (comment.type !== 'Line') {
continue;
}
if (!comment.value.match(/^\s*#region /)) {
if (!/^\s*#region /.test(comment.value)) {
continue;
}
if (!comment.value.match(/https:\/\/github.com\/microsoft\/vscode\/issues\/\d+/i)) {
if (!/^\s*#region ([a-z]+): (@[a-z]+|https:\/\/github.com\/microsoft\/vscode\/issues\/\d+)/i.test(comment.value)) {
context.report({
node: <any>comment,
messageId: 'comment',
Expand Down
2 changes: 1 addition & 1 deletion build/monaco/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "monaco-editor-core",
"private": true,
"version": "0.29.2",
"version": "0.30.0",
"description": "A browser based code editor",
"author": "Microsoft Corporation",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion build/npm/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let err = false;
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);

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

Expand Down
7 changes: 0 additions & 7 deletions extensions/configuration-editing/src/typings/ref.d.ts

This file was deleted.

8 changes: 6 additions & 2 deletions extensions/configuration-editing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}
6 changes: 0 additions & 6 deletions extensions/css-language-features/client/src/typings/ref.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion extensions/css-language-features/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"outDir": "./out"
},
"include": [
"src/**/*"
"src/**/*",
"../../../src/vscode-dts/vscode.d.ts"
]
}
1 change: 0 additions & 1 deletion extensions/css-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
],
"main": "./client/out/node/cssClientMain",
"browser": "./client/dist/browser/cssClientMain",
"enableProposedApi": true,
"capabilities": {
"virtualWorkspaces": true,
"untrustedWorkspaces": {
Expand Down
Loading

0 comments on commit 634dae7

Please sign in to comment.