Merge branch 'main' into notebook/dev

This commit is contained in:
Johannes Rieken 2021-04-13 09:17:03 +02:00
commit 0788b3fd68
No known key found for this signature in database
GPG key ID: 96634B5AF12F8798
194 changed files with 3669 additions and 1577 deletions

15
.vscode/tasks.json vendored
View file

@ -210,6 +210,21 @@
"group": "build",
"label": "npm: tsec-compile-check",
"detail": "node_modules/tsec/bin/tsec -p src/tsconfig.json --noEmit"
},
{
"type": "npm",
"script": "no-implicit-override-watch",
"problemMatcher": [
{
"base": "$tsc-watch",
"applyTo": "allDocuments",
"owner": "tsc-no-imp"
}
],
"group": "build",
"label": "npm: no-implicit-override-watch",
"detail": "tsc --watch -p src/tsconfig.json --noEmit --noImplicitOverride",
"isBackground": true
}
]
}

View file

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

View file

@ -1884,10 +1884,10 @@ typescript@^4.1.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7"
integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==
typescript@^4.3.0-dev.20210407:
version "4.3.0-dev.20210407"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.0-dev.20210407.tgz#9a64dab0cd55c3baaee9a08d5eba5b6d2bee586c"
integrity sha512-zblU754+4x72OX0sWijDz/XmW6K4rgJ5DDYxLfrySU8QJWXR4i6VRgkBP03Jq1EjUfOR6cYsRXl5/wU0LNrhpA==
typescript@^4.3.0-dev.20210412:
version "4.3.0-dev.20210412"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.0-dev.20210412.tgz#985af41fcbe9d6bf9c4132e3209b7905b5af4281"
integrity sha512-jAoT9A85ujmykZTKSQ7WLJ7aItFTXrmt+FWPl3xgvfrtM26ZAqvfYXVm2XjSFOwSzMptS+7D1Afxj/fynTOhEQ==
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.5"

View file

@ -1,5 +1,5 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"resolveJsonModule": true,
"outDir": "./out"

View file

