Merge remote-tracking branch 'origin/main' into tyriar/smoke_test_improvements

This commit is contained in:
Daniel Imms 2021-11-12 05:45:20 -08:00
commit 634dae736e
416 changed files with 8733 additions and 5843 deletions

View file

@ -1066,7 +1066,7 @@
{
"files": [
"**/vscode.d.ts",
"**/vscode.proposed.d.ts"
"**/vscode.proposed.*.d.ts"
],
"rules": {
"vscode-dts-create-func": "warn",

View file

@ -86,6 +86,7 @@
"splitview",
"table",
"list",
"git"
"git",
"sash"
]
}

View file

@ -1,4 +1,4 @@
disturl "https://electronjs.org/headers"
target "13.5.1"
target "13.5.2"
runtime "electron"
build_from_source "true"

View file

@ -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'))

View file

@ -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'))

View file

@ -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);

View file

@ -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}`);

View file

@ -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'))

View file

@ -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

View file

@ -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',
@ -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 });

View file

@ -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 = {};

View file

@ -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;
});

View file

@ -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");
@ -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;

View file

@ -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);
};
}

View file

@ -7,7 +7,7 @@ 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>',
}
};
}
@ -15,14 +15,14 @@ module.exports = new class ApiEventNaming {
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',

View file

@ -9,7 +9,7 @@ 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>',
}
};
@ -17,18 +17,16 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {
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',

View file

@ -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",

View file

@ -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;
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,6 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
/// <reference path="../../../../../src/vs/vscode.proposed.d.ts" />

View file

@ -4,6 +4,7 @@
"outDir": "./out"
},
"include": [
"src/**/*"
"src/**/*",
"../../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -17,7 +17,6 @@
],
"main": "./client/out/node/cssClientMain",
"browser": "./client/dist/browser/cssClientMain",
"enableProposedApi": true,
"capabilities": {
"virtualWorkspaces": true,
"untrustedWorkspaces": {

View file

@ -2,9 +2,13 @@
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"downlevelIteration": true
"downlevelIteration": true,
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -18,7 +18,9 @@
"supported": true
}
},
"enableProposedApi": true,
"enabledApiProposals": [
"terminalDataWriteEvent"
],
"main": "./out/extension",
"scripts": {
"compile": "gulp compile-extension:debug-server-ready",

View file

@ -1,8 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -2,9 +2,14 @@
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"downlevelIteration": true
"downlevelIteration": true,
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts",
]
}

View file

@ -0,0 +1,2 @@
build/**
cgmanifest.json

View file

@ -0,0 +1,32 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "textmate/diff.tmbundle",
"repositoryUrl": "https://github.com/textmate/diff.tmbundle",
"commitHash": "0593bb775eab1824af97ef2172fd38822abd97d7"
}
},
"licenseDetail": [
"Copyright (c) textmate-diff.tmbundle project authors",
"",
"If not otherwise specified (see below), files in this repository fall under the following license:",
"",
"Permission to copy, use, modify, sell and distribute this",
"software is granted. This software is provided \"as is\" without",
"express or implied warranty, and with no claim as to its",
"suitability for any purpose.",
"",
"An exception is made for files in readable text which contain their own license information,",
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
],
"license": "TextMate Bundle License",
"version": "0.0.0"
}
],
"version": 1
}

View file

@ -0,0 +1,38 @@
{
"name": "diff",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/diff.tmbundle Syntaxes/Diff.plist ./syntaxes/diff.tmLanguage.json"
},
"contributes": {
"languages": [
{
"id": "diff",
"aliases": [
"Diff",
"diff"
],
"extensions": [
".diff",
".patch",
".rej"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "diff",
"scopeName": "source.diff",
"path": "./syntaxes/diff.tmLanguage.json"
}
]
}
}

View file

@ -0,0 +1,4 @@
{
"displayName": "Diff Language Basics",
"description": "Provides syntax highlighting & bracket matching in Diff files."
}

View file

@ -49,7 +49,7 @@ export async function wrapWithAbbreviation(args: any): Promise<boolean> {
const helper = getEmmetHelper();
const operationRanges = editor.selections.sort((a, b) => a.start.compareTo(b.start)).map(selection => {
const operationRanges = Array.from(editor.selections).sort((a, b) => a.start.compareTo(b.start)).map(selection => {
let rangeToReplace: vscode.Range = selection;
// wrap around the node if the selection falls inside its open or close tag
{

View file

@ -8,8 +8,8 @@ import { getHtmlFlatNode, offsetRangeToSelection, validate } from './util';
import { getRootNode } from './parseDocument';
import { HtmlNode as HtmlFlatNode } from 'EmmetFlatNode';
let balanceOutStack: Array<vscode.Selection[]> = [];
let lastBalancedSelections: vscode.Selection[] = [];
let balanceOutStack: Array<readonly vscode.Selection[]> = [];
let lastBalancedSelections: readonly vscode.Selection[] = [];
export function balanceOut() {
balance(true);
@ -31,10 +31,8 @@ function balance(out: boolean) {
}
const rangeFn = out ? getRangeToBalanceOut : getRangeToBalanceIn;
let newSelections: vscode.Selection[] = [];
editor.selections.forEach(selection => {
const range = rangeFn(document, rootNode, selection);
newSelections.push(range);
let newSelections: readonly vscode.Selection[] = editor.selections.map(selection => {
return rangeFn(document, rootNode, selection);
});
// check whether we are starting a balance elsewhere
@ -122,7 +120,7 @@ function getRangeToBalanceIn(document: vscode.TextDocument, rootNode: HtmlFlatNo
return offsetRangeToSelection(document, firstChild.start, firstChild.end);
}
function areSameSelections(a: vscode.Selection[], b: vscode.Selection[]): boolean {
function areSameSelections(a: readonly vscode.Selection[], b: readonly vscode.Selection[]): boolean {
if (a.length !== b.length) {
return false;
}

View file

@ -21,7 +21,7 @@ export function mergeLines() {
}
return editor.edit(editBuilder => {
editor.selections.reverse().forEach(selection => {
Array.from(editor.selections).reverse().forEach(selection => {
const textEdit = getRangesToReplace(editor.document, selection, rootNode);
if (textEdit) {
editBuilder.replace(textEdit.range, textEdit.newText);

View file

@ -19,7 +19,7 @@ export function removeTag() {
return;
}
let finalRangesToRemove = editor.selections.reverse()
let finalRangesToRemove = Array.from(editor.selections).reverse()
.reduce<vscode.Range[]>((prev, selection) =>
prev.concat(getRangesToRemove(editor.document, rootNode, selection)), []);

View file

@ -21,7 +21,7 @@ export function splitJoinTag() {
}
return editor.edit(editBuilder => {
editor.selections.reverse().forEach(selection => {
Array.from(editor.selections).reverse().forEach(selection => {
const documentText = document.getText();
const offset = document.offsetAt(selection.start);
const nodeToUpdate = getHtmlFlatNode(documentText, rootNode, offset, true);

View file

@ -28,7 +28,7 @@ export function toggleComment(): Thenable<boolean> | undefined {
return editor.edit(editBuilder => {
let allEdits: vscode.TextEdit[][] = [];
editor.selections.reverse().forEach(selection => {
Array.from(editor.selections).reverse().forEach(selection => {
const edits = isStyleSheet(editor.document.languageId) ? toggleCommentStylesheet(editor.document, selection, <Stylesheet>rootNode) : toggleCommentHTML(editor.document, selection, rootNode!);
if (edits.length > 0) {
allEdits.push(edits);

View file

@ -3,5 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -23,7 +23,7 @@ export function updateImageSize(): Promise<boolean> | undefined {
}
const editor = window.activeTextEditor;
const allUpdatesPromise = editor.selections.reverse().map(selection => {
const allUpdatesPromise = Array.from(editor.selections).reverse().map(selection => {
const position = selection.isReversed ? selection.active : selection.anchor;
if (!isStyleSheet(editor.document.languageId)) {
return updateImageSizeHTML(editor, position);

View file

@ -25,7 +25,7 @@ export async function updateTag(tagName: string | undefined): Promise<boolean |
return;
}
const rangesToUpdate = editor.selections.reverse()
const rangesToUpdate = Array.from(editor.selections).reverse()
.reduce<TagRange[]>((prev, selection) =>
prev.concat(getRangesToUpdate(document, selection, rootNode)), []);
if (!rangesToUpdate.length) {

View file

@ -8,6 +8,7 @@
".vscode-test"
],
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,6 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>

View file

@ -7,6 +7,7 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -8,9 +8,3 @@ var updateGrammar = require('vscode-grammar-updater');
updateGrammar.update('textmate/git.tmbundle', 'Syntaxes/Git%20Commit%20Message.tmLanguage', './syntaxes/git-commit.tmLanguage.json');
updateGrammar.update('textmate/git.tmbundle', 'Syntaxes/Git%20Rebase%20Message.tmLanguage', './syntaxes/git-rebase.tmLanguage.json');
updateGrammar.update('textmate/diff.tmbundle', 'Syntaxes/Diff.plist', './syntaxes/diff.tmLanguage.json');

View file

@ -33,34 +33,7 @@
],
"license": "MIT",
"version": "0.0.0"
},
{
"component": {
"type": "git",
"git": {
"name": "textmate/diff.tmbundle",
"repositoryUrl": "https://github.com/textmate/diff.tmbundle",
"commitHash": "0593bb775eab1824af97ef2172fd38822abd97d7"
}
},
"licenseDetail": [
"Copyright (c) textmate-diff.tmbundle project authors",
"",
"If not otherwise specified (see below), files in this repository fall under the following license:",
"",
"Permission to copy, use, modify, sell and distribute this",
"software is granted. This software is provided \"as is\" without",
"express or implied warranty, and with no claim as to its",
"suitability for any purpose.",
"",
"An exception is made for files in readable text which contain their own license information,",
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
],
"license": "TextMate Bundle License",
"version": "0.0.0"
}
],
"version": 1
}
}

View file

@ -9,7 +9,14 @@
"vscode": "^1.5.0"
},
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"enableProposedApi": true,
"enabledApiProposals": [
"diffCommand",
"contribViewsWelcome",
"scmActionButton",
"scmSelectedProvider",
"scmValidation",
"timeline"
],
"categories": [
"Other"
],
@ -2314,19 +2321,6 @@
],
"configuration": "./languages/git-rebase.language-configuration.json"
},
{
"id": "diff",
"aliases": [
"Diff",
"diff"
],
"extensions": [
".diff",
".patch",
".rej"
],
"configuration": "./languages/diff.language-configuration.json"
},
{
"id": "ignore",
"aliases": [
@ -2351,11 +2345,6 @@
"scopeName": "text.git-rebase",
"path": "./syntaxes/git-rebase.tmLanguage.json"
},
{
"language": "diff",
"scopeName": "source.diff",
"path": "./syntaxes/diff.tmLanguage.json"
},
{
"language": "ignore",
"scopeName": "source.ignore",

View file

@ -1,5 +1,5 @@
#!/bin/sh
VSCODE_GIT_ASKPASS_PIPE=`mktemp`
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_MAIN" $*
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_MAIN" $VSCODE_GIT_ASKPASS_EXTRA_ARGS $*
cat $VSCODE_GIT_ASKPASS_PIPE
rm $VSCODE_GIT_ASKPASS_PIPE

View file

@ -83,6 +83,7 @@ export class Askpass implements IIPCHandler {
...this.ipc.getEnv(),
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
VSCODE_GIT_ASKPASS_NODE: process.execPath,
VSCODE_GIT_ASKPASS_EXTRA_ARGS: (process.versions['electron'] && process.versions['microsoft-build']) ? '--ms-enable-electron-run-as-node' : '',
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
};
}

View file

@ -49,7 +49,7 @@ export function applyLineChanges(original: TextDocument, modified: TextDocument,
return result.join('');
}
export function toLineRanges(selections: Selection[], textDocument: TextDocument): Range[] {
export function toLineRanges(selections: readonly Selection[], textDocument: TextDocument): Range[] {
const lineRanges = selections.map(s => {
const startLine = textDocument.lineAt(s.start.line);
const endLine = textDocument.lineAt(s.end.line);

View file

@ -56,7 +56,9 @@ suite('git smoke test', function () {
git = ext!.exports.getAPI(1);
if (git.repositories.length === 0) {
await eventToPromise(git.onDidOpenRepository);
const onDidOpenRepository = eventToPromise(git.onDidOpenRepository);
await commands.executeCommand('git.openRepository', cwd);
await onDidOpenRepository;
}
assert.strictEqual(git.repositories.length, 1);

View file

@ -1,8 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
/// <reference path="../../../types/lib.textEncoder.d.ts" />

View file

@ -8,6 +8,13 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.diffCommand.d.ts",
"../../src/vscode-dts/vscode.proposed.scmActionButton.d.ts",
"../../src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts",
"../../src/vscode-dts/vscode.proposed.scmValidation.d.ts",
"../../src/vscode-dts/vscode.proposed.timeline.d.ts",
"../types/lib.textEncoder.d.ts"
]
}

View file

@ -9,7 +9,6 @@
"vscode": "^1.41.0"
},
"icon": "images/icon.png",
"enableProposedApi": true,
"categories": [
"Other"
],

View file

@ -8,6 +8,7 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -31,11 +31,11 @@ asynckit@^0.4.0:
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
axios@^0.21.1:
version "0.21.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
dependencies:
follow-redirects "^1.10.0"
follow-redirects "^1.14.0"
combined-stream@^1.0.8:
version "1.0.8"
@ -49,10 +49,10 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
follow-redirects@^1.10.0:
version "1.13.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267"
integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==
follow-redirects@^1.14.0:
version "1.14.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==
form-data@^3.0.0:
version "3.0.0"

View file

@ -9,7 +9,6 @@
"vscode": "^1.41.0"
},
"icon": "images/icon.png",
"enableProposedApi": true,
"categories": [
"Other"
],

View file

@ -3,7 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
declare module 'tunnel';

View file

@ -8,6 +8,7 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
/// <reference path="../../../../../src/vs/vscode.proposed.d.ts" />

View file

@ -4,6 +4,7 @@
"outDir": "./out"
},
"include": [
"src/**/*"
"src/**/*",
"../../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,5 +1,4 @@
{
"enableProposedApi": true,
"name": "html-language-features",
"displayName": "%displayName%",
"description": "%description%",

View file

@ -22,7 +22,7 @@
"html.format.wrapAttributes.preservealigned": "Preserve wrapping of attributes but align.",
"html.format.templating.desc": "Honor django, erb, handlebars and php templating language tags.",
"html.format.unformattedContentDelimiter.desc": "Keep text content together between this string.",
"html.format.wrapAttributesIndentSize.desc": "Alignment size when using 'force aligned' and 'aligned multiple' in `#html.format.wrapAttributes#` or `null` to use the default indent size.",
"html.format.wrapAttributesIndentSize.desc": "Indent wrapped attributes to after N characters. Use `null` to use the default indent size. Ignored if `#html.format.wrapAttributes#` is set to 'aligned'.",
"html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.",
"html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.",
"html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.",

