Build VS Code using TS 4.4 (#127823)

* Build VS Code using TS 4.4

* Remove usages of deprecated `ClientRectList`

* Add any casts for missing `caretRangeFromPoint`

* Add temporary any casts for `zoom` css propery

This non-standard css property no longer exists in lib.dom.d.ts

* MouseWheelEvent -> WheelEvent

* Pick up new TS nightly

Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
This commit is contained in:
Matt Bierner 2021-07-08 14:27:39 -07:00 committed by GitHub
parent 4fe851b9a7
commit 0762d23ae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 74 additions and 76 deletions

View file

@ -160,7 +160,7 @@ async function main() {
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
console.log('Uploading blobs to Azure storage and Mooncake Azure storage...');
await retry_1.retry(() => Promise.all([
await (0, retry_1.retry)(() => Promise.all([
uploadBlob(blobService, quality, blobName, filePath, fileName),
uploadBlob(mooncakeBlobService, quality, blobName, filePath, fileName)
]));
@ -185,7 +185,7 @@ async function main() {
console.log('Asset:', JSON.stringify(asset, null, ' '));
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
const scripts = client.database('builds').container(quality).scripts;
await retry_1.retry(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
await (0, retry_1.retry)(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
console.log(` Done ✔️`);
}
main().then(() => {

View file

@ -40,7 +40,7 @@ async function main() {
};
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
const scripts = client.database('builds').container(quality).scripts;
await retry_1.retry(() => scripts.storedProcedure('createBuild').execute('', [Object.assign(Object.assign({}, build), { _partitionKey: '' })]));
await (0, retry_1.retry)(() => scripts.storedProcedure('createBuild').execute('', [Object.assign(Object.assign({}, build), { _partitionKey: '' })]));
}
main().then(() => {
console.log('Build successfully created');

View file

@ -7,6 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
const retry_1 = require("./retry");
const { installBrowsersWithProgressBar } = require('playwright/lib/install/installer');
async function install() {
await retry_1.retry(() => installBrowsersWithProgressBar());
await (0, retry_1.retry)(() => installBrowsersWithProgressBar());
}
install();

View file

@ -39,7 +39,7 @@ async function main() {
}
console.log(`Releasing build ${commit}...`);
const scripts = client.database('builds').container(quality).scripts;
await retry_1.retry(() => scripts.storedProcedure('releaseBuild').execute('', [commit]));
await (0, retry_1.retry)(() => scripts.storedProcedure('releaseBuild').execute('', [commit]));
}
main().then(() => {
console.log('Build successfully released');

View file

@ -23,7 +23,7 @@ async function main() {
const outAppPath = path.join(buildDir, `VSCode-darwin-${arch}`, appName);
const productJsonPath = path.resolve(outAppPath, 'Contents', 'Resources', 'app', 'product.json');
const infoPlistPath = path.resolve(outAppPath, 'Contents', 'Info.plist');
await vscode_universal_1.makeUniversalApp({
await (0, vscode_universal_1.makeUniversalApp)({
x64AppPath,
arm64AppPath,
x64AsarPath,

View file

@ -25,7 +25,7 @@ async function downloadExtensionDetails(extension) {
const promises = [];
for (const fileName of contentFileNames) {
promises.push(new Promise(resolve => {
got_1.default(`${repositoryContentBaseUrl}/${fileName}`)
(0, got_1.default)(`${repositoryContentBaseUrl}/${fileName}`)
.then(response => {
resolve({ fileName, body: response.rawBody });
})

View file

@ -17,7 +17,7 @@ const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors");
const os = require("os");
const watch = require('./watch');
const reporter = reporter_1.createReporter();
const reporter = (0, reporter_1.createReporter)();
function getTypeScriptCompilerOptions(src) {
const rootDir = path.join(__dirname, `../../${src}`);
let options = {};

View file

@ -21,7 +21,7 @@ module.exports = new class {
const configs = context.options;
for (const config of configs) {
if (minimatch(context.getFilename(), config.target)) {
return utils_1.createImportRuleListener((node, value) => this._checkImport(context, config, node, value));
return (0, utils_1.createImportRuleListener)((node, value) => this._checkImport(context, config, node, value));
}
}
return {};
@ -29,7 +29,7 @@ module.exports = new class {
_checkImport(context, config, node, path) {
// resolve relative paths
if (path[0] === '.') {
path = path_1.join(context.getFilename(), path);
path = (0, path_1.join)(context.getFilename(), path);
}
let restrictions;
if (typeof config.restrictions === 'string') {

View file

@ -17,7 +17,7 @@ module.exports = new class {
};
}
create(context) {
const fileDirname = path_1.dirname(context.getFilename());
const fileDirname = (0, path_1.dirname)(context.getFilename());
const parts = fileDirname.split(/\\|\//);
const ruleArgs = context.options[0];
let config;
@ -39,11 +39,11 @@ module.exports = new class {
// nothing
return {};
}
return utils_1.createImportRuleListener((node, path) => {
return (0, utils_1.createImportRuleListener)((node, path) => {
if (path[0] === '.') {
path = path_1.join(path_1.dirname(context.getFilename()), path);
path = (0, path_1.join)((0, path_1.dirname)(context.getFilename()), path);
}
const parts = path_1.dirname(path).split(/\\|\//);
const parts = (0, path_1.dirname)(path).split(/\\|\//);
for (let i = parts.length - 1; i >= 0; i--) {
const part = parts[i];
if (config.allowed.has(part)) {

View file

@ -20,10 +20,10 @@ module.exports = new class NoNlsInStandaloneEditorRule {
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(fileName)
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(fileName)
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(fileName)) {
return utils_1.createImportRuleListener((node, path) => {
return (0, utils_1.createImportRuleListener)((node, path) => {
// resolve relative paths
if (path[0] === '.') {
path = path_1.join(context.getFilename(), path);
path = (0, path_1.join)(context.getFilename(), path);
}
if (/vs(\/|\\)nls/.test(path)) {
context.report({

View file

@ -21,10 +21,10 @@ module.exports = new class NoNlsInStandaloneEditorRule {
// the vs/editor folder is allowed to use the standalone editor
return {};
}
return utils_1.createImportRuleListener((node, path) => {
return (0, utils_1.createImportRuleListener)((node, path) => {
// resolve relative paths
if (path[0] === '.') {
path = path_1.join(context.getFilename(), path);
path = (0, path_1.join)(context.getFilename(), path);
}
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)

View file

@ -15,7 +15,7 @@ module.exports = new (_a = class TranslationRemind {
};
}
create(context) {
return utils_1.createImportRuleListener((node, path) => this._checkImport(context, node, path));
return (0, utils_1.createImportRuleListener)((node, path) => this._checkImport(context, node, path));
}
_checkImport(context, node, path) {
if (path !== TranslationRemind.NLS_MODULE) {
@ -31,7 +31,7 @@ module.exports = new (_a = class TranslationRemind {
let resourceDefined = false;
let json;
try {
json = fs_1.readFileSync('./build/lib/i18n.resources.json', 'utf8');
json = (0, fs_1.readFileSync)('./build/lib/i18n.resources.json', 'utf8');
}
catch (e) {
console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.');

View file

@ -144,7 +144,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName) {
console.error(packagedDependencies);
result.emit('error', err);
});
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
return result.pipe((0, stats_1.createStatsStream)(path.basename(extensionPath)));
}
function fromLocalNormal(extensionPath) {
const result = es.through();
@ -162,7 +162,7 @@ function fromLocalNormal(extensionPath) {
es.readArray(files).pipe(result);
})
.catch(err => result.emit('error', err));
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
return result.pipe((0, stats_1.createStatsStream)(path.basename(extensionPath)));
}
const baseHeaders = {
'X-Market-Client-Id': 'VSCode Build',

View file

@ -466,7 +466,7 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
});
}
function processNlsFiles(opts) {
return event_stream_1.through(function (file) {
return (0, event_stream_1.through)(function (file) {
let fileName = path.basename(file.path);
if (fileName === 'nls.metadata.json') {
let json = null;
@ -518,7 +518,7 @@ function getResource(sourceFile) {
}
exports.getResource = getResource;
function createXlfFilesForCoreBundle() {
return event_stream_1.through(function (file) {
return (0, event_stream_1.through)(function (file) {
const basename = path.basename(file.path);
if (basename === 'nls.metadata.json') {
if (file.isBuffer()) {
@ -569,7 +569,7 @@ function createXlfFilesForExtensions() {
let counter = 0;
let folderStreamEnded = false;
let folderStreamEndEmitted = false;
return event_stream_1.through(function (extensionFolder) {
return (0, event_stream_1.through)(function (extensionFolder) {
const folderStream = this;
const stat = fs.statSync(extensionFolder.path);
if (!stat.isDirectory()) {
@ -587,7 +587,7 @@ function createXlfFilesForExtensions() {
}
return _xlf;
}
gulp.src([`.build/extensions/${extensionName}/package.nls.json`, `.build/extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
gulp.src([`.build/extensions/${extensionName}/package.nls.json`, `.build/extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe((0, event_stream_1.through)(function (file) {
if (file.isBuffer()) {
const buffer = file.contents;
const basename = path.basename(file.path);
@ -646,7 +646,7 @@ function createXlfFilesForExtensions() {
}
exports.createXlfFilesForExtensions = createXlfFilesForExtensions;
function createXlfFilesForIsl() {
return event_stream_1.through(function (file) {
return (0, event_stream_1.through)(function (file) {
let projectName, resourceFile;
if (path.basename(file.path) === 'messages.en.isl') {
projectName = setupProject;
@ -699,7 +699,7 @@ exports.createXlfFilesForIsl = createXlfFilesForIsl;
function pushXlfFiles(apiHostname, username, password) {
let tryGetPromises = [];
let updateCreatePromises = [];
return event_stream_1.through(function (file) {
return (0, event_stream_1.through)(function (file) {
const project = path.dirname(file.relative);
const fileName = path.basename(file.path);
const slug = fileName.substr(0, fileName.length - '.xlf'.length);
@ -761,7 +761,7 @@ function getAllResources(project, apiHostname, username, password) {
function findObsoleteResources(apiHostname, username, password) {
let resourcesByProject = Object.create(null);
resourcesByProject[extensionsProject] = [].concat(exports.externalExtensionsWithTranslations); // clone
return event_stream_1.through(function (file) {
return (0, event_stream_1.through)(function (file) {
const project = path.dirname(file.relative);
const fileName = path.basename(file.path);
const slug = fileName.substr(0, fileName.length - '.xlf'.length);
@ -913,7 +913,7 @@ function pullXlfFiles(apiHostname, username, password, language, resources) {
const credentials = `${username}:${password}`;
let expectedTranslationsCount = resources.length;
let translationsRetrieved = 0, called = false;
return event_stream_1.readable(function (_count, callback) {
return (0, event_stream_1.readable)(function (_count, callback) {
// Mark end of stream when all resources were retrieved
if (translationsRetrieved === expectedTranslationsCount) {
return this.emit('end');
@ -971,7 +971,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
}
function prepareI18nFiles() {
let parsePromises = [];
return event_stream_1.through(function (xlf) {
return (0, event_stream_1.through)(function (xlf) {
let stream = this;
let parsePromise = XLF.parse(xlf.contents.toString());
parsePromises.push(parsePromise);
@ -1015,7 +1015,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
let mainPack = { version: i18nPackVersion, contents: {} };
let extensionsPacks = {};
let errors = [];
return event_stream_1.through(function (xlf) {
return (0, event_stream_1.through)(function (xlf) {
let project = path.basename(path.dirname(path.dirname(xlf.relative)));
let resource = path.basename(xlf.relative, '.xlf');
let contents = xlf.contents.toString();
@ -1077,7 +1077,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
exports.prepareI18nPackFiles = prepareI18nPackFiles;
function prepareIslFiles(language, innoSetupConfig) {
let parsePromises = [];
return event_stream_1.through(function (xlf) {
return (0, event_stream_1.through)(function (xlf) {
let stream = this;
let parsePromise = XLF.parse(xlf.contents.toString());
parsePromises.push(parsePromise);

View file

@ -199,7 +199,7 @@ const RULES = [
]
}
];
const TS_CONFIG_PATH = path_1.join(__dirname, '../../', 'src', 'tsconfig.json');
const TS_CONFIG_PATH = (0, path_1.join)(__dirname, '../../', 'src', 'tsconfig.json');
let hasErrors = false;
function checkFile(program, sourceFile, rule) {
checkNode(sourceFile);
@ -250,8 +250,8 @@ function checkFile(program, sourceFile, rule) {
}
function createProgram(tsconfigPath) {
const tsConfig = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
const configHostParser = { fileExists: fs_1.existsSync, readDirectory: ts.sys.readDirectory, readFile: file => fs_1.readFileSync(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
const tsConfigParsed = ts.parseJsonConfigFileContent(tsConfig.config, configHostParser, path_1.resolve(path_1.dirname(tsconfigPath)), { noEmit: true });
const configHostParser = { fileExists: fs_1.existsSync, readDirectory: ts.sys.readDirectory, readFile: file => (0, fs_1.readFileSync)(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
const tsConfigParsed = ts.parseJsonConfigFileContent(tsConfig.config, configHostParser, (0, path_1.resolve)((0, path_1.dirname)(tsconfigPath)), { noEmit: true });
const compilerHost = ts.createCompilerHost(tsConfigParsed.options, true);
return ts.createProgram(tsConfigParsed.fileNames, tsConfigParsed.options, compilerHost);
}
@ -261,7 +261,7 @@ function createProgram(tsconfigPath) {
const program = createProgram(TS_CONFIG_PATH);
for (const sourceFile of program.getSourceFiles()) {
for (const rule of RULES) {
if (minimatch_1.match([sourceFile.fileName], rule.target).length > 0) {
if ((0, minimatch_1.match)([sourceFile.fileName], rule.target).length > 0) {
if (!rule.skip) {
checkFile(program, sourceFile, rule);
}

View file

@ -53,8 +53,8 @@ define([], [${wrap + lines.map(l => indent + l).join(',\n') + wrap}]);`;
* Returns a stream containing the patched JavaScript and source maps.
*/
function nls() {
const input = event_stream_1.through();
const output = input.pipe(event_stream_1.through(function (f) {
const input = (0, event_stream_1.through)();
const output = input.pipe((0, event_stream_1.through)(function (f) {
if (!f.sourceMap) {
return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
}
@ -72,7 +72,7 @@ function nls() {
}
_nls.patchFiles(f, typescript).forEach(f => this.emit('data', f));
}));
return event_stream_1.duplex(input, output);
return (0, event_stream_1.duplex)(input, output);
}
exports.nls = nls;
function isImportNode(ts, node) {

View file

@ -96,7 +96,7 @@ function toConcatStream(src, bundledFileHeader, sources, dest, fileContentMapper
return es.readArray(treatedSources)
.pipe(useSourcemaps ? util.loadSourcemaps() : es.through())
.pipe(concat(dest))
.pipe(stats_1.createStatsStream(dest));
.pipe((0, stats_1.createStatsStream)(dest));
}
function toBundleStream(src, bundledFileHeader, bundles, fileContentMapper) {
return es.merge(bundles.map(function (bundle) {
@ -153,7 +153,7 @@ function optimizeTask(opts) {
addComment: true,
includeContent: true
}))
.pipe(opts.languages && opts.languages.length ? i18n_1.processNlsFiles({
.pipe(opts.languages && opts.languages.length ? (0, i18n_1.processNlsFiles)({
fileHeader: bundledFileHeader,
languages: opts.languages
}) : es.through())

View file

@ -12,7 +12,7 @@ const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
const rootDir = path.resolve(__dirname, '..', '..');
function runProcess(command, args = []) {
return new Promise((resolve, reject) => {
const child = child_process_1.spawn(command, args, { cwd: rootDir, stdio: 'inherit', env: process.env });
const child = (0, child_process_1.spawn)(command, args, { cwd: rootDir, stdio: 'inherit', env: process.env });
child.on('exit', err => !err ? resolve() : process.exit(err !== null && err !== void 0 ? err : 1));
child.on('error', reject);
});

View file

@ -52,7 +52,7 @@
"p-limit": "^3.1.0",
"plist": "^3.0.1",
"source-map": "0.6.1",
"typescript": "^4.4.0-dev.20210607",
"typescript": "^4.4.0-dev.20210708",
"vsce": "1.48.0",
"vscode-universal": "deepak1556/universal#61454d96223b774c53cda10f72c2098c0ce02d58"
},

View file

@ -13,7 +13,7 @@
"allowJs": true,
"checkJs": true,
"strict": true,
"strictOptionalProperties": false,
"exactOptionalPropertyTypes": false,
"useUnknownInCatchVariables": false,
"noUnusedLocals": true,
"noUnusedParameters": true,

View file

@ -1879,10 +1879,10 @@ typescript@^4.1.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7"
integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==
typescript@^4.4.0-dev.20210607:
version "4.4.0-dev.20210607"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.0-dev.20210607.tgz#ea802e420785ef3b6b9c2e12d1ff4b8d2e52ee19"
integrity sha512-tKAp1IL4APSdxD7xHLDU6tIDOEN8yJOTUGG+cSdLunmysl3yOkGrdUbByDaFDmGjKywghGhQvcG8gOqbLUcDcg==
typescript@^4.4.0-dev.20210708:
version "4.4.0-dev.20210708"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.0-dev.20210708.tgz#0043aa6d3b81c111c6215477a31774b5a864e7e1"
integrity sha512-jGNamsvrU8F8KjMawCauI7bQeUPKYdyIp4yiEsKv8Uk1gt494FN09wgtH9wbbT0qK7a7lel7A/N/DodpPWK/6Q==
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.5"

View file

@ -6,7 +6,7 @@
],
"module": "commonjs",
"strict": true,
"strictOptionalProperties": false,
"exactOptionalPropertyTypes": false,
"useUnknownInCatchVariables": false,
"alwaysStrict": true,
"noImplicitAny": true,

View file

@ -191,7 +191,7 @@
"style-loader": "^1.0.0",
"ts-loader": "^6.2.1",
"tsec": "0.1.4",
"typescript": "^4.4.0-dev.20210607",
"typescript": "^4.4.0-dev.20210708",
"typescript-formatter": "7.1.0",
"underscore": "^1.12.1",
"vinyl": "^2.0.0",

View file

@ -8,7 +8,7 @@
"noUnusedLocals": true,
"allowUnreachableCode": false,
"strict": true,
"strictOptionalProperties": false,
"exactOptionalPropertyTypes": false,
"useUnknownInCatchVariables": false,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",

View file

@ -851,13 +851,13 @@ export class MouseTargetFactory {
const shadowRoot = dom.getShadowRoot(ctx.viewDomNode);
let range: Range;
if (shadowRoot) {
if (typeof shadowRoot.caretRangeFromPoint === 'undefined') {
if (typeof (<any>shadowRoot).caretRangeFromPoint === 'undefined') {
range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY);
} else {
range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY);
range = (<any>shadowRoot).caretRangeFromPoint(coords.clientX, coords.clientY);
}
} else {
range = document.caretRangeFromPoint(coords.clientX, coords.clientY);
range = (<any>document).caretRangeFromPoint(coords.clientX, coords.clientY);
}
if (!range || !range.startContainer) {
@ -951,7 +951,7 @@ export class MouseTargetFactory {
private static _doHitTest(ctx: HitTestContext, request: BareHitTestRequest): HitTestResult {
let result: HitTestResult = new UnknownHitTestResult();
if (typeof document.caretRangeFromPoint === 'function') {
if (typeof (<any>document).caretRangeFromPoint === 'function') {
result = this._doHitTestWithCaretRangeFromPoint(ctx, request);
} else if ((<any>document).caretPositionFromPoint) {
result = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates());
@ -974,7 +974,7 @@ export function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y:
const range = document.createRange();
// Get the element under the point
let el: Element | null = shadowRoot.elementFromPoint(x, y);
let el: Element | null = (<any>shadowRoot).elementFromPoint(x, y);
if (el !== null) {
// Get the last child of the element until its firstChild is a text node

View file

@ -305,9 +305,7 @@ function readLineBreaks(range: Range, lineDomNode: HTMLDivElement, lineContent:
return breakOffsets;
}
type MaybeRects = ClientRectList | DOMRectList | null;
function discoverBreaks(range: Range, spans: HTMLSpanElement[], charOffsets: number[], low: number, lowRects: MaybeRects, high: number, highRects: MaybeRects, result: number[]): void {
function discoverBreaks(range: Range, spans: HTMLSpanElement[], charOffsets: number[], low: number, lowRects: DOMRectList | null, high: number, highRects: DOMRectList | null, result: number[]): void {
if (low === high) {
return;
}
@ -333,7 +331,7 @@ function discoverBreaks(range: Range, spans: HTMLSpanElement[], charOffsets: num
discoverBreaks(range, spans, charOffsets, mid, midRects, high, highRects, result);
}
function readClientRect(range: Range, spans: HTMLSpanElement[], startOffset: number, endOffset: number): ClientRectList | DOMRectList {
function readClientRect(range: Range, spans: HTMLSpanElement[], startOffset: number, endOffset: number): DOMRectList {
range.setStart(spans[(startOffset / Constants.SPAN_MODULO_LIMIT) | 0].firstChild!, startOffset % Constants.SPAN_MODULO_LIMIT);
range.setEnd(spans[(endOffset / Constants.SPAN_MODULO_LIMIT) | 0].firstChild!, endOffset % Constants.SPAN_MODULO_LIMIT);
return range.getClientRects();

View file

@ -48,7 +48,7 @@ export class RangeUtil {
range.selectNodeContents(endNode);
}
private static _readClientRects(startElement: Node, startOffset: number, endElement: Node, endOffset: number, endNode: HTMLElement): ClientRectList | DOMRectList | null {
private static _readClientRects(startElement: Node, startOffset: number, endElement: Node, endOffset: number, endNode: HTMLElement): DOMRectList | null {
const range = this._createRange();
try {
range.setStart(startElement, startOffset);
@ -94,7 +94,7 @@ export class RangeUtil {
return result;
}
private static _createHorizontalRangesFromClientRects(clientRects: ClientRectList | DOMRectList | null, clientRectDeltaLeft: number): HorizontalRange[] | null {
private static _createHorizontalRangesFromClientRects(clientRects: DOMRectList | null, clientRectDeltaLeft: number): HorizontalRange[] | null {
if (!clientRects || clientRects.length === 0) {
return null;
}

View file

@ -325,7 +325,7 @@ export class TabsTitleControl extends TitleControl {
}));
// Mouse-wheel support to switch to tabs optionally
this._register(addDisposableListener(tabsContainer, EventType.MOUSE_WHEEL, (e: MouseWheelEvent) => {
this._register(addDisposableListener(tabsContainer, EventType.MOUSE_WHEEL, (e: WheelEvent) => {
const activeEditor = this.group.activeEditor;
if (!activeEditor || this.group.count < 2) {
return; // need at least 2 open editors

View file

@ -514,9 +514,9 @@ export class TitlebarPart extends Part implements ITitleService {
if (getTitleBarStyle(this.configurationService) === 'custom') {
// Only prevent zooming behavior on macOS or when the menubar is not visible
if ((!isWeb && isMacintosh) || this.currentMenubarVisibility === 'hidden') {
this.title.style.zoom = `${1 / getZoomFactor()}`;
(this.title.style as any).zoom = `${1 / getZoomFactor()}`;
} else {
this.title.style.zoom = '';
(this.title.style as any).zoom = '';
}
runAtThisOrScheduleAtNextAnimationFrame(() => this.adjustTitleMarginToCenter());

View file

@ -229,25 +229,25 @@ export class TitlebarPart extends BrowserTitleBarPart {
if (getTitleBarStyle(this.configurationService) === 'custom') {
// Only prevent zooming behavior on macOS or when the menubar is not visible
if (isMacintosh || this.currentMenubarVisibility === 'hidden') {
this.title.style.zoom = `${1 / getZoomFactor()}`;
(this.title.style as any).zoom = `${1 / getZoomFactor()}`;
if (isWindows || isLinux) {
if (this.appIcon) {
this.appIcon.style.zoom = `${1 / getZoomFactor()}`;
(this.appIcon.style as any).zoom = `${1 / getZoomFactor()}`;
}
if (this.windowControls) {
this.windowControls.style.zoom = `${1 / getZoomFactor()}`;
(this.windowControls.style as any).zoom = `${1 / getZoomFactor()}`;
}
}
} else {
this.title.style.zoom = '';
(this.title.style as any).zoom = '';
if (isWindows || isLinux) {
if (this.appIcon) {
this.appIcon.style.zoom = '';
(this.appIcon.style as any).zoom = '';
}
if (this.windowControls) {
this.windowControls.style.zoom = '';
(this.windowControls.style as any).zoom = '';
}
}
}

View file

@ -9627,10 +9627,10 @@ typescript@^2.6.2:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
integrity sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=
typescript@^4.4.0-dev.20210607:
version "4.4.0-dev.20210607"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.0-dev.20210607.tgz#ea802e420785ef3b6b9c2e12d1ff4b8d2e52ee19"
integrity sha512-tKAp1IL4APSdxD7xHLDU6tIDOEN8yJOTUGG+cSdLunmysl3yOkGrdUbByDaFDmGjKywghGhQvcG8gOqbLUcDcg==
typescript@^4.4.0-dev.20210708:
version "4.4.0-dev.20210708"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.0-dev.20210708.tgz#0043aa6d3b81c111c6215477a31774b5a864e7e1"
integrity sha512-jGNamsvrU8F8KjMawCauI7bQeUPKYdyIp4yiEsKv8Uk1gt494FN09wgtH9wbbT0qK7a7lel7A/N/DodpPWK/6Q==
typical@^4.0.0:
version "4.0.0"