@ -22,6 +22,9 @@
"jsonc-parser": "^2.2.1",
"vscode-nls": "^4.1.1"
},
"workspaceTrust": {
"request": "never"
},
"contributes": {
"languages": [
{

View file

@ -33,3 +33,28 @@ export function provideInstalledExtensionProposals(existing: string[], additiona
return undefined;
}
export function provideWorkspaceTrustExtensionProposals(existing: string[], range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[] | vscode.CompletionList> {
if (Array.isArray(existing)) {
const extensions = vscode.extensions.all.filter(e => e.packageJSON.main);
const extensionProposals = extensions.filter(e => existing.indexOf(e.id) === -1);
if (extensionProposals.length) {
return extensionProposals.map(e => {
const item = new vscode.CompletionItem(e.id);
const insertText = `"${e.id}": {\n\t"request": "onStart",\n\t"version": "${e.packageJSON.version}"\n}`;
item.kind = vscode.CompletionItemKind.Value;
item.insertText = insertText;
item.range = range;
item.filterText = insertText;
return item;
});
} else {
const example = new vscode.CompletionItem(localize('exampleExtension', "Example"));
example.insertText = '"vscode.csharp: {\n\t"request": "onStart",\n\t"version": "0.0.0"\n}`;"';
example.kind = vscode.CompletionItemKind.Value;
example.range = range;
return [example];
}
}
return undefined;
}

View file

@ -6,7 +6,7 @@
import * as vscode from 'vscode';
import { getLocation, Location, parse } from 'jsonc-parser';
import * as nls from 'vscode-nls';
import { provideInstalledExtensionProposals } from './extensionsProposals';
import { provideInstalledExtensionProposals, provideWorkspaceTrustExtensionProposals } from './extensionsProposals';
const localize = nls.loadMessageBundle();
@ -60,6 +60,15 @@ export class SettingsDocument {
return provideInstalledExtensionProposals(alreadyConfigured, `: [\n\t"ui"\n]`, range, true);
}
// security.workspace.trust.extensionRequest
if (location.path[0] === 'security.workspace.trust.extensionRequest' && location.path.length === 2 && location.isAtPropertyKey) {
let alreadyConfigured: string[] = [];
try {
alreadyConfigured = Object.keys(parse(this.document.getText())['security.workspace.trust.extensionRequest']);
} catch (e) {/* ignore error */ }
return provideWorkspaceTrustExtensionProposals(alreadyConfigured, range);
}
return this.provideLanguageOverridesCompletionItems(location, position);
}

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"downlevelIteration": true
@ -7,4 +7,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"downlevelIteration": true
@ -7,4 +7,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
@ -10,4 +10,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"typeRoots": [
@ -9,4 +9,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true,
@ -10,4 +10,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true,
@ -10,4 +10,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true,

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true,

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"sourceMap": true,
@ -8,4 +8,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist/",
"jsx": "react",

View file

@ -41,7 +41,7 @@ window.onload = () => {
function doAfterImagesLoaded(cb: () => void) {
const imgElements = document.getElementsByTagName('img');
if (imgElements.length > 0) {
const ps = Array.from(imgElements).map(e => {
const ps = Array.from(imgElements, e => {
if (e.complete) {
return Promise.resolve();
} else {

View file

@ -1,5 +1,5 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist/",
"jsx": "react",

View file

@ -134,7 +134,7 @@ export default class MarkdownWorkspaceSymbolProvider extends Disposable implemen
this._workspaceMarkdownDocumentProvider.onDidDeleteMarkdownDocument(this.onDidDeleteDocument, this, this._disposables);
}
const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values()).map(x => x.value));
const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values(), x => x.value));
const allSymbols = allSymbolsSets.flat();
return allSymbols.filter(symbolInformation => symbolInformation.name.toLowerCase().indexOf(query.toLowerCase()) !== -1);
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true,
@ -14,4 +14,4 @@
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist/",
"jsx": "react",

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
},

View file

@ -1,5 +1,5 @@
{
"extends": "../../shared.tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist/",
"jsx": "react",

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
},

View file

@ -10,7 +10,7 @@
"selection.background": "#008000",
"editor.selectionBackground": "#FFFFFF",
"statusBarItem.remoteBackground": "#00000000",
"ports.iconRunningProcessforeground": "#FFFFFF",
"ports.iconRunningProcessforeground": "#FFFFFF"
},
"tokenColors": [
{

View file

@ -6,7 +6,7 @@
"git": {
"name": "seti-ui",
"repositoryUrl": "https://github.com/jesseweed/seti-ui",
"commitHash": "1a26ac62b6396c4273522cfb63e90059f52fe93b"
"commitHash": "894c49fa9f5ce43dd4f012173a7bb107346e524e"
}
},
"version": "0.1.0"

View file

@ -1030,447 +1030,455 @@
"fontCharacter": "\\E06E",
"fontColor": "#a074c4"
},
"_plan_light": {
"_pipeline_light": {
"fontCharacter": "\\E06F",
"fontColor": "#cc6d2e"
},
"_pipeline": {
"fontCharacter": "\\E06F",
"fontColor": "#e37933"
},
"_plan_light": {
"fontCharacter": "\\E070",
"fontColor": "#7fae42"
},
"_plan": {
"fontCharacter": "\\E06F",
"fontCharacter": "\\E070",
"fontColor": "#8dc149"
},
"_platformio_light": {
"fontCharacter": "\\E070",
"fontCharacter": "\\E071",
"fontColor": "#cc6d2e"
},
"_platformio": {
"fontCharacter": "\\E070",
"fontCharacter": "\\E071",
"fontColor": "#e37933"
},
"_powershell_light": {
"fontCharacter": "\\E071",
"fontCharacter": "\\E072",
"fontColor": "#498ba7"
},
"_powershell": {
"fontCharacter": "\\E071",
"fontCharacter": "\\E072",
"fontColor": "#519aba"
},
"_prisma_light": {
"fontCharacter": "\\E072",
"fontCharacter": "\\E073",
"fontColor": "#498ba7"
},
"_prisma": {
"fontCharacter": "\\E072",
"fontCharacter": "\\E073",
"fontColor": "#519aba"
},
"_prolog_light": {
"fontCharacter": "\\E074",
"fontCharacter": "\\E075",
"fontColor": "#cc6d2e"
},
"_prolog": {
"fontCharacter": "\\E074",
"fontCharacter": "\\E075",
"fontColor": "#e37933"
},
"_pug_light": {
"fontCharacter": "\\E075",
"fontCharacter": "\\E076",
"fontColor": "#b8383d"
},
"_pug": {
"fontCharacter": "\\E075",
"fontCharacter": "\\E076",
"fontColor": "#cc3e44"
},
"_puppet_light": {
"fontCharacter": "\\E076",
"fontCharacter": "\\E077",
"fontColor": "#b7b73b"
},
"_puppet": {
"fontCharacter": "\\E076",
"fontCharacter": "\\E077",
"fontColor": "#cbcb41"
},
"_python_light": {
"fontCharacter": "\\E077",
"fontCharacter": "\\E078",
"fontColor": "#498ba7"
},
"_python": {
"fontCharacter": "\\E077",
"fontCharacter": "\\E078",
"fontColor": "#519aba"
},
"_react_light": {
"fontCharacter": "\\E079",
"fontCharacter": "\\E07A",
"fontColor": "#498ba7"
},
"_react": {
"fontCharacter": "\\E079",
"fontCharacter": "\\E07A",
"fontColor": "#519aba"
},
"_react_1_light": {
"fontCharacter": "\\E079",
"fontCharacter": "\\E07A",
"fontColor": "#cc6d2e"
},
"_react_1": {
"fontCharacter": "\\E079",
"fontCharacter": "\\E07A",
"fontColor": "#e37933"
},
"_react_2_light": {
"fontCharacter": "\\E079",
"fontCharacter": "\\E07A",
"fontColor": "#b7b73b"
},
"_react_2": {
"fontCharacter": "\\E079",
"fontCharacter": "\\E07A",
"fontColor": "#cbcb41"
},
"_reasonml_light": {
"fontCharacter": "\\E07A",
"fontCharacter": "\\E07B",
"fontColor": "#b8383d"
},
"_reasonml": {
"fontCharacter": "\\E07A",
"fontCharacter": "\\E07B",
"fontColor": "#cc3e44"
},
"_rollup_light": {
"fontCharacter": "\\E07B",
"fontCharacter": "\\E07C",
"fontColor": "#b8383d"
},
"_rollup": {
"fontCharacter": "\\E07B",
"fontCharacter": "\\E07C",
"fontColor": "#cc3e44"
},
"_ruby_light": {
"fontCharacter": "\\E07C",
"fontCharacter": "\\E07D",
"fontColor": "#b8383d"
},
"_ruby": {
"fontCharacter": "\\E07C",
"fontCharacter": "\\E07D",
"fontColor": "#cc3e44"
},
"_rust_light": {
"fontCharacter": "\\E07D",
"fontCharacter": "\\E07E",
"fontColor": "#627379"
},
"_rust": {
"fontCharacter": "\\E07D",
"fontCharacter": "\\E07E",
"fontColor": "#6d8086"
},
"_salesforce_light": {
"fontCharacter": "\\E07E",
"fontCharacter": "\\E07F",
"fontColor": "#498ba7"
},
"_salesforce": {
"fontCharacter": "\\E07E",
"fontCharacter": "\\E07F",
"fontColor": "#519aba"
},
"_sass_light": {
"fontCharacter": "\\E07F",
"fontCharacter": "\\E080",
"fontColor": "#dd4b78"
},
"_sass": {
"fontCharacter": "\\E07F",
"fontCharacter": "\\E080",
"fontColor": "#f55385"
},
"_sbt_light": {
"fontCharacter": "\\E080",
"fontCharacter": "\\E081",
"fontColor": "#498ba7"
},
"_sbt": {
"fontCharacter": "\\E080",
"fontCharacter": "\\E081",
"fontColor": "#519aba"
},
"_scala_light": {
"fontCharacter": "\\E081",
"fontCharacter": "\\E082",
"fontColor": "#b8383d"
},
"_scala": {
"fontCharacter": "\\E081",
"fontCharacter": "\\E082",
"fontColor": "#cc3e44"
},
"_shell_light": {
"fontCharacter": "\\E084",
"fontCharacter": "\\E085",
"fontColor": "#455155"
},
"_shell": {
"fontCharacter": "\\E084",
"fontCharacter": "\\E085",
"fontColor": "#4d5a5e"
},
"_slim_light": {
"fontCharacter": "\\E085",
"fontCharacter": "\\E086",
"fontColor": "#cc6d2e"
},
"_slim": {
"fontCharacter": "\\E085",
"fontCharacter": "\\E086",
"fontColor": "#e37933"
},
"_smarty_light": {
"fontCharacter": "\\E086",
"fontCharacter": "\\E087",
"fontColor": "#b7b73b"
},
"_smarty": {
"fontCharacter": "\\E086",
"fontCharacter": "\\E087",
"fontColor": "#cbcb41"
},
"_spring_light": {
"fontCharacter": "\\E087",
"fontCharacter": "\\E088",
"fontColor": "#7fae42"
},
"_spring": {
"fontCharacter": "\\E087",
"fontCharacter": "\\E088",
"fontColor": "#8dc149"
},
"_stylelint_light": {
"fontCharacter": "\\E088",
"fontCharacter": "\\E089",
"fontColor": "#bfc2c1"
},
"_stylelint": {
"fontCharacter": "\\E088",
"fontCharacter": "\\E089",
"fontColor": "#d4d7d6"
},
"_stylelint_1_light": {
"fontCharacter": "\\E088",
"fontCharacter": "\\E089",
"fontColor": "#455155"
},
"_stylelint_1": {
"fontCharacter": "\\E088",
"fontCharacter": "\\E089",
"fontColor": "#4d5a5e"
},
"_stylus_light": {
"fontCharacter": "\\E089",
"fontCharacter": "\\E08A",
"fontColor": "#7fae42"
},
"_stylus": {
"fontCharacter": "\\E089",
"fontCharacter": "\\E08A",
"fontColor": "#8dc149"
},
"_sublime_light": {
"fontCharacter": "\\E08A",
"fontCharacter": "\\E08B",
"fontColor": "#cc6d2e"
},
"_sublime": {
"fontCharacter": "\\E08A",
"fontCharacter": "\\E08B",
"fontColor": "#e37933"
},
"_svelte_light": {
"fontCharacter": "\\E08B",
"fontCharacter": "\\E08C",
"fontColor": "#b8383d"
},
"_svelte": {
"fontCharacter": "\\E08B",
"fontCharacter": "\\E08C",
"fontColor": "#cc3e44"
},
"_svg_light": {
"fontCharacter": "\\E08C",
"fontCharacter": "\\E08D",
"fontColor": "#9068b0"
},
"_svg": {
"fontCharacter": "\\E08C",
"fontCharacter": "\\E08D",
"fontColor": "#a074c4"
},
"_svg_1_light": {
"fontCharacter": "\\E08C",
"fontCharacter": "\\E08D",
"fontColor": "#498ba7"
},
"_svg_1": {
"fontCharacter": "\\E08C",
"fontCharacter": "\\E08D",
"fontColor": "#519aba"
},
"_swift_light": {
"fontCharacter": "\\E08D",
"fontCharacter": "\\E08E",
"fontColor": "#cc6d2e"
},
"_swift": {
"fontCharacter": "\\E08D",
"fontCharacter": "\\E08E",
"fontColor": "#e37933"
},
"_terraform_light": {
"fontCharacter": "\\E08E",
"fontCharacter": "\\E08F",
"fontColor": "#9068b0"
},
"_terraform": {
"fontCharacter": "\\E08E",
"fontCharacter": "\\E08F",
"fontColor": "#a074c4"
},
"_tex_light": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#498ba7"
},
"_tex": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#519aba"
},
"_tex_1_light": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#b7b73b"
},
"_tex_1": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#cbcb41"
},
"_tex_2_light": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#cc6d2e"
},
"_tex_2": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#e37933"
},
"_tex_3_light": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#bfc2c1"
},
"_tex_3": {
"fontCharacter": "\\E08F",
"fontCharacter": "\\E090",
"fontColor": "#d4d7d6"
},
"_todo": {
"fontCharacter": "\\E091"
"fontCharacter": "\\E092"
},
"_tsconfig_light": {
"fontCharacter": "\\E092",
"fontCharacter": "\\E093",
"fontColor": "#498ba7"
},
"_tsconfig": {
"fontCharacter": "\\E092",
"fontCharacter": "\\E093",
"fontColor": "#519aba"
},
"_twig_light": {
"fontCharacter": "\\E093",
"fontCharacter": "\\E094",
"fontColor": "#7fae42"
},
"_twig": {
"fontCharacter": "\\E093",
"fontCharacter": "\\E094",
"fontColor": "#8dc149"
},
"_typescript_light": {
"fontCharacter": "\\E094",
"fontCharacter": "\\E095",
"fontColor": "#498ba7"
},
"_typescript": {
"fontCharacter": "\\E094",
"fontCharacter": "\\E095",
"fontColor": "#519aba"
},
"_typescript_1_light": {
"fontCharacter": "\\E094",
"fontCharacter": "\\E095",
"fontColor": "#b7b73b"
},
"_typescript_1": {
"fontCharacter": "\\E094",
"fontCharacter": "\\E095",
"fontColor": "#cbcb41"
},
"_vala_light": {
"fontCharacter": "\\E095",
"fontCharacter": "\\E096",
"fontColor": "#627379"
},
"_vala": {
"fontCharacter": "\\E095",
"fontCharacter": "\\E096",
"fontColor": "#6d8086"
},
"_video_light": {
"fontCharacter": "\\E096",
"fontCharacter": "\\E097",
"fontColor": "#dd4b78"
},
"_video": {
"fontCharacter": "\\E096",
"fontCharacter": "\\E097",
"fontColor": "#f55385"
},
"_vue_light": {
"fontCharacter": "\\E097",
"fontCharacter": "\\E098",
"fontColor": "#7fae42"
},
"_vue": {
"fontCharacter": "\\E097",
"fontCharacter": "\\E098",
"fontColor": "#8dc149"
},
"_wasm_light": {
"fontCharacter": "\\E098",
"fontCharacter": "\\E099",
"fontColor": "#9068b0"
},
"_wasm": {
"fontCharacter": "\\E098",
"fontCharacter": "\\E099",
"fontColor": "#a074c4"
},
"_wat_light": {
"fontCharacter": "\\E099",
"fontCharacter": "\\E09A",
"fontColor": "#9068b0"
},
"_wat": {
"fontCharacter": "\\E099",
"fontCharacter": "\\E09A",
"fontColor": "#a074c4"
},
"_webpack_light": {
"fontCharacter": "\\E09A",
"fontCharacter": "\\E09B",
"fontColor": "#498ba7"
},
"_webpack": {
"fontCharacter": "\\E09A",
"fontCharacter": "\\E09B",
"fontColor": "#519aba"
},
"_wgt_light": {
"fontCharacter": "\\E09B",
"fontCharacter": "\\E09C",
"fontColor": "#498ba7"
},
"_wgt": {
"fontCharacter": "\\E09B",
"fontCharacter": "\\E09C",
"fontColor": "#519aba"
},
"_windows_light": {
"fontCharacter": "\\E09C",
"fontCharacter": "\\E09D",
"fontColor": "#498ba7"
},
"_windows": {
"fontCharacter": "\\E09C",
"fontCharacter": "\\E09D",
"fontColor": "#519aba"
},
"_word_light": {
"fontCharacter": "\\E09D",
"fontCharacter": "\\E09E",
"fontColor": "#498ba7"
},
"_word": {
"fontCharacter": "\\E09D",
"fontCharacter": "\\E09E",
"fontColor": "#519aba"
},
"_xls_light": {
"fontCharacter": "\\E09E",
"fontCharacter": "\\E09F",
"fontColor": "#7fae42"
},
"_xls": {
"fontCharacter": "\\E09E",
"fontCharacter": "\\E09F",
"fontColor": "#8dc149"
},
"_xml_light": {
"fontCharacter": "\\E09F",
"fontCharacter": "\\E0A0",
"fontColor": "#cc6d2e"
},
"_xml": {
"fontCharacter": "\\E09F",
"fontCharacter": "\\E0A0",
"fontColor": "#e37933"
},
"_yarn_light": {
"fontCharacter": "\\E0A0",
"fontCharacter": "\\E0A1",
"fontColor": "#498ba7"
},
"_yarn": {
"fontCharacter": "\\E0A0",
"fontCharacter": "\\E0A1",
"fontColor": "#519aba"
},
"_yml_light": {
"fontCharacter": "\\E0A1",
"fontCharacter": "\\E0A2",
"fontColor": "#9068b0"
},
"_yml": {
"fontCharacter": "\\E0A1",
"fontCharacter": "\\E0A2",
"fontColor": "#a074c4"
},
"_zip_light": {
"fontCharacter": "\\E0A2",
"fontCharacter": "\\E0A3",
"fontColor": "#b8383d"
},
"_zip": {
"fontCharacter": "\\E0A2",
"fontCharacter": "\\E0A3",
"fontColor": "#cc3e44"
},
"_zip_1_light": {
"fontCharacter": "\\E0A2",
"fontCharacter": "\\E0A3",
"fontColor": "#627379"
},
"_zip_1": {
"fontCharacter": "\\E0A2",
"fontCharacter": "\\E0A3",
"fontColor": "#6d8086"
}
},
@ -1508,7 +1516,6 @@
"csv": "_csv",
"xls": "_xls",
"xlsx": "_xls",
"cu": "_cu",
"cuh": "_cu_1",
"hu": "_cu_1",
"cake": "_cake",
@ -1582,6 +1589,7 @@
"cmxa": "_ocaml",
"odata": "_odata",
"php.inc": "_php",
"pipeline": "_pipeline",
"pddl": "_pddl",
"plan": "_plan",
"happenings": "_happenings",
@ -1761,6 +1769,7 @@
"jsonc": "_json",
"c": "_c",
"cpp": "_cpp",
"cuda-cpp": "_cu",
"csharp": "_c-sharp",
"css": "_css",
"dockerfile": "_docker",
@ -1860,7 +1869,6 @@
"csv": "_csv_light",
"xls": "_xls_light",
"xlsx": "_xls_light",
"cu": "_cu_light",
"cuh": "_cu_1_light",
"hu": "_cu_1_light",
"cake": "_cake_light",
@ -1934,6 +1942,7 @@
"cmxa": "_ocaml_light",
"odata": "_odata_light",
"php.inc": "_php_light",
"pipeline": "_pipeline_light",
"pddl": "_pddl_light",
"plan": "_plan_light",
"happenings": "_happenings_light",
@ -2054,6 +2063,7 @@
"jsonc": "_json_light",
"c": "_c_light",
"cpp": "_cpp_light",
"cuda-cpp": "_cu_light",
"csharp": "_c-sharp_light",
"css": "_css_light",
"dockerfile": "_docker_light",
@ -2176,5 +2186,5 @@
"npm-debug.log": "_npm_ignored_light"
}
},
"version": "https://github.com/jesseweed/seti-ui/commit/1a26ac62b6396c4273522cfb63e90059f52fe93b"
"version": "https://github.com/jesseweed/seti-ui/commit/894c49fa9f5ce43dd4f012173a7bb107346e524e"
}

View file

@ -9,6 +9,7 @@
"alwaysStrict": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"forceConsistentCasingInFileNames": true

View file