View file

@ -9,7 +9,6 @@
"version": "1.0.0",
"publisher": "vscode",
"icon": "icon.png",
"enableProposedApi": true,
"license": "MIT",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"engines": {

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>

View file

@ -5,6 +5,7 @@
"types": []
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -8,7 +8,10 @@
"engines": {
"vscode": "^1.57.0"
},
"enableProposedApi": true,
"enabledApiProposals": [
"notebookEditor",
"notebookEditorEdit"
],
"activationEvents": [
"onNotebook:jupyter-notebook"
],
@ -36,16 +39,16 @@
]
}
],
"grammars": [
{
"language": "jupyter",
"scopeName": "source.jupyter",
"path": "./syntaxes/jupyter.tmLanguage.json",
"embeddedLanguages": {
"source.json": "json"
}
}
],
"grammars": [
{
"language": "jupyter",
"scopeName": "source.jupyter",
"path": "./syntaxes/jupyter.tmLanguage.json",
"embeddedLanguages": {
"source.json": "json"
}
}
],
"notebooks": [
{
"type": "jupyter-notebook",
@ -59,10 +62,10 @@
}
]
},
"scripts": {
"compile": "npx gulp compile-extension:ipynb",
"watch": "npx gulp watch-extension:ipynb"
},
"scripts": {
"compile": "npx gulp compile-extension:ipynb",
"watch": "npx gulp watch-extension:ipynb"
},
"dependencies": {
"@enonic/fnv-plus": "^1.3.0",
"detect-indent": "^6.0.0",
@ -72,8 +75,8 @@
"@jupyterlab/coreutils": "^3.1.0",
"@types/uuid": "^8.3.1"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/vscode.git"
}
"repository": {
"type": "git",
"url": "https://github.com/microsoft/vscode.git"
}
}