@ -73,7 +73,7 @@ export class ResourceMap<T> {
}
public get values(): Iterable<T> {
return Array.from(this._map.values()).map(x => x.value);
return Array.from(this._map.values(), x => x.value);
}
public get entries(): Iterable<{ resource: vscode.Uri, value: T }> {

View file

@ -1,5 +1,5 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out",
"experimentalDecorators": true,

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -43,17 +43,17 @@
],
"commands": [
{
"title": "New Window",
"title": "New TestResolver Window",
"category": "Remote-TestResolver",
"command": "vscode-testresolver.newWindow"
},
{
"title": "Show Log",
"title": "Show TestResolver Log",
"category": "Remote-TestResolver",
"command": "vscode-testresolver.showLog"
},
{
"title": "Kill Server and Trigger Handled Error",
"title": "Kill Remote Server and Trigger Handled Error",
"category": "Remote-TestResolver",
"command": "vscode-testresolver.killServerAndTriggerHandledError"
},

View file

@ -1,9 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}
}

View file

@ -81,7 +81,7 @@
"vscode-oniguruma": "1.3.1",
"vscode-proxy-agent": "^0.8.2",
"vscode-regexpp": "^3.1.0",
"vscode-ripgrep": "^1.11.1",
"vscode-ripgrep": "^1.11.3",
"vscode-sqlite3": "4.0.10",
"vscode-textmate": "5.2.0",
"xterm": "4.12.0-beta.20",
@ -192,7 +192,7 @@
"style-loader": "^1.0.0",
"ts-loader": "^6.2.1",
"tsec": "0.1.4",
"typescript": "^4.3.0-dev.20210407",
"typescript": "^4.3.0-dev.20210412",
"typescript-formatter": "7.1.0",
"underscore": "^1.8.2",
"vinyl": "^2.0.0",

View file

@ -20,7 +20,7 @@
"vscode-oniguruma": "1.3.1",
"vscode-proxy-agent": "^0.8.2",
"vscode-regexpp": "^3.1.0",
"vscode-ripgrep": "^1.11.1",
"vscode-ripgrep": "^1.11.3",
"vscode-textmate": "5.2.0",
"xterm": "4.12.0-beta.20",
"xterm-addon-search": "0.9.0-beta.1",

View file

@ -386,10 +386,10 @@ vscode-regexpp@^3.1.0:
resolved "https://registry.yarnpkg.com/vscode-regexpp/-/vscode-regexpp-3.1.0.tgz#42d059b6fffe99bd42939c0d013f632f0cad823f"
integrity sha512-pqtN65VC1jRLawfluX4Y80MMG0DHJydWhe5ZwMHewZD6sys4LbU6lHwFAHxeuaVE6Y6+xZOtAw+9hvq7/0ejkg==
vscode-ripgrep@^1.11.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.11.1.tgz#9fa3c0a96c2939d5a2389f71218bd1bb6eaa8679"
integrity sha512-oHJfpqeXuTQhOO+szqIObYOddwQ9o+lzd4PQLlTQN+sQ7ex8D1qqFip207O2iJyFc5oWE8Bekf4YHTibdbW66w==
vscode-ripgrep@^1.11.3:
version "1.11.3"
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.11.3.tgz#a997f4f4535dfeb9d775f04053c1247454d7a37a"
integrity sha512-fdD+BciXiEO1iWTrV/S3sAthlK/tHRBjHF+aJIZDxUMD/q9wpNq+YPFEiLCrW+8epahfR19241DeVHHgX/I4Ww==
dependencies:
https-proxy-agent "^4.0.0"
proxy-from-env "^1.1.0"

View file

@ -261,6 +261,9 @@ const requestHandler = (req, res) => {
} else if (pathname === '/fetch-callback') {
// callback fetch support
return handleFetchCallback(req, res, parsedUrl);
} else if (pathname === '/builtin') {
// builtin extnesions JSON
return handleBuiltInExtensions(req, res, parsedUrl);
}
return serveError(req, res, 404, 'Not found.');
@ -303,6 +306,17 @@ function addCORSReplyHeader(req) {
return (ALLOWED_CORS_ORIGINS.indexOf(req.headers['origin']) >= 0);
}
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res
* @param {import('url').UrlWithParsedQuery} parsedUrl
*/
async function handleBuiltInExtensions(req, res, parsedUrl) {
const { extensions } = await builtInExtensionsPromise;
res.writeHead(200, { 'Content-Type': 'application/json' });
return res.end(JSON.stringify(extensions));
}
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res

View file

@ -20,6 +20,11 @@ export type ConfigurationSyncStore = {
authenticationProviders: IStringDictionary<{ scopes: string[] }>
};
export type ExtensionWorkspaceTrustRequest = {
readonly default?: 'never' | 'onStart' | 'onDemand',
readonly override?: 'never' | 'onStart' | 'onDemand'
};
export interface IProductConfiguration {
readonly version: string;
readonly date?: string;
@ -116,6 +121,7 @@ export interface IProductConfiguration {
readonly extensionKind?: { readonly [extensionId: string]: ('ui' | 'workspace' | 'web')[]; };
readonly extensionSyncedKeys?: { readonly [extensionId: string]: string[]; };
readonly extensionAllowedProposedApi?: readonly string[];
readonly extensionWorkspaceTrustRequest?: { readonly [extensionId: string]: ExtensionWorkspaceTrustRequest };
readonly msftInternalDomains?: string[];
readonly linkProtectionTrustedDomains?: readonly string[];

View file

@ -625,6 +625,15 @@ export function toStream<T>(t: T, reducer: IReducer<T>): ReadableStream<T> {
return stream;
}
/**
* Helper
*/
export function emptyStream(): ReadableStream<never> {
const stream = newWriteableStream<never>(() => { throw new Error('not supported'); });
stream.end();
return stream;
}
/**
* Helper to convert a T into a Readable<T>.
*/

View file

@ -0,0 +1,84 @@
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<script>
performance.mark('code/didStartRenderer')
</script>
<meta charset="utf-8" />
<!-- Disable pinch zooming -->
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<!-- Workbench Configuration -->
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
<!-- Workbench Auth Session -->
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
<!-- Builtin Extensions (running out of sources) -->
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
<!-- Workbench Icon/Manifest/CSS -->
<link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/favicon.ico" type="image/x-icon" />
<link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/manifest.json">
<link data-name="vs/workbench/workbench.web.api" rel="stylesheet"
href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.css">
</head>
<body aria-label="">
</body>
<!-- Startup (do not modify order of script tags!) -->
<script>
var baseUrl = '{{WORKBENCH_WEB_BASE_URL}}';
self.require = {
baseUrl: `${baseUrl}/out`,
recordStats: true,
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
createScriptURL(value) {
if (value.startsWith(baseUrl)) {
return value;
}
throw new Error(`Invalid script url: ${value}`)
}
}),
paths: {
'vscode-textmate': `${baseUrl}/node_modules/vscode-textmate/release/main`,
'vscode-oniguruma': `${baseUrl}/node_modules/vscode-oniguruma/release/main`,
'xterm': `${baseUrl}/node_modules/xterm/lib/xterm.js`,
'xterm-addon-search': `${baseUrl}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
'xterm-addon-unicode11': `${baseUrl}/node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`,
'xterm-addon-webgl': `${baseUrl}/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`,
'tas-client-umd': `${baseUrl}/node_modules/tas-client-umd/lib/tas-client-umd.js`,
'iconv-lite-umd': `${baseUrl}/node_modules/iconv-lite-umd/lib/iconv-lite-umd.js`,
'jschardet': `${baseUrl}/node_modules/jschardet/dist/jschardet.min.js`,
}
};
</script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
<script>
performance.mark('code/willLoadWorkbenchMain');
function injectScript(src) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = src;
script.addEventListener('load', resolve);
script.addEventListener('error', e => reject(e.error));
document.head.appendChild(script);
});
}
</script>
<script>
const workbench = document.createElement('script');
workbench.innerText = "require(['vs/code/browser/workbench/workbench'], function() {});";
document.body.appendChild(workbench);
</script>
</html>

View file

@ -1,80 +1,79 @@
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<script>
performance.mark('code/didStartRenderer')
</script>
<meta charset="utf-8" />
<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<!-- Workbench Configuration -->
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
<!-- Workbench Auth Session -->
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
<!-- Workbench Icon/Manifest/CSS -->
<link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/favicon.ico" type="image/x-icon" />
<link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/manifest.json">
<link data-name="vs/workbench/workbench.web.api" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.css">
</head>
<body aria-label="">
</body>
<!-- Startup (do not modify order of script tags!) -->
<head>
<script>
var baseUrl = '{{WORKBENCH_WEB_BASE_URL}}';
self.require = {
baseUrl: `${baseUrl}/out`,
recordStats: true,
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
createScriptURL(value) {
if(value.startsWith(baseUrl)) {
return value;
}
throw new Error(`Invalid script url: ${value}`)
performance.mark('code/didStartRenderer')
</script>
<meta charset="utf-8" />
<!-- Disable pinch zooming -->
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<!-- Workbench Configuration -->
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
<!-- Workbench Auth Session -->
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
<!-- Workbench Icon/Manifest/CSS -->
<link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/favicon.ico" type="image/x-icon" />
<link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/manifest.json">
<link data-name="vs/workbench/workbench.web.api" rel="stylesheet"
href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.css">
</head>
<body aria-label="">
</body>
<!-- Startup (do not modify order of script tags!) -->
<script>
var baseUrl = '{{WORKBENCH_WEB_BASE_URL}}';
self.require = {
baseUrl: `${baseUrl}/out`,
recordStats: true,
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
createScriptURL(value) {
if (value.startsWith(baseUrl)) {
return value;
}
}),
paths: {
'vscode-textmate': `${baseUrl}/node_modules/vscode-textmate/release/main`,
'vscode-oniguruma': `${baseUrl}/node_modules/vscode-oniguruma/release/main`,
'xterm': `${baseUrl}/node_modules/xterm/lib/xterm.js`,
'xterm-addon-search': `${baseUrl}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
'xterm-addon-unicode11': `${baseUrl}/node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`,
'xterm-addon-webgl': `${baseUrl}/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`,
'tas-client-umd': `${baseUrl}/node_modules/tas-client-umd/lib/tas-client-umd.js`,
'iconv-lite-umd': `${baseUrl}/node_modules/iconv-lite-umd/lib/iconv-lite-umd.js`,
'jschardet': `${baseUrl}/node_modules/jschardet/dist/jschardet.min.js`,
throw new Error(`Invalid script url: ${value}`)
}
};
</script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
<script>
performance.mark('code/willLoadWorkbenchMain');
</script>
<script>
if ("{{WORKBENCH_DEV}}" === "true") {
const workbench = document.createElement('script');
workbench.innerText = "require(['vs/code/browser/workbench/workbench'], function() {});";
document.body.appendChild(workbench);
} else {
const nls = document.createElement('script');
nls.setAttribute('src', '{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.nls.js');
document.body.appendChild(nls);
const api = document.createElement('script');
api.setAttribute('src', '{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.js');
document.body.appendChild(api);
const workbench = document.createElement('script');
workbench.setAttribute('src', '{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.js');
document.body.appendChild(workbench);
}),
paths: {
'vscode-textmate': `${baseUrl}/node_modules/vscode-textmate/release/main`,
'vscode-oniguruma': `${baseUrl}/node_modules/vscode-oniguruma/release/main`,
'xterm': `${baseUrl}/node_modules/xterm/lib/xterm.js`,
'xterm-addon-search': `${baseUrl}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
'xterm-addon-unicode11': `${baseUrl}/node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`,
'xterm-addon-webgl': `${baseUrl}/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`,
'tas-client-umd': `${baseUrl}/node_modules/tas-client-umd/lib/tas-client-umd.js`,
'iconv-lite-umd': `${baseUrl}/node_modules/iconv-lite-umd/lib/iconv-lite-umd.js`,
'jschardet': `${baseUrl}/node_modules/jschardet/dist/jschardet.min.js`,
}
</script>
};
</script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
<script>
performance.mark('code/willLoadWorkbenchMain');
function injectScript(src) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = src;
script.addEventListener('load', resolve);
script.addEventListener('error', e => reject(e.error));
document.head.appendChild(script);
});
}
</script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.nls.js"></script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.api.js"></script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.js"></script>
</html>

View file

@ -132,7 +132,7 @@ export class TextAreaHandler extends ViewPart {
this.textArea.setAttribute('aria-haspopup', 'false');
this.textArea.setAttribute('aria-autocomplete', 'both');
if (options.get(EditorOption.domReadOnly)) {
if (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) {
this.textArea.setAttribute('readonly', 'true');
}
@ -440,8 +440,8 @@ export class TextAreaHandler extends ViewPart {
this.textArea.setAttribute('aria-label', this._getAriaLabel(options));
this.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex)));
if (e.hasChanged(EditorOption.domReadOnly)) {
if (options.get(EditorOption.domReadOnly)) {
if (e.hasChanged(EditorOption.domReadOnly) || e.hasChanged(EditorOption.readOnly)) {
if (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) {
this.textArea.setAttribute('readonly', 'true');
} else {
this.textArea.removeAttribute('readonly');

View file

@ -93,7 +93,7 @@ export class EditorStateCancellationTokenSource extends EditorKeybindingCancella
private readonly _listener = new DisposableStore();
constructor(readonly editor: IActiveCodeEditor, flags: CodeEditorStateFlag, range?: IRange, parent?: CancellationToken) {
constructor(editor: IActiveCodeEditor, flags: CodeEditorStateFlag, range?: IRange, parent?: CancellationToken) {
super(editor, parent);
if (flags & CodeEditorStateFlag.Position) {

View file

@ -343,7 +343,7 @@ export class ConfigurationModelParser {
const scope = propertySchema ? typeof propertySchema.scope !== 'undefined' ? propertySchema.scope : ConfigurationScope.WINDOW : undefined;
// Load unregistered configurations always.
if (scope === undefined || options.scopes === undefined || options.scopes.includes(scope)) {
if (options.isUntrusted && propertySchema?.requireTrustedTarget) {
if (options.isUntrusted && propertySchema?.requireTrust) {
untrusted.push(key);
} else {
raw[key] = properties[key];
@ -822,7 +822,9 @@ export class ConfigurationChangeEvent implements IConfigurationChangeEvent {
}
export class AllKeysConfigurationChangeEvent extends ConfigurationChangeEvent {
constructor(configuration: Configuration, workspace: Workspace, public source: ConfigurationTarget, public sourceConfig: any) {
constructor(configuration: Configuration, workspace: Workspace, source: ConfigurationTarget, sourceConfig: any) {
super({ keys: configuration.allKeys(), overrides: [] }, undefined, configuration, workspace);
this.source = source;
this.sourceConfig = sourceConfig;
}
}

View file

@ -110,7 +110,7 @@ export const enum ConfigurationScope {
export interface IConfigurationPropertySchema extends IJSONSchema {
scope?: ConfigurationScope;
requireTrustedTarget?: boolean;
requireTrust?: boolean;
included?: boolean;
tags?: string[];
/**
@ -126,6 +126,7 @@ export interface IConfigurationPropertySchema extends IJSONSchema {
export interface IConfigurationExtensionInfo {
id: string;
requireTrustForConfigurations?: string[];
}
export interface IConfigurationNode {
@ -140,14 +141,12 @@ export interface IConfigurationNode {
extensionInfo?: IConfigurationExtensionInfo;
}
type SettingProperties = { [key: string]: any };
export const allSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
export const applicationSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
export const machineSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
export const machineOverridableSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
export const windowSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
export const resourceSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
export const allSettings: { properties: IStringDictionary<IConfigurationPropertySchema>, patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };
export const applicationSettings: { properties: IStringDictionary<IConfigurationPropertySchema>, patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };
export const machineSettings: { properties: IStringDictionary<IConfigurationPropertySchema>, patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };
export const machineOverridableSettings: { properties: IStringDictionary<IConfigurationPropertySchema>, patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };
export const windowSettings: { properties: IStringDictionary<IConfigurationPropertySchema>, patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };
export const resourceSettings: { properties: IStringDictionary<IConfigurationPropertySchema>, patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };
export const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage';
@ -191,7 +190,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
public registerConfigurations(configurations: IConfigurationNode[], validate: boolean = true): void {
const properties: string[] = [];
configurations.forEach(configuration => {
properties.push(...this.validateAndRegisterProperties(configuration, validate)); // fills in defaults
properties.push(...this.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo)); // fills in defaults
this.configurationContributors.push(configuration);
this.registerJSONConfiguration(configuration);
});
@ -298,7 +297,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
this.updateOverridePropertyPatternKey();
}
private validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, scope: ConfigurationScope = ConfigurationScope.WINDOW): string[] {
private validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, extensionInfo?: IConfigurationExtensionInfo, scope: ConfigurationScope = ConfigurationScope.WINDOW): string[] {
scope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;
let propertyKeys: string[] = [];
let properties = configuration.properties;
@ -319,7 +318,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
property.scope = undefined; // No scope for overridable properties `[${identifier}]`
} else {
property.scope = types.isUndefinedOrNull(property.scope) ? scope : property.scope;
property.requireTrustedTarget = types.isUndefinedOrNull(property.requireTrustedTarget) ? false : property.requireTrustedTarget;
property.requireTrust = types.isUndefinedOrNull(property.requireTrust) ? !!extensionInfo?.requireTrustForConfigurations?.includes(key) : property.requireTrust;
}
// Add to properties maps
@ -343,7 +342,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
let subNodes = configuration.allOf;
if (subNodes) {
for (let node of subNodes) {
propertyKeys.push(...this.validateAndRegisterProperties(node, validate, scope));
propertyKeys.push(...this.validateAndRegisterProperties(node, validate, extensionInfo, scope));
}
}
return propertyKeys;

View file

@ -339,7 +339,7 @@ export class ContextKeyDefinedExpr implements IContextKeyExpression {
public readonly type = ContextKeyExprType.Defined;
protected constructor(protected readonly key: string) {
protected constructor(readonly key: string) {
}
public cmp(other: ContextKeyExpression): number {
@ -1273,7 +1273,7 @@ export class RawContextKey<T> extends ContextKeyDefinedExpr {
private readonly _defaultValue: T | undefined;
constructor(readonly key: string, defaultValue: T | undefined, metaOrHide?: string | true | { type: string, description: string }) {
constructor(key: string, defaultValue: T | undefined, metaOrHide?: string | true | { type: string, description: string }) {
super(key);
this._defaultValue = defaultValue;

View file

@ -100,6 +100,7 @@ export interface IPickAndOpenOptions {
defaultUri?: URI;
telemetryExtraData?: ITelemetryData;
availableFileSystems?: string[];
remoteAuthority?: string | null;
}
export interface ISaveDialogOptions {

View file

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import { spawn } from 'child_process';
import { generateUuid } from 'vs/base/common/uuid';
import { IProcessEnvironment, isWindows, platform } from 'vs/base/common/platform';
@ -75,15 +76,23 @@ async function doResolveUnixShellEnv(logService: ILogService): Promise<typeof pr
ELECTRON_NO_ATTACH_CONSOLE: '1'
};
const command = `'${process.execPath}' -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
logService.trace('getUnixShellEnvironment#env', env);
const systemShellUnix = await getSystemShell(platform, env);
logService.trace('getUnixShellEnvironment#shell', systemShellUnix);
const args = ['-ilc', command];
logService.trace('getUnixShellEnvironment#spawn', systemShellUnix, args);
const child = spawn(systemShellUnix, args, {
let command = `'${process.execPath}' -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
let shellArgs = ['-ilc'];
// handle popular non-POSIX shells
const name = path.basename(systemShellUnix);
if (/^pwsh(-preview)?$/.test(name)) {
command = `& ${command}`;
shellArgs = ['-Login', '-Command'];
}
logService.trace('getUnixShellEnvironment#spawn', JSON.stringify(shellArgs), command);
const child = spawn(systemShellUnix, [...shellArgs, command], {
detached: true,
stdio: ['ignore', 'pipe', 'pipe'],
env

View file

@ -19,8 +19,10 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import { mock } from 'vs/base/test/common/mock';
class EnvironmentServiceMock extends mock<IEnvironmentService>() {
constructor(readonly serviceMachineIdResource: URI) {
override readonly serviceMachineIdResource: URI;
constructor(serviceMachineIdResource: URI) {
super();
this.serviceMachineIdResource = serviceMachineIdResource;
}
}

View file

@ -159,7 +159,7 @@ export interface IExtensionContributions {
export type ExtensionKind = 'ui' | 'workspace' | 'web';
export type ExtensionWorkspaceTrustRequestType = 'never' | 'onStart' | 'onDemand';
export type ExtensionWorkspaceTrust = { request: 'never'; } | { request: 'onStart' | 'onDemand', description: string };
export type ExtensionWorkspaceTrust = { request: 'never'; } | { request: 'onStart', description: string } | { request: 'onDemand', description: string, requiredForConfigurations?: string[] };
export function isIExtensionIdentifier(thing: any): thing is IExtensionIdentifier {
return thing
@ -307,18 +307,6 @@ export function isAuthenticaionProviderExtension(manifest: IExtensionManifest):
return manifest.contributes && manifest.contributes.authentication ? manifest.contributes.authentication.length > 0 : false;
}
export function getExtensionWorkspaceTrustRequestType(manifest: IExtensionManifest): ExtensionWorkspaceTrustRequestType {
if (manifest.workspaceTrust?.request !== undefined) {
return manifest.workspaceTrust.request;
}
if (!manifest.main) {
return 'never';
}
return 'onStart';
}
export interface IScannedExtension {
readonly identifier: IExtensionIdentifier;
readonly location: URI;

View file

@ -239,9 +239,9 @@ export interface IShellLaunchConfig {
initialText?: string;
/**
* Whether an extension is controlling the terminal via a `vscode.Pseudoterminal`.
* Custom PTY/pseudoterminal process to use.
*/
isExtensionCustomPtyTerminal?: boolean;
customPtyImplementation?: (terminalId: number, cols: number, rows: number) => ITerminalChildProcess;
/**
* A UUID generated by the extension host process for terminals created on the extension host process.

View file

@ -228,6 +228,7 @@ export const simpleCheckboxBorder = registerColor('checkbox.border', { dark: sel
export const buttonForeground = registerColor('button.foreground', { dark: Color.white, light: Color.white, hc: Color.white }, nls.localize('buttonForeground', "Button foreground color."));
export const buttonBackground = registerColor('button.background', { dark: '#0E639C', light: '#007ACC', hc: null }, nls.localize('buttonBackground', "Button background color."));
export const buttonHoverBackground = registerColor('button.hoverBackground', { dark: lighten(buttonBackground, 0.2), light: darken(buttonBackground, 0.2), hc: null }, nls.localize('buttonHoverBackground', "Button background color when hovering."));
export const buttonBorder = registerColor('button.border', { dark: contrastBorder, light: contrastBorder, hc: contrastBorder }, nls.localize('buttonBorder', "Button border color."));
export const buttonSecondaryForeground = registerColor('button.secondaryForeground', { dark: Color.white, light: Color.white, hc: Color.white }, nls.localize('buttonSecondaryForeground', "Secondary button foreground color."));
export const buttonSecondaryBackground = registerColor('button.secondaryBackground', { dark: '#3A3D41', light: '#5F6A79', hc: null }, nls.localize('buttonSecondaryBackground', "Secondary button background color."));

View file

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetBackground, editorWidgetBackground, treeIndentGuidesStroke, editorWidgetForeground, simpleCheckboxBackground, simpleCheckboxBorder, simpleCheckboxForeground, ColorValue, resolveColorValue, textLinkForeground, problemsWarningIconForeground, problemsErrorIconForeground, problemsInfoIconForeground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, listFocusOutline, listInactiveFocusOutline, tableColumnsBorder, quickInputListFocusBackground } from 'vs/platform/theme/common/colorRegistry';
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetBackground, editorWidgetBackground, treeIndentGuidesStroke, editorWidgetForeground, simpleCheckboxBackground, simpleCheckboxBorder, simpleCheckboxForeground, ColorValue, resolveColorValue, textLinkForeground, problemsWarningIconForeground, problemsErrorIconForeground, problemsInfoIconForeground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, listFocusOutline, listInactiveFocusOutline, tableColumnsBorder, quickInputListFocusBackground, buttonBorder } from 'vs/platform/theme/common/colorRegistry';
import { IDisposable } from 'vs/base/common/lifecycle';
import { Color } from 'vs/base/common/color';
import { IThemable, styleFn } from 'vs/base/common/styler';
@ -269,6 +269,7 @@ export interface IButtonStyleOverrides extends IStyleOverrides {
buttonSecondaryForeground?: ColorIdentifier;
buttonSecondaryBackground?: ColorIdentifier;
buttonSecondaryHoverBackground?: ColorIdentifier;
buttonBorder?: ColorIdentifier;
}
export function attachButtonStyler(widget: IThemable, themeService: IThemeService, style?: IButtonStyleOverrides): IDisposable {
@ -279,7 +280,7 @@ export function attachButtonStyler(widget: IThemable, themeService: IThemeServic
buttonSecondaryForeground: style?.buttonSecondaryForeground || buttonSecondaryForeground,
buttonSecondaryBackground: style?.buttonSecondaryBackground || buttonSecondaryBackground,
buttonSecondaryHoverBackground: style?.buttonSecondaryHoverBackground || buttonSecondaryHoverBackground,
buttonBorder: contrastBorder
buttonBorder: style?.buttonBorder || buttonBorder,
} as IButtonStyleOverrides, widget);
}
@ -377,7 +378,7 @@ export const defaultDialogStyles = <IDialogStyleOverrides>{
buttonForeground: buttonForeground,
buttonBackground: buttonBackground,
buttonHoverBackground: buttonHoverBackground,
buttonBorder: contrastBorder,
buttonBorder: buttonBorder,
checkboxBorder: simpleCheckboxBorder,
checkboxBackground: simpleCheckboxBackground,
checkboxForeground: simpleCheckboxForeground,

View file

@ -250,7 +250,7 @@ export class UserDataSyncError extends Error {
}
export class UserDataSyncStoreError extends UserDataSyncError {
constructor(message: string, readonly url: string, code: UserDataSyncErrorCode, readonly operationId: string | undefined) {
constructor(message: string, readonly url: string, code: UserDataSyncErrorCode, operationId: string | undefined) {
super(message, code, undefined, operationId);
}
}

View file

@ -2371,6 +2371,9 @@ declare module 'vscode' {
* Appends raw output from the test runner. On the user's request, the
* output will be displayed in a terminal. ANSI escape sequences,
* such as colors and text styles, are supported.
*
* @param output Output text to append
* @param associateTo Optionally, associate the given segment of output
*/
appendOutput(output: string): void;
}
@ -2599,6 +2602,11 @@ declare module 'vscode' {
*/
completedAt: number;
/**
* Optional raw output from the test run.
*/
output?: string;
/**
* List of test results. The items in this array are the items that
* were passed in the {@link test.runTests} method.

View file

@ -13,6 +13,7 @@ import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBu
import { ExtHostContext, ExtHostTerminalServiceShape, IExtHostContext, ITerminalDimensionsDto, MainContext, MainThreadTerminalServiceShape, TerminalIdentifier, TerminalLaunchConfig } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ITerminalExternalLinkProvider, ITerminalInstance, ITerminalInstanceService, ITerminalLink, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { TerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy';
import { IEnvironmentVariableService, ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
import { deserializeEnvironmentVariableCollection, serializeEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariableShared';
import { IAvailableProfilesRequest as IAvailableProfilesRequest, IDefaultShellAndArgsRequest, IStartExtensionTerminalRequest, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal';
@ -130,7 +131,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
env: launchConfig.env,
strictEnv: launchConfig.strictEnv,
hideFromUser: launchConfig.hideFromUser,
isExtensionCustomPtyTerminal: launchConfig.isExtensionCustomPtyTerminal,
customPtyImplementation: launchConfig.isExtensionCustomPtyTerminal
? (id, rows, cols) => new TerminalProcessExtHostProxy(id, cols, rows, this._terminalService)
: undefined,
extHostTerminalId: extHostTerminalId,
isFeatureTerminal: launchConfig.isFeatureTerminal,
isExtensionOwnedTerminal: launchConfig.isExtensionOwnedTerminal

View file

@ -3,8 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { bufferToStream, VSBuffer } from 'vs/base/common/buffer';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { emptyStream } from 'vs/base/common/stream';
import { isDefined } from 'vs/base/common/types';
import { URI, UriComponents } from 'vs/base/common/uri';
import { Range } from 'vs/editor/common/core/range';
@ -71,7 +73,15 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh
* @inheritdoc
*/
public $publishExtensionProvidedResults(results: ISerializedTestResults, persist: boolean): void {
this.resultService.push(new HydratedTestResult(results, persist));
this.resultService.push(new HydratedTestResult(
results,
() => Promise.resolve(
results.output
? bufferToStream(VSBuffer.fromString(results.output))
: emptyStream(),
),
persist,
));
}
/**
@ -84,6 +94,17 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh
}
}
/**
* @inheritdoc
*/
public $appendOutputToRun(runId: string, output: VSBuffer): void {
const r = this.resultService.getResult(runId);
if (r && r instanceof LiveTestResult) {
r.output.append(output);
}
}
/**
* @inheritdoc
*/

View file

@ -170,7 +170,7 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => {
validateProperties(configuration, extension);
configuration.id = node.id || extension.description.identifier.value;
configuration.extensionInfo = { id: extension.description.identifier.value };
configuration.extensionInfo = { id: extension.description.identifier.value, requireTrustForConfigurations: extension.description.workspaceTrust?.request === 'onDemand' ? extension.description.workspaceTrust?.requiredForConfigurations : undefined };
configuration.title = configuration.title || extension.description.displayName || extension.description.identifier.value;
configurations.push(configuration);
return configurations;

View file

@ -2004,6 +2004,7 @@ export interface MainThreadTestingShape {
$publishDiff(resource: ExtHostTestingResource, uri: UriComponents, diff: TestsDiff): void;
$updateTestStateInRun(runId: string, testId: string, state: TestResultState, duration?: number): void;
$appendTestMessageInRun(runId: string, testId: string, message: ITestMessage): void;
$appendOutputToRun(runId: string, output: VSBuffer): void;
$runTests(req: RunTestsRequest, token: CancellationToken): Promise<string>;
$publishExtensionProvidedResults(results: ISerializedTestResults, persist: boolean): void;
}

View file

@ -5,6 +5,7 @@
import { mapFind } from 'vs/base/common/arrays';
import { disposableTimeout } from 'vs/base/common/async';
import { VSBuffer } from 'vs/base/common/buffer';
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
import { Emitter } from 'vs/base/common/event';
import { once } from 'vs/base/common/functional';
@ -274,8 +275,8 @@ export class ExtHostTesting implements ExtHostTestingShape {
try {
await provider.runTests({
appendOutput() {
// todo
appendOutput: message => {
this.proxy.$appendOutputToRun(req.runId, VSBuffer.fromString(message));
},
appendMessage: (test, message) => {
if (!isExcluded(test)) {

View file

@ -1707,6 +1707,7 @@ export namespace TestResults {
const serialized: ISerializedTestResults = {
completedAt: results.completedAt,
id,
output: results.output,
items: [],
};

View file

@ -17,7 +17,7 @@ import { IQuickInputService, IPickOptions, IQuickPickItem } from 'vs/platform/qu
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
import { IFileDialogService, IPickAndOpenOptions } from 'vs/platform/dialogs/common/dialogs';
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { IOpenWindowOptions, IWindowOpenable } from 'vs/platform/windows/common/windows';
@ -130,21 +130,28 @@ interface IOpenFolderAPICommandOptions {
forceNewWindow?: boolean;
forceReuseWindow?: boolean;
noRecentEntry?: boolean;
forceLocalWindow?: boolean;
}
CommandsRegistry.registerCommand({
id: 'vscode.openFolder',
handler: (accessor: ServicesAccessor, uri?: URI, arg?: boolean | IOpenFolderAPICommandOptions) => {
const commandService = accessor.get(ICommandService);
// Be compatible to previous args by converting to options
if (typeof arg === 'boolean') {
arg = { forceNewWindow: arg };
}
// Without URI, ask to pick a folder or workpsace to open
// Without URI, ask to pick a folder or workspace to open
if (!uri) {
return commandService.executeCommand('_files.pickFolderAndOpen', { forceNewWindow: arg?.forceNewWindow });
const options: IPickAndOpenOptions = {
forceNewWindow: arg?.forceNewWindow
};
if (arg?.forceLocalWindow) {
options.remoteAuthority = null;
options.availableFileSystems = ['file'];
}
return commandService.executeCommand('_files.pickFolderAndOpen', options);
}
uri = URI.revive(uri);
@ -152,17 +159,28 @@ CommandsRegistry.registerCommand({
const options: IOpenWindowOptions = {
forceNewWindow: arg?.forceNewWindow,
forceReuseWindow: arg?.forceReuseWindow,
noRecentEntry: arg?.noRecentEntry
noRecentEntry: arg?.noRecentEntry,
remoteAuthority: arg?.forceLocalWindow ? null : undefined
};
const uriToOpen: IWindowOpenable = (hasWorkspaceFileExtension(uri) || uri.scheme === Schemas.untitled) ? { workspaceUri: uri } : { folderUri: uri };
return commandService.executeCommand('_files.windowOpen', [uriToOpen], options);
},
description: {
description: 'Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.',
args: [
{ name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder', constraint: (value: any) => value === undefined || value instanceof URI },
{ name: 'options', description: '(optional) Options. Object with the following properties: `forceNewWindow `: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `noRecentEntry`: Whether the opened URI will appear in the \'Open Recent\' list. Defaults to true. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.', constraint: (value: any) => value === undefined || typeof value === 'object' || typeof value === 'boolean' }
{
name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder',
constraint: (value: any) => value === undefined || value === null || value instanceof URI
},
{
name: 'options',
description: '(optional) Options. Object with the following properties: ' +
'`forceNewWindow`: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. ' +
'`forceReuseWindow`: Whether to force opening the folder/workspace in the same window. Defaults to false. ' +
'`noRecentEntry`: Whether the opened URI will appear in the \'Open Recent\' list. Defaults to false. ' +
'Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.',
constraint: (value: any) => value === undefined || typeof value === 'object' || typeof value === 'boolean'
}
]
}
});

View file

@ -76,10 +76,9 @@ export class RangeHighlightDecorations extends Disposable {
}
private getEditor(resourceRange: IRangeHighlightDecoration): ICodeEditor | undefined {
const activeEditor = this.editorService.activeEditor;
const resource = activeEditor?.resource;
if (resource && isEqual(resource, resourceRange.resource)) {
return this.editorService.activeTextEditorControl as ICodeEditor;
const resource = this.editorService.activeEditor?.resource;
if (resource && isEqual(resource, resourceRange.resource) && isCodeEditor(this.editorService.activeTextEditorControl)) {
return this.editorService.activeTextEditorControl;
}
return undefined;

View file

@ -161,7 +161,7 @@ class EditorRegistry implements IEditorRegistry {
if (descriptors.length > 0) {
// Ask the input for its preferred Editor
const preferredEditorId = input.getPreferredEditorId(descriptors.map(d => d.getId()));
const preferredEditorId = input.getPreferredEditorId(descriptors.map(descriptor => descriptor.getId()));
if (preferredEditorId) {
return this.getEditorById(preferredEditorId);
}

View file

@ -136,7 +136,7 @@ class UntitledTextEditorInputSerializer implements IEditorInputSerializer {
return undefined;
}
const untitledTextEditorInput = <UntitledTextEditorInput>editorInput;
const untitledTextEditorInput = editorInput as UntitledTextEditorInput;
let resource = untitledTextEditorInput.resource;
if (untitledTextEditorInput.model.hasAssociatedFilePath) {
@ -165,7 +165,7 @@ class UntitledTextEditorInputSerializer implements IEditorInputSerializer {
}
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledTextEditorInput {
return instantiationService.invokeFunction<UntitledTextEditorInput>(accessor => {
return instantiationService.invokeFunction(accessor => {
const deserialized: ISerializedUntitledTextEditorInput = JSON.parse(serializedEditorInput);
const resource = URI.revive(deserialized.resourceJSON);
const mode = deserialized.modeId;
@ -192,17 +192,17 @@ interface ISerializedSideBySideEditorInput {
export abstract class AbstractSideBySideEditorInputSerializer implements IEditorInputSerializer {
private getInputSerializers(secondaryId: string, primaryId: string): [IEditorInputSerializer | undefined, IEditorInputSerializer | undefined] {
private getInputSerializers(secondaryEditorInputTypeId: string, primaryEditorInputTypeId: string): [IEditorInputSerializer | undefined, IEditorInputSerializer | undefined] {
const registry = Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories);
return [registry.getEditorInputSerializer(secondaryId), registry.getEditorInputSerializer(primaryId)];
return [registry.getEditorInputSerializer(secondaryEditorInputTypeId), registry.getEditorInputSerializer(primaryEditorInputTypeId)];
}
canSerialize(editorInput: EditorInput): boolean {
const input = editorInput as SideBySideEditorInput | DiffEditorInput;
if (input.primary && input.secondary) {
const [secondaryInputSerializer, primaryInputSerializer] = this.getInputSerializers(input.secondary.getTypeId(), input.primary.getTypeId());
const [secondaryInputSerializer, primaryInputSerializer] = this.getInputSerializers(input.secondary.typeId, input.primary.typeId);
return !!(secondaryInputSerializer?.canSerialize(input.secondary) && primaryInputSerializer?.canSerialize(input.primary));
}
@ -214,7 +214,7 @@ export abstract class AbstractSideBySideEditorInputSerializer implements IEditor
const input = editorInput as SideBySideEditorInput | DiffEditorInput;
if (input.primary && input.secondary) {
const [secondaryInputSerializer, primaryInputSerializer] = this.getInputSerializers(input.secondary.getTypeId(), input.primary.getTypeId());
const [secondaryInputSerializer, primaryInputSerializer] = this.getInputSerializers(input.secondary.typeId, input.primary.typeId);
if (primaryInputSerializer && secondaryInputSerializer) {
const primarySerialized = primaryInputSerializer.serialize(input.primary);
const secondarySerialized = secondaryInputSerializer.serialize(input.secondary);
@ -225,8 +225,8 @@ export abstract class AbstractSideBySideEditorInputSerializer implements IEditor
description: input.getDescription(),
primarySerialized: primarySerialized,
secondarySerialized: secondarySerialized,
primaryTypeId: input.primary.getTypeId(),
secondaryTypeId: input.secondary.getTypeId()
primaryTypeId: input.primary.typeId,
secondaryTypeId: input.secondary.typeId
};
return JSON.stringify(serializedEditorInput);

View file

@ -487,8 +487,7 @@ function registerOpenEditorAPICommands(): void {
group = editorGroupsService.getGroup(viewColumnToEditorGroup(editorGroupsService, columnArg)) ?? editorGroupsService.activeGroup;
}
const input = editorService.createEditorInput({ resource: URI.revive(resource) });
return editorService.openEditor(input, { ...optionsArg, override: id }, group);
return editorService.openEditor({ resource: URI.revive(resource), options: { ...optionsArg, override: id } }, group);
});
}
@ -633,7 +632,7 @@ export function splitEditor(editorGroupService: IEditorGroupsService, direction:
}
// Copy the editor to the new group, else move the editor to the new group
if (editorToCopy && (editorToCopy as EditorInput).supportsSplitEditor()) {
if (editorToCopy && (editorToCopy as EditorInput).canSplit()) {
sourceGroup.copyEditor(editorToCopy, newGroup);
// Focus
newGroup.focus();

View file

@ -58,7 +58,7 @@ export class EditorControl extends Disposable {
// Editor pane
const descriptor = Registry.as<IEditorRegistry>(EditorExtensions.Editors).getEditor(editor);
if (!descriptor) {
throw new Error(`No editor descriptor found for input id ${editor.getTypeId()}`);
throw new Error(`No editor descriptor found for input id ${editor.typeId}`);
}
const editorPane = this.doShowEditorPane(descriptor);

View file

@ -363,7 +363,7 @@ class DropOverlay extends Themable {
}
private isCopyOperation(e: DragEvent, draggedEditor?: IEditorIdentifier): boolean {
if (draggedEditor?.editor instanceof EditorInput && !draggedEditor.editor.supportsSplitEditor()) {
if (draggedEditor?.editor instanceof EditorInput && !draggedEditor.editor.canSplit()) {
return false;
}

View file

@ -362,7 +362,7 @@ export class EditorsObserver extends Disposable {
let serializableEditorsOfGroup = mapGroupToSerializableEditorsOfGroup.get(group);
if (!serializableEditorsOfGroup) {
serializableEditorsOfGroup = group.getEditors(EditorsOrder.SEQUENTIAL).filter(editor => {
const editorSerializer = registry.getEditorInputSerializer(editor.getTypeId());
const editorSerializer = registry.getEditorInputSerializer(editor);
return editorSerializer?.canSerialize(editor);
});

View file

@ -80,6 +80,14 @@
display: block;
}
.monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .actions-container {
justify-content: flex-end;
}
.monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .action-item {
margin-right: 6px;
}
/* Editor */
.monaco-workbench .part.editor > .content .editor-group-container.empty > .editor-container {

View file

@ -8,7 +8,7 @@ import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { localize } from 'vs/nls';
import { DEFAULT_FONT_FAMILY } from 'vs/workbench/browser/style';
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { inputPlaceholderForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';
import { ChangeModeAction } from 'vs/workbench/browser/parts/editor/editorStatus';
import { ICommandService } from 'vs/platform/commands/common/commands';
@ -16,8 +16,6 @@ import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';
import { IEditorContribution } from 'vs/editor/common/editorCommon';
import { Schemas } from 'vs/base/common/network';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { FloatingClickWidget } from 'vs/workbench/browser/codeeditor';
import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService';
const $ = dom.$;
@ -28,16 +26,15 @@ export class UntitledHintContribution implements IEditorContribution {
private toDispose: IDisposable[];
private untitledHintContentWidget: UntitledHintContentWidget | undefined;
private button: FloatingClickWidget | undefined;
private experimentTreatment: 'text' | 'button' | 'hidden' | undefined;
private experimentTreatment: 'text' | 'hidden' | undefined;
constructor(
private editor: ICodeEditor,
@ICommandService private readonly commandService: ICommandService,
@IConfigurationService private readonly configurationService: IConfigurationService,
@IKeybindingService private readonly keybindingService: IKeybindingService,
@IThemeService private readonly themeService: IThemeService,
@ITASExperimentService private readonly experimentService: ITASExperimentService
) {
this.toDispose = [];
this.toDispose.push(this.editor.onDidChangeModel(() => this.update()));
@ -47,7 +44,7 @@ export class UntitledHintContribution implements IEditorContribution {
this.update();
}
}));
this.experimentService.getTreatment<'text' | 'button'>('untitledhint').then(treatment => {
this.experimentService.getTreatment<'text' | 'hidden'>('untitledhint').then(treatment => {
this.experimentTreatment = treatment;
this.update();
});
@ -55,25 +52,13 @@ export class UntitledHintContribution implements IEditorContribution {
private update(): void {
this.untitledHintContentWidget?.dispose();
this.button?.dispose();
const configValue = this.configurationService.getValue<'text' | 'button' | 'hidden' | 'default'>(untitledHintSetting);
const untitledHintMode = configValue === 'default' ? (this.experimentTreatment || 'hidden') : configValue;
const configValue = this.configurationService.getValue<'text' | 'hidden' | 'default'>(untitledHintSetting);
const untitledHintMode = configValue === 'default' ? (this.experimentTreatment || 'text') : configValue;
const model = this.editor.getModel();
if (model && model.uri.scheme === Schemas.untitled && model.getModeId() === PLAINTEXT_MODE_ID) {
if (untitledHintMode === 'text') {
this.untitledHintContentWidget = new UntitledHintContentWidget(this.editor, this.commandService, this.configurationService, this.keybindingService);
}
if (untitledHintMode === 'button') {
this.button = new FloatingClickWidget(this.editor, localize('selectALanguage', "Select a Language"), ChangeModeAction.ID, this.keybindingService, this.themeService);
this.toDispose.push(this.button.onClick(async () => {
// Need to focus editor before so current editor becomes active and the command is properly executed
this.editor.focus();
await this.commandService.executeCommand(ChangeModeAction.ID, { from: 'button' });
this.editor.focus();
}));
this.button.render();
}
if (model && model.uri.scheme === Schemas.untitled && model.getModeId() === PLAINTEXT_MODE_ID && untitledHintMode === 'text') {
this.untitledHintContentWidget = new UntitledHintContentWidget(this.editor, this.commandService, this.configurationService);
}
}
@ -94,7 +79,6 @@ class UntitledHintContentWidget implements IContentWidget {
private readonly editor: ICodeEditor,
private readonly commandService: ICommandService,
private readonly configurationService: IConfigurationService,
private readonly keybindingService: IKeybindingService
) {
this.toDispose = [];
this.toDispose.push(editor.onDidChangeModelContent(() => this.onDidChangeModelContent()));
@ -120,10 +104,7 @@ class UntitledHintContentWidget implements IContentWidget {
this.domNode.style.width = 'max-content';
const language = $('a.language-mode');
language.style.cursor = 'pointer';
const keybinding = this.keybindingService.lookupKeybinding(ChangeModeAction.ID);
const keybindingLabel = keybinding?.getLabel();
const keybindingWithBrackets = keybindingLabel ? `(${keybindingLabel})` : '';
language.innerText = localize('selectAlanguage', "Select a language {0}", keybindingWithBrackets);
language.innerText = localize('selectAlanguage', "Select a language");
this.domNode.appendChild(language);
const toGetStarted = $('span');
toGetStarted.innerText = localize('toGetStarted', " to get started. Start typing to dismiss, or ",);

View file

@ -88,7 +88,7 @@ import { isStandalone } from 'vs/base/browser/browser';
},
'workbench.editor.untitled.hint': {
'type': 'string',
'enum': ['text', 'button', 'hidden', 'default'],
'enum': ['text', 'hidden', 'default'],
'default': 'default',
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'untitledHint' }, "Controls if the untitled hint should be inline text in the editor or a floating button or hidden.")
},

View file

@ -218,17 +218,16 @@ export interface IEditorInputFactoryRegistry {
* An editor input serializer is capable of serializing and deserializing editor
* inputs from string data.
*
* @param editorInputId the identifier of the editor input
* @param editorInputTypeId the type identifier of the editor input
* @param serializer the editor input serializer for serialization/deserialization
*/
registerEditorInputSerializer<Services extends BrandedService[]>(editorInputId: string, ctor: { new(...Services: Services): IEditorInputSerializer }): IDisposable;
registerEditorInputSerializer<Services extends BrandedService[]>(editorInputTypeId: string, ctor: { new(...Services: Services): IEditorInputSerializer }): IDisposable;
/**
* Returns the editor input serializer for the given editor input.
*
* @param editorInputId the identifier of the editor input
*/
getEditorInputSerializer(editorInputId: string): IEditorInputSerializer | undefined;
getEditorInputSerializer(editorInput: IEditorInput): IEditorInputSerializer | undefined;
getEditorInputSerializer(editorInputTypeId: string): IEditorInputSerializer | undefined;
/**
* Starts the registry by providing the required services.
@ -388,6 +387,14 @@ export interface IEditorInput extends IDisposable {
*/
readonly onDidChangeLabel: Event<void>;
/**
* Unique type identifier for this inpput. Every editor input of the
* same class should share the same type identifier. The type identifier
* is used for example for serialising/deserialising editor inputs
* via the serialisers of the `IEditorInputFactoryRegistry`.
*/
readonly typeId: string;
/**
* Returns the optional associated resource of this input.
*
@ -401,11 +408,6 @@ export interface IEditorInput extends IDisposable {
*/
readonly resource: URI | undefined;
/**
* Unique type identifier for this inpput.
*/
getTypeId(): string;
/**
* Returns the display name of this input.
*/
@ -496,7 +498,7 @@ export interface IEditorInput extends IDisposable {
/**
* Subclasses can set this to false if it does not make sense to split the editor input.
*/
supportsSplitEditor(): boolean;
canSplit(): boolean;
/**
* Returns if the other object matches this input.
@ -526,12 +528,12 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
private disposed: boolean = false;
abstract get typeId(): string;
abstract get resource(): URI | undefined;
abstract getTypeId(): string;
getName(): string {
return `Editor ${this.getTypeId()}`;
return `Editor ${this.typeId}`;
}
getDescription(verbosity?: Verbosity): string | undefined {
@ -565,7 +567,7 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
"typeId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
return { typeId: this.getTypeId() };
return { typeId: this.typeId };
}
isReadonly(): boolean {
@ -602,7 +604,7 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
return undefined;
}
supportsSplitEditor(): boolean {
canSplit(): boolean {
return true;
}
@ -751,6 +753,10 @@ export class SideBySideEditorInput extends EditorInput {
static readonly ID: string = 'workbench.editorinputs.sidebysideEditorInput';
override get typeId(): string {
return SideBySideEditorInput.ID;
}
constructor(
protected readonly name: string | undefined,
protected readonly description: string | undefined,
@ -800,10 +806,6 @@ export class SideBySideEditorInput extends EditorInput {
return this._secondary;
}
getTypeId(): string {
return SideBySideEditorInput.ID;
}
override getName(): string {
if (!this.name) {
return localize('sideBySideLabels', "{0} - {1}", this._secondary.getName(), this._primary.getName());
@ -1473,25 +1475,29 @@ class EditorInputFactoryRegistry implements IEditorInputFactoryRegistry {
private fileEditorInputFactory: IFileEditorInputFactory | undefined;
private readonly customEditorInputFactoryInstances: Map<string, ICustomEditorInputFactory> = new Map();
private readonly editorInputSerializerConstructors: Map<string, IConstructorSignature0<IEditorInputSerializer>> = new Map();
private readonly editorInputSerializerInstances: Map<string, IEditorInputSerializer> = new Map();
private readonly editorInputSerializerConstructors: Map<string /* Type ID */, IConstructorSignature0<IEditorInputSerializer>> = new Map();
private readonly editorInputSerializerInstances: Map<string /* Type ID */, IEditorInputSerializer> = new Map();
start(accessor: ServicesAccessor): void {
const instantiationService = this.instantiationService = accessor.get(IInstantiationService);
this.editorInputSerializerConstructors.forEach((ctor, key) => {
for (const [key, ctor] of this.editorInputSerializerConstructors) {
this.createEditorInputSerializer(key, ctor, instantiationService);
});
}
this.editorInputSerializerConstructors.clear();
}
private createEditorInputSerializer(editorInputId: string, ctor: IConstructorSignature0<IEditorInputSerializer>, instantiationService: IInstantiationService): void {
private createEditorInputSerializer(editorInputTypeId: string, ctor: IConstructorSignature0<IEditorInputSerializer>, instantiationService: IInstantiationService): void {
const instance = instantiationService.createInstance(ctor);
this.editorInputSerializerInstances.set(editorInputId, instance);
this.editorInputSerializerInstances.set(editorInputTypeId, instance);
}
registerFileEditorInputFactory(factory: IFileEditorInputFactory): void {
if (this.fileEditorInputFactory) {
throw new Error('Can only register one file editor input factory.');
}
this.fileEditorInputFactory = factory;
}
@ -1499,6 +1505,29 @@ class EditorInputFactoryRegistry implements IEditorInputFactoryRegistry {
return assertIsDefined(this.fileEditorInputFactory);
}
registerEditorInputSerializer(editorInputTypeId: string, ctor: IConstructorSignature0<IEditorInputSerializer>): IDisposable {
if (this.editorInputSerializerConstructors.has(editorInputTypeId) || this.editorInputSerializerInstances.has(editorInputTypeId)) {
throw new Error(`A editor input serializer with type ID '${editorInputTypeId}' was already registered.`);
}
if (!this.instantiationService) {
this.editorInputSerializerConstructors.set(editorInputTypeId, ctor);
} else {
this.createEditorInputSerializer(editorInputTypeId, ctor, this.instantiationService);
}
return toDisposable(() => {
this.editorInputSerializerConstructors.delete(editorInputTypeId);
this.editorInputSerializerInstances.delete(editorInputTypeId);
});
}
getEditorInputSerializer(editorInput: IEditorInput): IEditorInputSerializer | undefined;
getEditorInputSerializer(editorInputTypeId: string): IEditorInputSerializer | undefined;
getEditorInputSerializer(arg1: string | IEditorInput): IEditorInputSerializer | undefined {
return this.editorInputSerializerInstances.get(typeof arg1 === 'string' ? arg1 : arg1.typeId);
}
registerCustomEditorInputFactory(scheme: string, factory: ICustomEditorInputFactory): void {
this.customEditorInputFactoryInstances.set(scheme, factory);
}
@ -1506,23 +1535,6 @@ class EditorInputFactoryRegistry implements IEditorInputFactoryRegistry {
getCustomEditorInputFactory(scheme: string): ICustomEditorInputFactory | undefined {
return this.customEditorInputFactoryInstances.get(scheme);
}
registerEditorInputSerializer(editorInputId: string, ctor: IConstructorSignature0<IEditorInputSerializer>): IDisposable {
if (!this.instantiationService) {
this.editorInputSerializerConstructors.set(editorInputId, ctor);
} else {
this.createEditorInputSerializer(editorInputId, ctor, this.instantiationService);
}
return toDisposable(() => {
this.editorInputSerializerConstructors.delete(editorInputId);
this.editorInputSerializerInstances.delete(editorInputId);
});
}
getEditorInputSerializer(editorInputId: string): IEditorInputSerializer | undefined {
return this.editorInputSerializerInstances.get(editorInputId);
}
}
export const Extensions = {

View file

@ -23,6 +23,10 @@ export class DiffEditorInput extends SideBySideEditorInput {
static readonly ID = 'workbench.editors.diffEditorInput';
override get typeId(): string {
return DiffEditorInput.ID;
}
private cachedModel: DiffEditorModel | undefined = undefined;
constructor(
@ -37,10 +41,6 @@ export class DiffEditorInput extends SideBySideEditorInput {
super(name, description, originalInput, modifiedInput);
}
override getTypeId(): string {
return DiffEditorInput.ID;
}
override getName(): string {
if (!this.name) {

View file

@ -755,7 +755,7 @@ export class EditorGroup extends Disposable {
const editor = this.editors[i];
let canSerializeEditor = false;
const editorSerializer = registry.getEditorInputSerializer(editor.getTypeId());
const editorSerializer = registry.getEditorInputSerializer(editor);
if (editorSerializer) {
const value = editorSerializer.serialize(editor);
@ -763,7 +763,7 @@ export class EditorGroup extends Disposable {
if (typeof value === 'string') {
canSerializeEditor = true;
serializedEditors.push({ id: editor.getTypeId(), value });
serializedEditors.push({ id: editor.typeId, value });
serializableEditors.push(editor);
if (this.preview === editor) {

View file

@ -25,6 +25,10 @@ export class ResourceEditorInput extends AbstractTextResourceEditorInput impleme
static readonly ID: string = 'workbench.editors.resourceEditorInput';
override get typeId(): string {
return ResourceEditorInput.ID;
}
private cachedModel: ResourceEditorModel | undefined = undefined;
private modelReference: Promise<IReference<ITextEditorModel>> | undefined = undefined;
@ -44,10 +48,6 @@ export class ResourceEditorInput extends AbstractTextResourceEditorInput impleme
super(resource, undefined, editorService, editorGroupService, textFileService, labelService, fileService, filesConfigurationService);
}
getTypeId(): string {
return ResourceEditorInput.ID;
}
override getName(): string {
return this.name || super.getName();
}

View file

@ -14,15 +14,13 @@ import { localize } from 'vs/nls';
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { RawContextKey, IContextKeyService, IContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import { BulkEditPreviewProvider } from 'vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { WorkbenchListFocusContextKey } from 'vs/platform/list/browser/listService';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { URI } from 'vs/base/common/uri';
import { MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions';
import { IEditorInput } from 'vs/workbench/common/editor';
import { EditorResourceAccessor, IEditorInput, SideBySideEditor } from 'vs/workbench/common/editor';
import type { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
@ -63,13 +61,7 @@ class UXState {
let previewEditors: IEditorInput[] = [];
for (let input of group.editors) {
let resource: URI | undefined;
if (input instanceof DiffEditorInput) {
resource = input.modifiedInput.resource;
} else {
resource = input.resource;
}
let resource = EditorResourceAccessor.getCanonicalUri(input, { supportSideBySide: SideBySideEditor.PRIMARY });
if (resource?.scheme === BulkEditPreviewProvider.Schema) {
previewEditors.push(input);
}

View file

@ -85,11 +85,11 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
this._untitledDocumentData = options.untitledDocumentData;
}
public override getTypeId(): string {
public override get typeId(): string {
return CustomEditorInput.typeId;
}
public override supportsSplitEditor() {
public override canSplit() {
return !!this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument;
}

View file

@ -141,8 +141,7 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ
if (!this._contributedEditors.get(viewType)) {
// Prompt the user
const input = this.editorService.createEditorInput({ resource });
return this.editorService.openEditor(input, { override: EditorOverride.PICK });
return this.editorService.openEditor({ resource, options: { override: EditorOverride.PICK } });
}
const capabilities = this.getCustomEditorCapabilities(viewType) || {};

View file

@ -473,7 +473,8 @@ class ExceptionBreakpointsRenderer implements IListRenderer<IExceptionBreakpoint
renderElement(exceptionBreakpoint: IExceptionBreakpoint, index: number, data: IExceptionBreakpointTemplateData): void {
data.context = exceptionBreakpoint;
data.name.textContent = exceptionBreakpoint.label || `${exceptionBreakpoint.filter} exceptions`;
data.breakpoint.title = exceptionBreakpoint.description || data.name.textContent;
data.breakpoint.title = exceptionBreakpoint.verified ? (exceptionBreakpoint.description || data.name.textContent) : exceptionBreakpoint.message || localize('unverifiedExceptionBreakpoint', "Unverified Exception Breakpoint");
data.breakpoint.classList.toggle('disabled', !exceptionBreakpoint.verified);
data.checkbox.checked = exceptionBreakpoint.enabled;
data.condition.textContent = exceptionBreakpoint.condition || '';
data.condition.title = localize('expressionCondition', "Expression condition: {0}", exceptionBreakpoint.condition);

View file

@ -21,6 +21,8 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
let styleNames: string[] = [];
let customFgColor: RGBA | undefined;
let customBgColor: RGBA | undefined;
let customUnderlineColor: RGBA | undefined;
let colorsInverted: boolean = false;
let currentPos: number = 0;
let buffer: string = '';
@ -54,7 +56,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
if (sequenceFound) {
// Flush buffer with previous styles.
appendStylizedStringToContainer(root, buffer, styleNames, linkDetector, workspaceFolder, customFgColor, customBgColor);
appendStylizedStringToContainer(root, buffer, styleNames, linkDetector, workspaceFolder, customFgColor, customBgColor, customUnderlineColor);
buffer = '';
@ -62,17 +64,17 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
* Certain ranges that are matched here do not contain real graphics rendition sequences. For
* the sake of having a simpler expression, they have been included anyway.
*/
if (ansiSequence.match(/^(?:[34][0-8]|9[0-7]|10[0-7]|[013]|4|[34]9)(?:;[349][0-7]|10[0-7]|[013]|[245]|[34]9)?(?:;[012]?[0-9]?[0-9])*;?m$/)) {
if (ansiSequence.match(/^(?:[34][0-8]|9[0-7]|10[0-7]|[0-9]|2[1-5,7-9]|[34]9|5[8,9]|1[0-9])(?:;[349][0-7]|10[0-7]|[013]|[245]|[34]9)?(?:;[012]?[0-9]?[0-9])*;?m$/)) {
const styleCodes: number[] = ansiSequence.slice(0, -1) // Remove final 'm' character.
.split(';') // Separate style codes.
.filter(elem => elem !== '') // Filter empty elems as '34;m' -> ['34', ''].
.map(elem => parseInt(elem, 10)); // Convert to numbers.
if (styleCodes[0] === 38 || styleCodes[0] === 48) {
if (styleCodes[0] === 38 || styleCodes[0] === 48 || styleCodes[0] === 58) {
// Advanced color code - can't be combined with formatting codes like simple colors can
// Ignores invalid colors and additional info beyond what is necessary
const colorType = (styleCodes[0] === 38) ? 'foreground' : 'background';
const colorType = (styleCodes[0] === 38) ? 'foreground' : ((styleCodes[0] === 48) ? 'background' : 'underline');
if (styleCodes[1] === 5) {
set8BitColor(styleCodes, colorType);
@ -100,7 +102,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
// Flush remaining text buffer if not empty.
if (buffer) {
appendStylizedStringToContainer(root, buffer, styleNames, linkDetector, workspaceFolder, customFgColor, customBgColor);
appendStylizedStringToContainer(root, buffer, styleNames, linkDetector, workspaceFolder, customFgColor, customBgColor, customUnderlineColor);
}
return root;
@ -109,15 +111,18 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
* Change the foreground or background color by clearing the current color
* and adding the new one.
* @param colorType If `'foreground'`, will change the foreground color, if
* `'background'`, will change the background color.
* `'background'`, will change the background color, and if `'underline'`
* will set the underline color.
* @param color Color to change to. If `undefined` or not provided,
* will clear current color without adding a new one.
*/
function changeColor(colorType: 'foreground' | 'background', color?: RGBA | undefined): void {
function changeColor(colorType: 'foreground' | 'background' | 'underline', color?: RGBA | undefined): void {
if (colorType === 'foreground') {
customFgColor = color;
} else if (colorType === 'background') {
customBgColor = color;
} else if (colorType === 'underline') {
customUnderlineColor = color;
}
styleNames = styleNames.filter(style => style !== `code-${colorType}-colored`);
if (color !== undefined) {
@ -126,44 +131,165 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
}
/**
* Calculate and set basic ANSI formatting. Supports bold, italic, underline,
* normal foreground and background colors, and bright foreground and
* Swap foreground and background colors. Used for color inversion. Caller should check
* [] flag to make sure it is appropriate to turn ON or OFF (if it is already inverted don't call
*/
function reverseForegroundAndBackgroundColors(): void {
let oldFgColor: RGBA | undefined;
oldFgColor = customFgColor;
changeColor('foreground', customBgColor);
changeColor('background', oldFgColor);
}
/**
* Calculate and set basic ANSI formatting. Supports ON/OFF of bold, italic, underline,
* double underline, crossed-out/strikethrough, overline, dim, blink, rapid blink,
* reverse/invert video, hidden, superscript, subscript and alternate font codes,
* clearing/resetting of foreground, background and underline colors,
* setting normal foreground and background colors, and bright foreground and
* background colors. Not to be used for codes containing advanced colors.
* Will ignore invalid codes.
* @param styleCodes Array of ANSI basic styling numbers, which will be
* applied in order. New colors and backgrounds clear old ones; new formatting
* does not.
* @see {@link https://en.wikipedia.org/wiki/ANSI_escape_code }
* @see {@link https://en.wikipedia.org/wiki/ANSI_escape_code#SGR }
*/
function setBasicFormatters(styleCodes: number[]): void {
for (let code of styleCodes) {
switch (code) {
case 0: {
case 0: { // reset (everything)
styleNames = [];
customFgColor = undefined;
customBgColor = undefined;
break;
}
case 1: {
case 1: { // bold
styleNames = styleNames.filter(style => style !== `code-bold`);
styleNames.push('code-bold');
break;
}
case 3: {
case 2: { // dim
styleNames = styleNames.filter(style => style !== `code-dim`);
styleNames.push('code-dim');
break;
}
case 3: { // italic
styleNames = styleNames.filter(style => style !== `code-italic`);
styleNames.push('code-italic');
break;
}
case 4: {
case 4: { // underline
styleNames = styleNames.filter(style => (style !== `code-underline` && style !== `code-double-underline`));
styleNames.push('code-underline');
break;
}
case 39: {
case 5: { // blink
styleNames = styleNames.filter(style => style !== `code-blink`);
styleNames.push('code-blink');
break;
}
case 6: { // rapid blink
styleNames = styleNames.filter(style => style !== `code-rapid-blink`);
styleNames.push('code-rapid-blink');
break;
}
case 7: { // invert foreground and background
if (!colorsInverted) {
colorsInverted = true;
reverseForegroundAndBackgroundColors();
}
break;
}
case 8: { // hidden
styleNames = styleNames.filter(style => style !== `code-hidden`);
styleNames.push('code-hidden');
break;
}
case 9: { // strike-through/crossed-out
styleNames = styleNames.filter(style => style !== `code-strike-through`);
styleNames.push('code-strike-through');
break;
}
case 10: { // normal default font
styleNames = styleNames.filter(style => !style.startsWith('code-font'));
break;
}
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: { // font codes (and 20 is 'blackletter' font code)
styleNames = styleNames.filter(style => !style.startsWith('code-font'));
styleNames.push(`code-font-${code - 10}`);
break;
}
case 21: { // double underline
styleNames = styleNames.filter(style => (style !== `code-underline` && style !== `code-double-underline`));
styleNames.push('code-double-underline');
break;
}
case 22: { // normal intensity (bold off and dim off)
styleNames = styleNames.filter(style => (style !== `code-bold` && style !== `code-dim`));
break;
}
case 23: { // Neither italic or blackletter (font 10)
styleNames = styleNames.filter(style => (style !== `code-italic` && style !== `code-font-10`));
break;
}
case 24: { // not underlined (Neither singly nor doubly underlined)
styleNames = styleNames.filter(style => (style !== `code-underline` && style !== `code-double-underline`));
break;
}
case 25: { // not blinking
styleNames = styleNames.filter(style => (style !== `code-blink` && style !== `code-rapid-blink`));
break;
}
case 27: { // not reversed/inverted
if (colorsInverted) {
colorsInverted = false;
reverseForegroundAndBackgroundColors();
}
break;
}
case 28: { // not hidden (reveal)
styleNames = styleNames.filter(style => style !== `code-hidden`);
break;
}
case 29: { // not crossed-out
styleNames = styleNames.filter(style => style !== `code-strike-through`);
break;
}
case 53: { // overlined
styleNames = styleNames.filter(style => style !== `code-overline`);
styleNames.push('code-overline');
break;
}
case 55: { // not overlined
styleNames = styleNames.filter(style => style !== `code-overline`);
break;
}
case 39: { // default foreground color
changeColor('foreground', undefined);
break;
}
case 49: {
case 49: { // default background color
changeColor('background', undefined);
break;
}
case 59: { // default underline color
changeColor('underline', undefined);
break;
}
case 73: { // superscript
styleNames = styleNames.filter(style => (style !== `code-superscript` && style !== `code-subscript`));
styleNames.push('code-superscript');
break;
}
case 74: { // subscript
styleNames = styleNames.filter(style => (style !== `code-superscript` && style !== `code-subscript`));
styleNames.push('code-subscript');
break;
}
case 75: { // neither superscript or subscript
styleNames = styleNames.filter(style => (style !== `code-superscript` && style !== `code-subscript`));
break;
}
default: {
setBasicColor(code);
break;
@ -177,10 +303,11 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
* @param styleCodes Full list of integer codes that make up the full ANSI
* sequence, including the two defining codes and the three RGB codes.
* @param colorType If `'foreground'`, will set foreground color, if
* `'background'`, will set background color.
* `'background'`, will set background color, and if it is `'underline'`
* will set the underline color.
* @see {@link https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit }
*/
function set24BitColor(styleCodes: number[], colorType: 'foreground' | 'background'): void {
function set24BitColor(styleCodes: number[], colorType: 'foreground' | 'background' | 'underline'): void {
if (styleCodes.length >= 5 &&
styleCodes[2] >= 0 && styleCodes[2] <= 255 &&
styleCodes[3] >= 0 && styleCodes[3] <= 255 &&
@ -195,16 +322,27 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
* @param styleCodes Full list of integer codes that make up the ANSI
* sequence, including the two defining codes and the one color code.
* @param colorType If `'foreground'`, will set foreground color, if
* `'background'`, will set background color.
* `'background'`, will set background color and if it is `'underline'`
* will set the underline color.
* @see {@link https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit }
*/
function set8BitColor(styleCodes: number[], colorType: 'foreground' | 'background'): void {
function set8BitColor(styleCodes: number[], colorType: 'foreground' | 'background' | 'underline'): void {
let colorNumber = styleCodes[2];
const color = calcANSI8bitColor(colorNumber);
if (color) {
changeColor(colorType, color);
} else if (colorNumber >= 0 && colorNumber <= 15) {
if (colorType === 'underline') {
// for underline colors we just decode the 0-15 color number to theme color, set and return
const theme = themeService.getColorTheme();
const colorName = ansiColorIdentifiers[colorNumber];
const color = theme.getColor(colorName);
if (color) {
changeColor(colorType, color.rgba);
}
return;
}
// Need to map to one of the four basic color ranges (30-37, 90-97, 40-47, 100-107)
colorNumber += 30;
if (colorNumber >= 38) {
@ -261,7 +399,8 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
* @param cssClasses The list of CSS styles to apply to the text content.
* @param linkDetector The {@link LinkDetector} responsible for generating links from {@param stringContent}.
* @param customTextColor If provided, will apply custom color with inline style.
* @param customBackgroundColor If provided, will apply custom color with inline style.
* @param customBackgroundColor If provided, will apply custom backgroundColor with inline style.
* @param customUnderlineColor If provided, will apply custom textDecorationColor with inline style.
*/
export function appendStylizedStringToContainer(
root: HTMLElement,
@ -270,7 +409,8 @@ export function appendStylizedStringToContainer(
linkDetector: LinkDetector,
workspaceFolder: IWorkspaceFolder | undefined,
customTextColor?: RGBA,
customBackgroundColor?: RGBA
customBackgroundColor?: RGBA,
customUnderlineColor?: RGBA
): void {
if (!root || !stringContent) {
return;
@ -287,7 +427,10 @@ export function appendStylizedStringToContainer(
container.style.backgroundColor =
Color.Format.CSS.formatRGB(new Color(customBackgroundColor));
}
if (customUnderlineColor) {
container.style.textDecorationColor =
Color.Format.CSS.formatRGB(new Color(customUnderlineColor));
}
root.appendChild(container);
}

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