View file

@ -3,8 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../src/vs/vscode.proposed.d.ts'/>
declare module '@enonic/fnv-plus';

View file

@ -7,6 +7,9 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.notebookEditor.d.ts",
"../../src/vscode-dts/vscode.proposed.notebookEditorEdit.d.ts",
]
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
/// <reference path="../../../../../src/vs/vscode.proposed.d.ts" />

View file

@ -4,6 +4,7 @@
"outDir": "./out"
},
"include": [
"src/**/*"
"src/**/*",
"../../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -16,7 +16,6 @@
],
"main": "./client/out/node/jsonClientMain",
"browser": "./client/dist/browser/jsonClientMain",
"enableProposedApi": true,
"capabilities": {
"virtualWorkspaces": true,
"untrustedWorkspaces": {

View file

@ -29,10 +29,6 @@ export const activate: ActivationFunction<void> = (ctx) => {
const style = document.createElement('style');
style.textContent = `
#preview {
font-size: 1.1em;
}
.emptyMarkdownCell::before {
content: "${document.documentElement.style.getPropertyValue('--notebook-cell-markup-empty-content')}";
font-style: italic;
@ -165,7 +161,6 @@ export const activate: ActivationFunction<void> = (ctx) => {
pre code {
font-family: var(--vscode-editor-font-family);
font-size: var(--vscode-editor-font-size);
line-height: 1.357em;
white-space: pre-wrap;

View file

@ -5,7 +5,6 @@
"version": "1.0.0",
"icon": "icon.png",
"publisher": "vscode",
"enableProposedApi": true,
"license": "MIT",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"engines": {

View file

@ -134,6 +134,7 @@ window.addEventListener('message', async event => {
root.replaceWith(newContent.querySelector('.markdown-body')!);
documentResource = event.data.source;
} else {
// Compare two elements but skip `data-line`
const areEqual = (a: Element, b: Element): boolean => {
if (a.isEqualNode(b)) {
return true;
@ -143,6 +144,23 @@ window.addEventListener('message', async event => {
return false;
}
const aAttrs = a.attributes;
const bAttrs = b.attributes;
if (aAttrs.length !== bAttrs.length) {
return false;
}
for (let i = 0; i < aAttrs.length; ++i) {
const aAttr = aAttrs[i];
const bAttr = bAttrs[i];
if (aAttr.name !== bAttr.name) {
return false;
}
if (aAttr.value !== bAttr.value && aAttr.name !== 'data-line') {
return false;
}
}
const aChildren = Array.from(a.children);
const bChildren = Array.from(b.children);

View file

@ -120,6 +120,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
private imageInfo: { readonly id: string, readonly width: number, readonly height: number; }[] = [];
private readonly _fileWatchersBySrc = new Map</* src: */ string, vscode.FileSystemWatcher>();
private readonly _onScrollEmitter = this._register(new vscode.EventEmitter<LastScrollLocation>());
public readonly onScroll = this._onScrollEmitter.event;
@ -262,13 +263,13 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
* The first call immediately refreshes the preview,
* calls happening shortly thereafter are debounced.
*/
public refresh() {
public refresh(forceUpdate: boolean = false) {
// Schedule update if none is pending
if (!this.throttleTimer) {
if (this.firstUpdate) {
this.updatePreview(true);
} else {
this.throttleTimer = setTimeout(() => this.updatePreview(true), this.delay);
this.throttleTimer = setTimeout(() => this.updatePreview(forceUpdate), this.delay);
}
}
@ -333,7 +334,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
return;
}
const shouldReloadPage = !this.currentVersion || this.currentVersion.resource.toString() !== pendingVersion.resource.toString();
const shouldReloadPage = forceUpdate || !this.currentVersion || this.currentVersion.resource.toString() !== pendingVersion.resource.toString();
this.currentVersion = pendingVersion;
const content = await (shouldReloadPage
@ -429,7 +430,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
if (uri && uri.scheme === 'file' && !this._fileWatchersBySrc.has(src)) {
const watcher = vscode.workspace.createFileSystemWatcher(uri.fsPath);
watcher.onDidChange(() => {
this.refresh();
this.refresh(true);
});
this._fileWatchersBySrc.set(src, watcher);
}

View file

@ -15,7 +15,10 @@ function workspaceFile(...segments: string[]) {
}
async function getLinksForFile(file: vscode.Uri): Promise<vscode.DocumentLink[]> {
return (await vscode.commands.executeCommand<vscode.DocumentLink[]>('vscode.executeLinkProvider', file))!;
console.log('getting links', file.toString(), Date.now());
const r = (await vscode.commands.executeCommand<vscode.DocumentLink[]>('vscode.executeLinkProvider', file))!;
console.log('got links', file.toString(), Date.now());
return r;
}
suite('Markdown Document links', () => {
@ -94,7 +97,6 @@ suite('Markdown Document links', () => {
assert.strictEqual(vscode.window.activeTextEditor!.selection.start.line, 1);
});
test('Should navigate to line number within non-md file', async () => {
await withFileContents(testFileA, '[b](sub/foo.txt#L3)');
@ -147,15 +149,21 @@ function assertActiveDocumentUri(expectedUri: vscode.Uri) {
}
async function withFileContents(file: vscode.Uri, contents: string): Promise<void> {
console.log('openTextDocument', file.toString(), Date.now());
const document = await vscode.workspace.openTextDocument(file);
console.log('showTextDocument', file.toString(), Date.now());
const editor = await vscode.window.showTextDocument(document);
console.log('editTextDocument', file.toString(), Date.now());
await editor.edit(edit => {
edit.replace(new vscode.Range(0, 0, 1000, 0), contents);
});
console.log('opened done', vscode.window.activeTextEditor?.document.toString(), Date.now());
}
async function executeLink(link: vscode.DocumentLink) {
console.log('executeingLink', link.target?.toString(), Date.now());
const args = JSON.parse(decodeURIComponent(link.target!.query));
await vscode.commands.executeCommand(link.target!.path, args);
console.log('executedLink', vscode.window.activeTextEditor?.document.toString(), Date.now());
}

View file

@ -3,7 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
declare module 'markdown-it-front-matter';

View file

@ -4,6 +4,7 @@
"outDir": "./out"
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,5 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../src/vs/vscode.d.ts'/>

View file

@ -5,6 +5,7 @@
"types": []
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -12,7 +12,6 @@
"categories": [
"Other"
],
"enableProposedApi": true,
"activationEvents": [
"onAuthenticationRequest:microsoft"
],

View file

@ -45,6 +45,7 @@ interface ITokenClaims {
tid: string;
email?: string;
unique_name?: string;
exp?: number;
preferred_username?: string;
oid?: string;
altsecid?: string;
@ -182,6 +183,7 @@ export class AzureActiveDirectoryService {
};
});
Logger.trace('storing data into keychain...');
await this._keychain.setToken(JSON.stringify(serializedData));
}
@ -240,6 +242,7 @@ export class AzureActiveDirectoryService {
}
if (added.length || removed.length) {
Logger.info(`Sending change event with ${added.length} added and ${removed.length} removed`);
onDidChangeSessions.fire({ added: added, removed: removed, changed: [] });
}
}
@ -380,7 +383,7 @@ export class AzureActiveDirectoryService {
throw codeRes.err;
}
token = await this.exchangeCodeForToken(codeRes.code, codeVerifier, scope);
this.setToken(token, scope);
await this.setToken(token, scope);
Logger.info(`Login successful for scopes: ${scope}`);
res.writeHead(302, { Location: '/' });
const session = await this.convertToSession(token);
@ -491,7 +494,7 @@ export class AzureActiveDirectoryService {
}
const token = await this.exchangeCodeForToken(code, verifier, scope);
this.setToken(token, scope);
await this.setToken(token, scope);
const session = await this.convertToSession(token);
resolve(session);
@ -509,6 +512,7 @@ export class AzureActiveDirectoryService {
}
private async setToken(token: IToken, scope: string): Promise<void> {
Logger.info(`Setting token for scopes: ${scope}`);
const existingTokenIndex = this._tokens.findIndex(t => t.sessionId === token.sessionId);
if (existingTokenIndex > -1) {
this._tokens.splice(existingTokenIndex, 1, token);
@ -522,6 +526,7 @@ export class AzureActiveDirectoryService {
this._refreshTimeouts.set(token.sessionId, setTimeout(async () => {
try {
const refreshedToken = await this.refreshToken(token.refreshToken, scope, token.sessionId);
Logger.info('Triggering change session event...');
onDidChangeSessions.fire({ added: [], removed: [], changed: [this.convertToSessionSync(refreshedToken)] });
} catch (e) {
if (e.message === REFRESH_NETWORK_FAILURE) {
@ -534,10 +539,11 @@ export class AzureActiveDirectoryService {
onDidChangeSessions.fire({ added: [], removed: [this.convertToSessionSync(token)], changed: [] });
}
}
}, 1000 * (token.expiresIn - 30)));
// For details on why this is set to 2/3... see https://github.com/microsoft/vscode/issues/133201#issuecomment-966668197
}, 1000 * (token.expiresIn * 2 / 3)));
}
this.storeTokenData();
await this.storeTokenData();
}
private getTokenFromResponse(json: ITokenResponse, scope: string, existingId?: string): IToken {
@ -649,7 +655,7 @@ export class AzureActiveDirectoryService {
if (result.ok) {
const json = await result.json();
const token = this.getTokenFromResponse(json, scope, sessionId);
this.setToken(token, scope);
await this.setToken(token, scope);
Logger.info(`Token refresh success for scopes: ${token.scope}`);
return token;
} else {

View file

@ -1,7 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>

View file

@ -17,6 +17,7 @@
"node_modules"
],
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -8,7 +8,6 @@
"engines": {
"vscode": "0.10.x"
},
"enableProposedApi": true,
"icon": "images/npm_icon.png",
"categories": [
"Other"
@ -73,7 +72,8 @@
"name": "%view.name%",
"when": "npm:showScriptExplorer",
"icon": "$(json)",
"visibility": "hidden"
"visibility": "hidden",
"contextualTitle": "%view.name%"
}
]
},

View file

@ -76,9 +76,14 @@ type ExplorerCommands = 'open' | 'run';
class NpmScript extends TreeItem {
task: Task;
package: PackageJSON;
taskLocation?: Location;
constructor(_context: ExtensionContext, packageJson: PackageJSON, task: Task, public taskLocation?: Location) {
super(task.name, TreeItemCollapsibleState.None);
constructor(_context: ExtensionContext, packageJson: PackageJSON, task: TaskWithLocation) {
const name = packageJson.path.length > 0
? task.task.name.substring(0, task.task.name.length - packageJson.path.length - 2)
: task.task.name;
super(name, TreeItemCollapsibleState.None);
this.taskLocation = task.location;
const command: ExplorerCommands = workspace.getConfiguration('npm').get<ExplorerCommands>('scriptExplorerAction') || 'open';
const commandList = {
@ -86,9 +91,9 @@ class NpmScript extends TreeItem {
title: 'Edit Script',
command: 'vscode.open',
arguments: [
taskLocation?.uri,
taskLocation ? <TextDocumentShowOptions>{
selection: new Range(taskLocation.range.start, taskLocation.range.start)
this.taskLocation?.uri,
this.taskLocation ? <TextDocumentShowOptions>{
selection: new Range(this.taskLocation.range.start, this.taskLocation.range.start)
} : undefined
]
},
@ -100,16 +105,17 @@ class NpmScript extends TreeItem {
};
this.contextValue = 'script';
this.package = packageJson;
this.task = task;
this.task = task.task;
this.command = commandList[command];
if (task.group && task.group === TaskGroup.Clean) {
if (this.task.group && this.task.group === TaskGroup.Clean) {
this.iconPath = new ThemeIcon('wrench-subaction');
} else {
this.iconPath = new ThemeIcon('wrench');
}
if (task.detail) {
this.tooltip = task.detail;
if (this.task.detail) {
this.tooltip = this.task.detail;
this.description = this.task.detail;
}
}
@ -301,7 +307,7 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider<TreeItem> {
folder.addPackage(packageJson);
packages.set(fullPath, packageJson);
}
let script = new NpmScript(this.extensionContext, packageJson, each.task, each.location);
let script = new NpmScript(this.extensionContext, packageJson, each);
packageJson.addScript(script);
}
});

View file

@ -1,8 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
/// <reference types='@types/node'/>

View file

@ -1,9 +1,13 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"types": [
"node"
]
},
"include": [
"src/**/*"
"src/**/*",
"../../src/vscode-dts/vscode.d.ts"
]
}

View file

@ -9,7 +9,6 @@
"engines": {
"vscode": "0.10.x"
},
"enableProposedApi": true,
"activationEvents": [
"onLanguage:php"
],

View file

@ -1,8 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>

Some files were not shown because too many files have changed in this diff Show more