Merge branch 'master' into misolori/notebook-inactive-focus
2
.vscode/notebooks/verification.github-issues
vendored
|
@ -14,7 +14,7 @@
|
|||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks \n$milestone=milestone:\"November 2020\"",
|
||||
"value": "$repos=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks \n$milestone=milestone:\"January 2021\"",
|
||||
"editable": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
2021-01-07T09:53:10.404Z
|
||||
2021-01-28T11:52:11.376Z
|
||||
|
|
|
@ -112,6 +112,7 @@ steps:
|
|||
export SDKROOT=/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
|
||||
ls /Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
|
||||
yarn electron-rebuild
|
||||
# remove once https://github.com/prebuild/prebuild-install/pull/140 is merged and found in keytar
|
||||
cd ./node_modules/keytar
|
||||
node-gyp rebuild
|
||||
displayName: Rebuild native modules for ARM64
|
||||
|
|
|
@ -75,6 +75,7 @@ steps:
|
|||
- script: |
|
||||
set -e
|
||||
export npm_config_arch=$(NPM_ARCH)
|
||||
export npm_config_build_from_source=true
|
||||
|
||||
if [ -z "$CC" ] || [ -z "$CXX" ]; then
|
||||
export CC=$(which gcc-5)
|
||||
|
@ -95,6 +96,10 @@ steps:
|
|||
fi
|
||||
echo "Yarn failed $i, trying again..."
|
||||
done
|
||||
|
||||
# remove once https://github.com/prebuild/prebuild-install/pull/140 is merged and found in keytar
|
||||
cd ./node_modules/keytar
|
||||
npx node-gyp rebuild
|
||||
env:
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
|
|
|
@ -194,7 +194,8 @@ stages:
|
|||
steps:
|
||||
- template: linux/product-build-linux.yml
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true)) }}:
|
||||
# TODO@joaomoreno: We don't ship ARM snaps for now
|
||||
- ${{ if and(false, eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true)) }}:
|
||||
- job: LinuxSnapArmhf
|
||||
dependsOn:
|
||||
- LinuxArmhf
|
||||
|
@ -213,7 +214,8 @@ stages:
|
|||
steps:
|
||||
- template: linux/product-build-linux.yml
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true)) }}:
|
||||
# TODO@joaomoreno: We don't ship ARM snaps for now
|
||||
- ${{ if and(false, eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true)) }}:
|
||||
- job: LinuxSnapArm64
|
||||
dependsOn:
|
||||
- LinuxArm64
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="ESRP" value="https://microsoft.pkgs.visualstudio.com/_packaging/ESRP/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="ESRP" value="https://microsoft.pkgs.visualstudio.com/_packaging/ESRP/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
<disabledPackageSources>
|
||||
<clear />
|
||||
</disabledPackageSources>
|
||||
</configuration>
|
||||
|
|
|
@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const vscode_universal_1 = require("vscode-universal");
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
const plist = require("plist");
|
||||
const product = require("../../product.json");
|
||||
async function main() {
|
||||
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
||||
|
@ -21,6 +22,7 @@ async function main() {
|
|||
const arm64AsarPath = path.join(arm64AppPath, 'Contents', 'Resources', 'app', 'node_modules.asar');
|
||||
const outAppPath = path.join(buildDir, `VSCode-darwin-${arch}`, appName);
|
||||
const productJsonPath = path.resolve(outAppPath, 'Contents', 'Resources', 'app', 'product.json');
|
||||
const infoPlistPath = path.resolve(outAppPath, 'Contents', 'Info.plist');
|
||||
await vscode_universal_1.makeUniversalApp({
|
||||
x64AppPath,
|
||||
arm64AppPath,
|
||||
|
@ -41,6 +43,12 @@ async function main() {
|
|||
darwinUniversalAssetId: 'darwin-universal'
|
||||
});
|
||||
await fs.writeJson(productJsonPath, productJson);
|
||||
let infoPlistString = await fs.readFile(infoPlistPath, 'utf8');
|
||||
let infoPlistJson = plist.parse(infoPlistString);
|
||||
Object.assign(infoPlistJson, {
|
||||
LSRequiresNativeExecution: true
|
||||
});
|
||||
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
|
||||
}
|
||||
if (require.main === module) {
|
||||
main().catch(err => {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import { makeUniversalApp } from 'vscode-universal';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import * as plist from 'plist';
|
||||
import * as product from '../../product.json';
|
||||
|
||||
async function main() {
|
||||
|
@ -25,6 +26,7 @@ async function main() {
|
|||
const arm64AsarPath = path.join(arm64AppPath, 'Contents', 'Resources', 'app', 'node_modules.asar');
|
||||
const outAppPath = path.join(buildDir, `VSCode-darwin-${arch}`, appName);
|
||||
const productJsonPath = path.resolve(outAppPath, 'Contents', 'Resources', 'app', 'product.json');
|
||||
const infoPlistPath = path.resolve(outAppPath, 'Contents', 'Info.plist');
|
||||
|
||||
await makeUniversalApp({
|
||||
x64AppPath,
|
||||
|
@ -47,6 +49,13 @@ async function main() {
|
|||
darwinUniversalAssetId: 'darwin-universal'
|
||||
});
|
||||
await fs.writeJson(productJsonPath, productJson);
|
||||
|
||||
let infoPlistString = await fs.readFile(infoPlistPath, 'utf8');
|
||||
let infoPlistJson = plist.parse(infoPlistString);
|
||||
Object.assign(infoPlistJson, {
|
||||
LSRequiresNativeExecution: true
|
||||
});
|
||||
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
|
|
|
@ -10,6 +10,8 @@ const root = path.dirname(path.dirname(__dirname));
|
|||
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
|
||||
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
|
||||
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
|
||||
const node = process.platform === 'win32' ? 'node.exe' : 'node';
|
||||
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${process.platform}-${process.arch}`, node);
|
||||
const platform = process.platform;
|
||||
const arch = platform === 'darwin' ? 'x64' : process.arch;
|
||||
const node = platform === 'win32' ? 'node.exe' : 'node';
|
||||
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node);
|
||||
console.log(nodePath);
|
||||
|
|
|
@ -10,6 +10,7 @@ declare namespace monaco {
|
|||
export type Thenable<T> = PromiseLike<T>;
|
||||
|
||||
export interface Environment {
|
||||
globalAPI?: boolean;
|
||||
baseUrl?: string;
|
||||
getWorker?(workerId: string, label: string): Worker;
|
||||
getWorkerUrl?(workerId: string, label: string): string;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
"@types/minimist": "^1.2.1",
|
||||
"@types/mocha": "^8.2.0",
|
||||
"@types/node": "^12.19.9",
|
||||
"@types/plist": "^3.0.2",
|
||||
"@types/pump": "^1.0.1",
|
||||
"@types/request": "^2.47.0",
|
||||
"@types/rimraf": "^2.0.4",
|
||||
|
@ -41,6 +42,7 @@
|
|||
"jsonc-parser": "^2.3.0",
|
||||
"mime": "^1.4.1",
|
||||
"mkdirp": "^1.0.4",
|
||||
"plist": "^3.0.1",
|
||||
"source-map": "0.6.1",
|
||||
"typescript": "4.2.0-dev.20201207",
|
||||
"vsce": "1.48.0",
|
||||
|
|
|
@ -219,6 +219,14 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
|
||||
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
|
||||
|
||||
"@types/plist@^3.0.2":
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/plist/-/plist-3.0.2.tgz#61b3727bba0f5c462fe333542534a0c3e19ccb01"
|
||||
integrity sha512-ULqvZNGMv0zRFvqn8/4LSPtnmN4MfhlPNtJCTpKuIIxGVGZ2rYWzFXrvEBoh9CVyqSE7D6YFRJ1hydLHI6kbWw==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
xmlbuilder ">=11.0.1"
|
||||
|
||||
"@types/pump@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/pump/-/pump-1.0.1.tgz#ae8157cefef04d1a4d24c1cc91d403c2f5da5cd0"
|
||||
|
@ -1632,6 +1640,11 @@ xml2js@0.2.8:
|
|||
dependencies:
|
||||
sax "0.5.x"
|
||||
|
||||
xmlbuilder@>=11.0.1:
|
||||
version "15.1.1"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5"
|
||||
integrity sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==
|
||||
|
||||
xmlbuilder@^9.0.7:
|
||||
version "9.0.7"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.53.0",
|
||||
"distro": "e6642c0e4d3e0e8a149108972d213f1132e2eb14",
|
||||
"distro": "ef4e25f8dccec71b96ee8c6d0a770f1e53bcf84c",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
@ -198,7 +198,7 @@
|
|||
"underscore": "^1.8.2",
|
||||
"vinyl": "^2.0.0",
|
||||
"vinyl-fs": "^3.0.0",
|
||||
"vscode-debugprotocol": "1.43.0",
|
||||
"vscode-debugprotocol": "1.44.0",
|
||||
"vscode-nls-dev": "^3.3.1",
|
||||
"vscode-telemetry-extractor": "^1.6.0",
|
||||
"webpack": "^4.43.0",
|
||||
|
@ -225,4 +225,4 @@
|
|||
"elliptic": "^6.5.3",
|
||||
"nwmatcher": "^1.4.4"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@
|
|||
"builtInExtensions": [
|
||||
{
|
||||
"name": "ms-vscode.node-debug",
|
||||
"version": "1.44.15",
|
||||
"version": "1.44.16",
|
||||
"repo": "https://github.com/microsoft/vscode-node-debug",
|
||||
"metadata": {
|
||||
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
|
||||
|
|
|
@ -46,7 +46,6 @@ const args = minimist(process.argv, {
|
|||
'verbose',
|
||||
'wrap-iframe',
|
||||
'enable-sync',
|
||||
'trusted-types'
|
||||
],
|
||||
string: [
|
||||
'scheme',
|
||||
|
@ -63,7 +62,6 @@ if (args.help) {
|
|||
'yarn web [options]\n' +
|
||||
' --no-launch Do not open VSCode web in the browser\n' +
|
||||
' --wrap-iframe Wrap the Web Worker Extension Host in an iframe\n' +
|
||||
' --trusted-types Enable trusted types (report only)\n' +
|
||||
' --enable-sync Enable sync by default\n' +
|
||||
' --scheme Protocol (https or http)\n' +
|
||||
' --host Remote host\n' +
|
||||
|
@ -435,12 +433,10 @@ async function handleRoot(req, res) {
|
|||
.replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
|
||||
.replace('{{WEBVIEW_ENDPOINT}}', '');
|
||||
|
||||
|
||||
const headers = { 'Content-Type': 'text/html' };
|
||||
if (args['trusted-types']) {
|
||||
headers['Content-Security-Policy-Report-Only'] = 'require-trusted-types-for \'script\';';
|
||||
}
|
||||
|
||||
const headers = {
|
||||
'Content-Type': 'text/html',
|
||||
'Content-Security-Policy': 'require-trusted-types-for \'script\';'
|
||||
};
|
||||
res.writeHead(200, headers);
|
||||
return res.end(data);
|
||||
}
|
||||
|
|
|
@ -510,9 +510,19 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
|
|||
const item = this.items[i];
|
||||
const rows = rowsToDispose.get(item.templateId);
|
||||
const rowData = rows?.pop();
|
||||
const row = rowData && rowData[0]; // try to reuse a row
|
||||
|
||||
this.insertItemInDOM(i, beforeElement, row);
|
||||
if (!rowData) {
|
||||
this.insertItemInDOM(i, beforeElement);
|
||||
} else {
|
||||
const [row, element, index, size] = rowData;
|
||||
const renderer = this.renderers.get(item.templateId);
|
||||
|
||||
if (renderer && renderer.disposeElement) {
|
||||
renderer.disposeElement(element, index, row.templateData, size);
|
||||
}
|
||||
|
||||
this.insertItemInDOM(i, beforeElement, row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -370,24 +370,23 @@ export function anyScore(pattern: string, lowPattern: string, _patternPos: numbe
|
|||
if (result) {
|
||||
return result;
|
||||
}
|
||||
let matches = 0;
|
||||
let matches: number[] = [];
|
||||
let score = 0;
|
||||
let idx = _wordPos;
|
||||
for (let patternPos = 0; patternPos < lowPattern.length && patternPos < _maxLen; ++patternPos) {
|
||||
const wordPos = lowWord.indexOf(lowPattern.charAt(patternPos), idx);
|
||||
if (wordPos >= 0) {
|
||||
score += 1;
|
||||
matches += 2 ** wordPos;
|
||||
matches.unshift(wordPos);
|
||||
idx = wordPos + 1;
|
||||
|
||||
} else if (matches !== 0) {
|
||||
} else if (matches.length > 0) {
|
||||
// once we have started matching things
|
||||
// we need to match the remaining pattern
|
||||
// characters
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [score, _wordPos, matches];
|
||||
return [score, _wordPos, ...matches];
|
||||
}
|
||||
|
||||
//#region --- fuzzyScore ---
|
||||
|
@ -536,9 +535,9 @@ const enum Arrow { Diag = 1, Left = 2, LeftLeft = 3 }
|
|||
*
|
||||
* 0. the score
|
||||
* 1. the offset at which matching started
|
||||
* 2. `<match_pos_1>`
|
||||
* 3. `<match_pos_2>`
|
||||
* 4. `<match_pos_3>` etc
|
||||
* 2. `<match_pos_N>`
|
||||
* 3. `<match_pos_1>`
|
||||
* 4. `<match_pos_0>` etc
|
||||
*/
|
||||
export type FuzzyScore = [score: number, wordStart: number, ...matches: number[]];// [number, number, number];
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { IFilter, or, matchesPrefix, matchesStrictPrefix, matchesCamelCase, matchesSubString, matchesContiguousSubString, matchesWords, fuzzyScore, IMatch, fuzzyScoreGraceful, fuzzyScoreGracefulAggressive, FuzzyScorer, createMatches } from 'vs/base/common/filters';
|
||||
import { IFilter, or, matchesPrefix, matchesStrictPrefix, matchesCamelCase, matchesSubString, matchesContiguousSubString, matchesWords, fuzzyScore, IMatch, fuzzyScoreGraceful, fuzzyScoreGracefulAggressive, FuzzyScorer, createMatches, anyScore } from 'vs/base/common/filters';
|
||||
|
||||
function filterOk(filter: IFilter, word: string, wordToMatchAgainst: string, highlights?: { start: number; end: number; }[]) {
|
||||
let r = filter(word, wordToMatchAgainst);
|
||||
|
@ -549,4 +549,10 @@ suite('Filters', () => {
|
|||
assertMatches('SemanticTokens', 'SemanticTokensEdits', '^S^e^m^a^n^t^i^c^T^o^k^e^n^sEdits', fuzzyScore);
|
||||
assertMatches('SemanticTokens', 'SemanticTokensEdits', '^S^e^m^a^n^t^i^c^T^o^k^e^n^sEdits', fuzzyScoreGracefulAggressive);
|
||||
});
|
||||
|
||||
test('IntelliSense completion not correctly highlighting text in front of cursor #115250', function () {
|
||||
assertMatches('lo', 'log', '^l^og', fuzzyScore);
|
||||
assertMatches('.lo', 'log', '^l^og', anyScore);
|
||||
assertMatches('.', 'log', 'log', anyScore);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -503,20 +503,17 @@ class WindowIndicator implements IWindowIndicator {
|
|||
const settingsSyncOptions: ISettingsSyncOptions | undefined = config.settingsSyncOptions ? {
|
||||
enabled: config.settingsSyncOptions.enabled,
|
||||
enablementHandler: (enablement) => {
|
||||
// Handle enablement only if settings sync is enabled by default
|
||||
if (config.settingsSyncOptions?.enabled) {
|
||||
let queryString = `settingsSync=${enablement ? 'true' : 'false'}`;
|
||||
let queryString = `settingsSync=${enablement ? 'true' : 'false'}`;
|
||||
|
||||
// Save all other query params we might have
|
||||
const query = new URL(document.location.href).searchParams;
|
||||
query.forEach((value, key) => {
|
||||
if (key !== 'settingsSync') {
|
||||
queryString += `&${key}=${value}`;
|
||||
}
|
||||
});
|
||||
// Save all other query params we might have
|
||||
const query = new URL(document.location.href).searchParams;
|
||||
query.forEach((value, key) => {
|
||||
if (key !== 'settingsSync') {
|
||||
queryString += `&${key}=${value}`;
|
||||
}
|
||||
});
|
||||
|
||||
window.location.href = `${window.location.origin}?${queryString}`;
|
||||
}
|
||||
window.location.href = `${window.location.origin}?${queryString}`;
|
||||
}
|
||||
} : undefined;
|
||||
|
||||
|
|
|
@ -729,7 +729,7 @@ export class LanguageConfigurationRegistryImpl {
|
|||
} else {
|
||||
appendText = '';
|
||||
}
|
||||
} else if (indentAction === IndentAction.Indent || indentAction === IndentAction.IndentOutdent) {
|
||||
} else if (indentAction === IndentAction.Indent) {
|
||||
appendText = '\t' + appendText;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { EditorOptions, WrappingIndent, EditorAutoIndentStrategy } from 'vs/edit
|
|||
import { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase';
|
||||
import { createMonacoEditorAPI } from 'vs/editor/standalone/browser/standaloneEditor';
|
||||
import { createMonacoLanguagesAPI } from 'vs/editor/standalone/browser/standaloneLanguages';
|
||||
import { globals } from 'vs/base/common/platform';
|
||||
|
||||
// Set defaults for standalone editor
|
||||
EditorOptions.wrappingIndent.defaultValue = WrappingIndent.None;
|
||||
|
@ -32,7 +33,9 @@ export const Token = api.Token;
|
|||
export const editor = api.editor;
|
||||
export const languages = api.languages;
|
||||
|
||||
self.monaco = api;
|
||||
if (globals.MonacoEnvironment?.globalAPI || globals.define?.amd) {
|
||||
self.monaco = api;
|
||||
}
|
||||
|
||||
if (typeof self.require !== 'undefined' && typeof self.require.config === 'function') {
|
||||
self.require.config({
|
||||
|
|
|
@ -31,6 +31,9 @@ import { StandaloneCodeEditorNLS } from 'vs/editor/common/standaloneStrings';
|
|||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IEditorProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { StandaloneThemeServiceImpl } from 'vs/editor/standalone/browser/standaloneThemeServiceImpl';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ILanguageSelection, IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
/**
|
||||
* Description of an action contribution
|
||||
|
@ -364,7 +367,9 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon
|
|||
@IStandaloneThemeService themeService: IStandaloneThemeService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService,
|
||||
@IModelService modelService: IModelService,
|
||||
@IModeService modeService: IModeService,
|
||||
) {
|
||||
const options = { ..._options };
|
||||
updateConfigurationService(configurationService, options, false);
|
||||
|
@ -384,7 +389,7 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon
|
|||
|
||||
let model: ITextModel | null;
|
||||
if (typeof _model === 'undefined') {
|
||||
model = (<any>self).monaco.editor.createModel(options.value || '', options.language || 'text/plain');
|
||||
model = createTextModel(modelService, modeService, options.value || '', options.language || 'text/plain', undefined);
|
||||
this._ownsModel = true;
|
||||
} else {
|
||||
model = _model;
|
||||
|
@ -507,3 +512,26 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
|
|||
return this.getModifiedEditor().addAction(descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function createTextModel(modelService: IModelService, modeService: IModeService, value: string, language: string | undefined, uri: URI | undefined): ITextModel {
|
||||
value = value || '';
|
||||
if (!language) {
|
||||
const firstLF = value.indexOf('\n');
|
||||
let firstLine = value;
|
||||
if (firstLF !== -1) {
|
||||
firstLine = value.substring(0, firstLF);
|
||||
}
|
||||
return doCreateModel(modelService, value, modeService.createByFilepathOrFirstLine(uri || null, firstLine), uri);
|
||||
}
|
||||
return doCreateModel(modelService, value, modeService.create(language), uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function doCreateModel(modelService: IModelService, value: string, languageSelection: ILanguageSelection, uri: URI | undefined): ITextModel {
|
||||
return modelService.createModel(value, languageSelection, uri);
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ import { FindMatch, ITextModel, TextModelResolvedOptions } from 'vs/editor/commo
|
|||
import * as modes from 'vs/editor/common/modes';
|
||||
import { NULL_STATE, nullTokenize } from 'vs/editor/common/modes/nullMode';
|
||||
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
|
||||
import { ILanguageSelection } from 'vs/editor/common/services/modeService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { IWebWorkerOptions, MonacoWebWorker, createWebWorker as actualCreateWebWorker } from 'vs/editor/common/services/webWorker';
|
||||
import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';
|
||||
import { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/standalone/browser/colorizer';
|
||||
import { SimpleEditorModelResolverService } from 'vs/editor/standalone/browser/simpleServices';
|
||||
import { IDiffEditorConstructionOptions, IStandaloneEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneDiffEditor, StandaloneEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';
|
||||
import { IDiffEditorConstructionOptions, IStandaloneEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneDiffEditor, StandaloneEditor, createTextModel } from 'vs/editor/standalone/browser/standaloneCodeEditor';
|
||||
import { DynamicStandaloneServices, IEditorOverrideServices, StaticServices } from 'vs/editor/standalone/browser/standaloneServices';
|
||||
import { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
|
@ -42,6 +42,7 @@ import { IEditorProgressService } from 'vs/platform/progress/common/progress';
|
|||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { StandaloneThemeServiceImpl } from 'vs/editor/standalone/browser/standaloneThemeServiceImpl';
|
||||
import { splitLines } from 'vs/base/common/strings';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
|
@ -87,7 +88,9 @@ export function create(domElement: HTMLElement, options?: IStandaloneEditorConst
|
|||
services.get(IStandaloneThemeService),
|
||||
services.get(INotificationService),
|
||||
services.get(IConfigurationService),
|
||||
services.get(IAccessibilityService)
|
||||
services.get(IAccessibilityService),
|
||||
services.get(IModelService),
|
||||
services.get(IModeService),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -140,27 +143,18 @@ export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: ID
|
|||
return new DiffNavigator(diffEditor, opts);
|
||||
}
|
||||
|
||||
function doCreateModel(value: string, languageSelection: ILanguageSelection, uri?: URI): ITextModel {
|
||||
return StaticServices.modelService.get().createModel(value, languageSelection, uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new editor model.
|
||||
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
|
||||
*/
|
||||
export function createModel(value: string, language?: string, uri?: URI): ITextModel {
|
||||
value = value || '';
|
||||
|
||||
if (!language) {
|
||||
let firstLF = value.indexOf('\n');
|
||||
let firstLine = value;
|
||||
if (firstLF !== -1) {
|
||||
firstLine = value.substring(0, firstLF);
|
||||
}
|
||||
|
||||
return doCreateModel(value, StaticServices.modeService.get().createByFilepathOrFirstLine(uri || null, firstLine), uri);
|
||||
}
|
||||
return doCreateModel(value, StaticServices.modeService.get().create(language), uri);
|
||||
return createTextModel(
|
||||
StaticServices.modelService.get(),
|
||||
StaticServices.modeService.get(),
|
||||
value,
|
||||
language,
|
||||
uri
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2812,38 +2812,6 @@ suite('Editor Controller - Cursor Configuration', () => {
|
|||
mode.dispose();
|
||||
});
|
||||
|
||||
test('issue #115148: indentOutdent and appendText', () => {
|
||||
const mode = new class extends MockMode {
|
||||
constructor() {
|
||||
super(new LanguageIdentifier('onEnterMode', 3));
|
||||
this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), {
|
||||
onEnterRules: [{
|
||||
beforeText: /.*/,
|
||||
action: {
|
||||
indentAction: IndentAction.IndentOutdent,
|
||||
appendText: 'x'
|
||||
}
|
||||
}]
|
||||
}));
|
||||
}
|
||||
}();
|
||||
usingCursor({
|
||||
text: [
|
||||
'text {}'
|
||||
],
|
||||
languageIdentifier: mode.getLanguageIdentifier(),
|
||||
}, (editor, model, viewModel) => {
|
||||
|
||||
moveTo(editor, viewModel, 1, 7);
|
||||
viewModel.type('\n', 'keyboard');
|
||||
assert.strictEqual(model.getLineContent(1), 'text {');
|
||||
assert.strictEqual(model.getLineContent(2), ' x');
|
||||
assert.strictEqual(model.getLineContent(3), '}');
|
||||
assertCursor(viewModel, new Position(2, 6));
|
||||
});
|
||||
mode.dispose();
|
||||
});
|
||||
|
||||
test('issue #6862: Editor removes auto inserted indentation when formatting on type', () => {
|
||||
let mode = new OnEnterMode(IndentAction.IndentOutdent);
|
||||
usingCursor({
|
||||
|
@ -4104,6 +4072,47 @@ suite('Editor Controller - Indentation Rules', () => {
|
|||
mode.dispose();
|
||||
});
|
||||
|
||||
test('issue #115304: OnEnter broken for TS', () => {
|
||||
class JSMode extends MockMode {
|
||||
private static readonly _id = new LanguageIdentifier('indentRulesMode', 4);
|
||||
constructor() {
|
||||
super(JSMode._id);
|
||||
this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), {
|
||||
onEnterRules: javascriptOnEnterRules
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
const mode = new JSMode();
|
||||
const model = createTextModel(
|
||||
[
|
||||
'/** */',
|
||||
'function f() {}',
|
||||
].join('\n'),
|
||||
undefined,
|
||||
mode.getLanguageIdentifier()
|
||||
);
|
||||
|
||||
withTestCodeEditor(null, { model: model, autoIndent: 'advanced' }, (editor, viewModel) => {
|
||||
moveTo(editor, viewModel, 1, 4, false);
|
||||
assertCursor(viewModel, new Selection(1, 4, 1, 4));
|
||||
|
||||
viewModel.type('\n', 'keyboard');
|
||||
assert.strictEqual(model.getValue(),
|
||||
[
|
||||
'/**',
|
||||
' * ',
|
||||
' */',
|
||||
'function f() {}',
|
||||
].join('\n')
|
||||
);
|
||||
assertCursor(viewModel, new Selection(2, 4, 2, 4));
|
||||
});
|
||||
|
||||
model.dispose();
|
||||
mode.dispose();
|
||||
});
|
||||
|
||||
test('issue #38261: TAB key results in bizarre indentation in C++ mode ', () => {
|
||||
class CppMode extends MockMode {
|
||||
private static readonly _id = new LanguageIdentifier('indentRulesMode', 4);
|
||||
|
|
1
src/vs/monaco.d.ts
vendored
|
@ -10,6 +10,7 @@ declare namespace monaco {
|
|||
export type Thenable<T> = PromiseLike<T>;
|
||||
|
||||
export interface Environment {
|
||||
globalAPI?: boolean;
|
||||
baseUrl?: string;
|
||||
getWorker?(workerId: string, label: string): Worker;
|
||||
getWorkerUrl?(workerId: string, label: string): string;
|
||||
|
|
|
@ -17,7 +17,6 @@ import { Schemas } from 'vs/base/common/network';
|
|||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
|
||||
const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id);
|
||||
const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id);
|
||||
const useId = localize('useId', "Make sure you use the full extension ID, including the publisher, e.g.: {0}", 'ms-dotnettools.csharp');
|
||||
|
||||
|
||||
|
@ -52,6 +51,9 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
@ILocalizationsService private readonly localizationsService: ILocalizationsService
|
||||
) { }
|
||||
|
||||
protected get location(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public async listExtensions(showVersions: boolean, category?: string, output: CLIOutput = console): Promise<void> {
|
||||
let extensions = await this.extensionManagementService.getInstalled(ExtensionType.User);
|
||||
|
@ -75,6 +77,10 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (this.location) {
|
||||
output.log(localize('listFromLocation', "Extensions installed on {0}:", this.location));
|
||||
}
|
||||
|
||||
extensions = extensions.sort((e1, e2) => e1.identifier.id.localeCompare(e2.identifier.id));
|
||||
let lastId: string | undefined = undefined;
|
||||
for (let extension of extensions) {
|
||||
|
@ -89,7 +95,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
const failed: string[] = [];
|
||||
const installedExtensionsManifests: IExtensionManifest[] = [];
|
||||
if (extensions.length) {
|
||||
output.log(localize('installingExtensions', "Installing extensions..."));
|
||||
output.log(this.location ? localize('installingExtensionsOnLocation', "Installing extensions on {0}...", this.location) : localize('installingExtensions', "Installing extensions..."));
|
||||
}
|
||||
|
||||
const installed = await this.extensionManagementService.getInstalled(ExtensionType.User);
|
||||
|
@ -176,7 +182,11 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
private async installVSIX(vsix: URI, force: boolean, output: CLIOutput): Promise<IExtensionManifest | null> {
|
||||
|
||||
const manifest = await this.extensionManagementService.getManifest(vsix);
|
||||
const valid = await this.validate(manifest, force, output);
|
||||
if (!manifest) {
|
||||
throw new Error('Invalid vsix');
|
||||
}
|
||||
|
||||
const valid = await this.validateVSIX(manifest, force, output);
|
||||
if (valid) {
|
||||
try {
|
||||
await this.extensionManagementService.install(vsix);
|
||||
|
@ -217,6 +227,10 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
|
||||
private async installFromGallery({ id, version, installOptions }: InstallExtensionInfo, galleryExtension: IGalleryExtension, installed: ILocalExtension[], force: boolean, output: CLIOutput): Promise<IExtensionManifest | null> {
|
||||
const manifest = await this.extensionGalleryService.getManifest(galleryExtension, CancellationToken.None);
|
||||
if (manifest && !this.validateExtensionKind(manifest, output)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const installedExtension = installed.find(e => areSameExtensions(e.identifier, galleryExtension.identifier));
|
||||
if (installedExtension) {
|
||||
if (galleryExtension.version === installedExtension.manifest.version) {
|
||||
|
@ -232,6 +246,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
} else {
|
||||
output.log(localize('installing', "Installing extension '{0}' v{1}...", id, galleryExtension.version));
|
||||
}
|
||||
|
||||
await this.extensionManagementService.installFromGallery(galleryExtension, installOptions);
|
||||
output.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed.", id, galleryExtension.version));
|
||||
return manifest;
|
||||
|
@ -245,11 +260,11 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
}
|
||||
}
|
||||
|
||||
private async validate(manifest: IExtensionManifest, force: boolean, output: CLIOutput): Promise<boolean> {
|
||||
if (!manifest) {
|
||||
throw new Error('Invalid vsix');
|
||||
}
|
||||
protected validateExtensionKind(_manifest: IExtensionManifest, output: CLIOutput): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
private async validateVSIX(manifest: IExtensionManifest, force: boolean, output: CLIOutput): Promise<boolean> {
|
||||
const extensionIdentifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) };
|
||||
const installedExtensions = await this.extensionManagementService.getInstalled(ExtensionType.User);
|
||||
const newer = installedExtensions.find(local => areSameExtensions(extensionIdentifier, local.identifier) && gt(local.manifest.version, manifest.version));
|
||||
|
@ -259,7 +274,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return this.validateExtensionKind(manifest, output);
|
||||
}
|
||||
|
||||
public async uninstallExtensions(extensions: (string | URI)[], force: boolean, output: CLIOutput = console): Promise<void> {
|
||||
|
@ -277,7 +292,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
const installed = await this.extensionManagementService.getInstalled();
|
||||
const extensionsToUninstall = installed.filter(e => areSameExtensions(e.identifier, { id }));
|
||||
if (!extensionsToUninstall.length) {
|
||||
throw new Error(`${notInstalled(id)}\n${useId}`);
|
||||
throw new Error(`${this.notInstalled(id)}\n${useId}`);
|
||||
}
|
||||
if (extensionsToUninstall.some(e => e.type === ExtensionType.System)) {
|
||||
output.log(localize('builtin', "Extension '{0}' is a Built-in extension and cannot be uninstalled", id));
|
||||
|
@ -293,7 +308,12 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
uninstalledExtensions.push(extensionToUninstall);
|
||||
}
|
||||
|
||||
output.log(localize('successUninstall', "Extension '{0}' was successfully uninstalled!", id));
|
||||
if (this.location) {
|
||||
output.log(localize('successUninstallFromLocation', "Extension '{0}' was successfully uninstalled from {1}!", id, this.location));
|
||||
} else {
|
||||
output.log(localize('successUninstall', "Extension '{0}' was successfully uninstalled!", id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (uninstalledExtensions.some(e => isLanguagePackExtension(e.manifest))) {
|
||||
|
@ -319,4 +339,9 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
|||
private updateLocalizationsCache(): Promise<boolean> {
|
||||
return this.localizationsService.update();
|
||||
}
|
||||
|
||||
private notInstalled(id: string) {
|
||||
return this.location ? localize('notInstalleddOnLocation', "Extension '{0}' is not installed on {1}.", id, this.location) : localize('notInstalled', "Extension '{0}' is not installed.", id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
|||
import { IExtensionRecommendationNotificationService, RecommendationsNotificationResult, RecommendationSource } from 'vs/platform/extensionRecommendations/common/extensionRecommendations';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
|
||||
type ExeExtensionRecommendationsClassification = {
|
||||
extensionId: { classification: 'PublicNonPersonalData', purpose: 'FeatureInsight' };
|
||||
|
@ -52,6 +54,7 @@ export class ExtensionTipsService extends BaseExtensionTipsService {
|
|||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@INativeHostService private readonly nativeHostService: INativeHostService,
|
||||
@IExtensionRecommendationNotificationService private readonly extensionRecommendationNotificationService: IExtensionRecommendationNotificationService,
|
||||
@IFileService fileService: IFileService,
|
||||
@IProductService productService: IProductService,
|
||||
|
@ -172,6 +175,11 @@ export class ExtensionTipsService extends BaseExtensionTipsService {
|
|||
case RecommendationsNotificationResult.Ignored:
|
||||
this.highImportanceTipsByExe.delete(exeName);
|
||||
break;
|
||||
case RecommendationsNotificationResult.IncompatibleWindow:
|
||||
// Recommended in incompatible window. Schedule the prompt after active window change
|
||||
const onActiveWindowChange = Event.once(Event.latch(Event.any(this.nativeHostService.onDidOpenWindow, this.nativeHostService.onDidFocusWindow)));
|
||||
this._register(onActiveWindowChange(() => this.promptHighImportanceExeBasedTip()));
|
||||
break;
|
||||
case RecommendationsNotificationResult.TooMany:
|
||||
// Too many notifications. Schedule the prompt after one hour
|
||||
const disposable = this._register(disposableTimeout(() => { disposable.dispose(); this.promptHighImportanceExeBasedTip(); }, 60 * 60 * 1000 /* 1 hour */));
|
||||
|
@ -217,6 +225,12 @@ export class ExtensionTipsService extends BaseExtensionTipsService {
|
|||
this.promptMediumImportanceExeBasedTip();
|
||||
break;
|
||||
|
||||
case RecommendationsNotificationResult.IncompatibleWindow:
|
||||
// Recommended in incompatible window. Schedule the prompt after active window change
|
||||
const onActiveWindowChange = Event.once(Event.latch(Event.any(this.nativeHostService.onDidOpenWindow, this.nativeHostService.onDidFocusWindow)));
|
||||
this._register(onActiveWindowChange(() => this.promptMediumImportanceExeBasedTip()));
|
||||
break;
|
||||
|
||||
case RecommendationsNotificationResult.TooMany:
|
||||
// Too many notifications. Schedule the prompt after one hour
|
||||
const disposable2 = this._register(disposableTimeout(() => { disposable2.dispose(); this.promptMediumImportanceExeBasedTip(); }, 60 * 60 * 1000 /* 1 hour */));
|
||||
|
|
|
@ -23,6 +23,7 @@ export const enum RecommendationsNotificationResult {
|
|||
Ignored = 'ignored',
|
||||
Cancelled = 'cancelled',
|
||||
TooMany = 'toomany',
|
||||
IncompatibleWindow = 'incompatibleWindow',
|
||||
Accepted = 'reacted',
|
||||
}
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ export class IssueMainService implements ICommonIssueService {
|
|||
},
|
||||
product: {
|
||||
nameShort: product.nameShort,
|
||||
version: product.version,
|
||||
version: !!product.darwinUniversalAssetId ? `${product.version} (Universal)` : product.version,
|
||||
commit: product.commit,
|
||||
date: product.date,
|
||||
reportIssueUrl: product.reportIssueUrl
|
||||
|
|
|
@ -3,15 +3,28 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { localize } from 'vs/nls';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { IExtensionManagementCLIService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { CLIOutput, IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionManagementCLIService } from 'vs/platform/extensionManagement/common/extensionManagementCLIService';
|
||||
import { getExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { canExecuteOnWorkspace } from 'vs/workbench/services/extensions/common/extensionsUtil';
|
||||
import { IExtensionManifest } from 'vs/workbench/workbench.web.api';
|
||||
|
||||
|
||||
// this class contains the command that the CLI server is reying on
|
||||
// this class contains the commands that the CLI server is reying on
|
||||
|
||||
CommandsRegistry.registerCommand('_remoteCLI.openExternal', function (accessor: ServicesAccessor, uri: UriComponents, options: { allowTunneling?: boolean }) {
|
||||
// TODO: discuss martin, ben where to put this
|
||||
|
@ -28,7 +41,14 @@ interface ManageExtensionsArgs {
|
|||
|
||||
CommandsRegistry.registerCommand('_remoteCLI.manageExtensions', async function (accessor: ServicesAccessor, args: ManageExtensionsArgs) {
|
||||
|
||||
const cliService = accessor.get(IExtensionManagementCLIService);
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const extensionManagementServerService = accessor.get(IExtensionManagementServerService);
|
||||
const remoteExtensionManagementService = extensionManagementServerService.remoteExtensionManagementServer?.extensionManagementService;
|
||||
if (!remoteExtensionManagementService) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cliService = instantiationService.createChild(new ServiceCollection([IExtensionManagementService, remoteExtensionManagementService])).createInstance(RemoteExtensionCLIManagementService);
|
||||
|
||||
const lines: string[] = [];
|
||||
const output = { log: lines.push.bind(lines), error: lines.push.bind(lines) };
|
||||
|
@ -55,3 +75,34 @@ CommandsRegistry.registerCommand('_remoteCLI.manageExtensions', async function (
|
|||
return lines.join('\n');
|
||||
});
|
||||
|
||||
class RemoteExtensionCLIManagementService extends ExtensionManagementCLIService {
|
||||
|
||||
private _location: string | undefined;
|
||||
|
||||
constructor(
|
||||
@IExtensionManagementService extensionManagementService: IExtensionManagementService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IExtensionGalleryService extensionGalleryService: IExtensionGalleryService,
|
||||
@ILocalizationsService localizationsService: ILocalizationsService,
|
||||
@ILabelService labelService: ILabelService,
|
||||
@IWorkbenchEnvironmentService envService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
super(extensionManagementService, extensionGalleryService, localizationsService);
|
||||
|
||||
const remoteAuthority = envService.remoteAuthority;
|
||||
this._location = remoteAuthority ? labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority) : undefined;
|
||||
}
|
||||
|
||||
protected get location(): string | undefined {
|
||||
return this._location;
|
||||
}
|
||||
|
||||
protected validateExtensionKind(manifest: IExtensionManifest, output: CLIOutput): boolean {
|
||||
if (!canExecuteOnWorkspace(manifest, this.productService, this.configurationService)) {
|
||||
output.log(localize('cannot be installed', "Cannot install '{0}' because this extension has defined that it cannot run on the remote server.", getExtensionId(manifest.publisher, manifest.name)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { dirname, isEqual, basenameOrAuthority } from 'vs/base/common/resources';
|
||||
import { dirname, isEqual } from 'vs/base/common/resources';
|
||||
import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
|
@ -379,7 +379,7 @@ class ResourceLabelWidget extends IconLabel {
|
|||
}
|
||||
|
||||
if (!name) {
|
||||
name = basenameOrAuthority(resource);
|
||||
name = this.labelService.getUriBasenameLabel(resource);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -323,9 +323,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
|||
if (this.state.fullscreen && (this.state.menuBar.visibility === 'toggle' || this.state.menuBar.visibility === 'default')) {
|
||||
// Propagate to grid
|
||||
this.workbenchGrid.setViewVisible(this.titleBarPartView, this.isVisible(Parts.TITLEBAR_PART));
|
||||
|
||||
this.layout();
|
||||
}
|
||||
|
||||
// Move layout call to any time the menubar
|
||||
// is toggled to update consumers of offset
|
||||
// see issue #115267
|
||||
this.layout();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1402,22 +1402,34 @@ export class TabsTitleControl extends TitleControl {
|
|||
if (this.accessor.partOptions.wrapTabs) {
|
||||
const visibleTabsWidth = tabsContainer.offsetWidth;
|
||||
const allTabsWidth = tabsContainer.scrollWidth;
|
||||
const lastTabFitsWrapped = () => {
|
||||
const lastTab = this.getLastTab();
|
||||
if (!lastTab) {
|
||||
return true; // no tab always fits
|
||||
}
|
||||
|
||||
return lastTab.offsetWidth <= (dimensions.available.width - editorToolbarContainer.offsetWidth);
|
||||
};
|
||||
|
||||
// If tabs wrap or should start to wrap (when width exceeds visible width)
|
||||
// we must trigger `updateWrapping` to set the `last-tab-margin-right`
|
||||
// accordingly based on the number of actions. The margin is important to
|
||||
// properly position the last tab apart from the actions
|
||||
if (tabsWrapMultiLine || allTabsWidth > visibleTabsWidth) {
|
||||
//
|
||||
// We already check here if the last tab would fit when wrapped given the
|
||||
// editor toolbar will also show right next to it. This ensures we are not
|
||||
// enabling wrapping only to disable it again in the code below (this fixes
|
||||
// flickering issue https://github.com/microsoft/vscode/issues/115050)
|
||||
if (tabsWrapMultiLine || (allTabsWidth > visibleTabsWidth && lastTabFitsWrapped())) {
|
||||
updateTabsWrapping(true);
|
||||
}
|
||||
|
||||
// Tabs wrap multiline: remove wrapping under certain size constraint conditions
|
||||
if (tabsWrapMultiLine) {
|
||||
const lastTab = this.getLastTab();
|
||||
if (
|
||||
(tabsContainer.offsetHeight > dimensions.available.height) || // if height exceeds available height
|
||||
(allTabsWidth === visibleTabsWidth && tabsContainer.offsetHeight === TabsTitleControl.TAB_HEIGHT) || // if wrapping is not needed anymore
|
||||
(lastTab && lastTab.offsetWidth > (dimensions.available.width - editorToolbarContainer.offsetWidth)) // if editor actions occupy too much space
|
||||
(!lastTabFitsWrapped()) // if last tab does not fit anymore
|
||||
) {
|
||||
updateTabsWrapping(false);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACK
|
|||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { isThemeColor } from 'vs/editor/common/editorCommon';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { EventHelper, createStyleSheet, addDisposableListener, EventType, hide, show, isAncestor, append } from 'vs/base/browser/dom';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IStorageService, StorageScope, IStorageValueChangeEvent, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
|
@ -894,7 +893,7 @@ class StatusbarEntryItem extends Disposable {
|
|||
}
|
||||
|
||||
private applyColor(container: HTMLElement, color: string | ThemeColor | undefined, isBackground?: boolean): void {
|
||||
let colorResult: string | null = null;
|
||||
let colorResult: string | undefined = undefined;
|
||||
|
||||
if (isBackground) {
|
||||
this.backgroundListener.clear();
|
||||
|
@ -904,15 +903,15 @@ class StatusbarEntryItem extends Disposable {
|
|||
|
||||
if (color) {
|
||||
if (isThemeColor(color)) {
|
||||
colorResult = (this.themeService.getColorTheme().getColor(color.id) || Color.transparent).toString();
|
||||
colorResult = this.themeService.getColorTheme().getColor(color.id)?.toString();
|
||||
|
||||
const listener = this.themeService.onDidColorThemeChange(theme => {
|
||||
const colorValue = (theme.getColor(color.id) || Color.transparent).toString();
|
||||
const colorValue = theme.getColor(color.id)?.toString();
|
||||
|
||||
if (isBackground) {
|
||||
container.style.backgroundColor = colorValue;
|
||||
container.style.backgroundColor = colorValue ?? '';
|
||||
} else {
|
||||
container.style.color = colorValue;
|
||||
container.style.color = colorValue ?? '';
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -927,9 +926,9 @@ class StatusbarEntryItem extends Disposable {
|
|||
}
|
||||
|
||||
if (isBackground) {
|
||||
container.style.backgroundColor = colorResult || '';
|
||||
container.style.backgroundColor = colorResult ?? '';
|
||||
} else {
|
||||
container.style.color = colorResult || '';
|
||||
container.style.color = colorResult ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ export class ResourceEditorInput extends AbstractTextResourceEditorInput impleme
|
|||
ref.dispose();
|
||||
this.modelReference = undefined;
|
||||
|
||||
throw new Error(`Unexpected model for ResourcEditorInput: ${this.resource}`);
|
||||
throw new Error(`Unexpected model for ResourceEditorInput: ${this.resource}`);
|
||||
}
|
||||
|
||||
this.cachedModel = model;
|
||||
|
|
|
@ -155,7 +155,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
|
|||
};
|
||||
const comparator = new DocumentSymbolComparator();
|
||||
const options = {
|
||||
collapseByDefault: true,
|
||||
collapseByDefault: target === OutlineTarget.Breadcrumbs,
|
||||
expandOnlyOnTwistieClick: true,
|
||||
multipleSelectionSupport: false,
|
||||
identityProvider: new DocumentSymbolIdentityProvider(),
|
||||
|
|
|
@ -425,7 +425,7 @@ export class Thread implements IThread {
|
|||
getTopStackFrame(): IStackFrame | undefined {
|
||||
const callStack = this.getCallStack();
|
||||
const firstAvailableStackFrame = callStack.find(sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize'));
|
||||
return firstAvailableStackFrame || callStack.length > 0 ? callStack[0] : undefined;
|
||||
return firstAvailableStackFrame || (callStack.length > 0 ? callStack[0] : undefined);
|
||||
}
|
||||
|
||||
get stateLabel(): string {
|
||||
|
|
|
@ -740,7 +740,7 @@ declare module DebugProtocol {
|
|||
/** Reference to the Variable container if the data breakpoint is requested for a child of the container. */
|
||||
variablesReference?: number;
|
||||
/** The name of the Variable's child to obtain data breakpoint information for.
|
||||
If variableReference isn’t provided, this can be an expression.
|
||||
If variablesReference isn’t provided, this can be an expression.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
@ -1012,7 +1012,7 @@ declare module DebugProtocol {
|
|||
|
||||
/** StackTrace request; value of command field is 'stackTrace'.
|
||||
The request returns a stacktrace from the current execution state of a given thread.
|
||||
A client can request all stack frames by omitting the startFrame and levels arguments. For performance conscious clients stack frames can be retrieved in a piecemeal way with the startFrame and levels arguments. The response of the stackTrace request may contain a totalFrames property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of totalFrames decide how to proceed. In any case a client should be prepared to receive less frames than requested, which is an indication that the end of the stack has been reached.
|
||||
A client can request all stack frames by omitting the startFrame and levels arguments. For performance conscious clients and if the debug adapter's 'supportsDelayedStackTraceLoading' capability is true, stack frames can be retrieved in a piecemeal way with the startFrame and levels arguments. The response of the stackTrace request may contain a totalFrames property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of totalFrames decide how to proceed. In any case a client should be prepared to receive less frames than requested, which is an indication that the end of the stack has been reached.
|
||||
*/
|
||||
export interface StackTraceRequest extends Request {
|
||||
// command: 'stackTrace';
|
||||
|
@ -1591,7 +1591,7 @@ declare module DebugProtocol {
|
|||
supportsExceptionInfoRequest?: boolean;
|
||||
/** The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request. */
|
||||
supportTerminateDebuggee?: boolean;
|
||||
/** The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' result of the 'StackTrace' request are supported. */
|
||||
/** The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and an optional 'totalFrames' result of the 'StackTrace' request are supported. */
|
||||
supportsDelayedStackTraceLoading?: boolean;
|
||||
/** The debug adapter supports the 'loadedSources' request. */
|
||||
supportsLoadedSourcesRequest?: boolean;
|
||||
|
@ -1871,7 +1871,7 @@ declare module DebugProtocol {
|
|||
'mostDerivedClass': Indicates that the object is the most derived class.
|
||||
'virtual': Indicates that the object is virtual, that means it is a synthetic object introducedby the
|
||||
adapter for rendering purposes, e.g. an index range for large arrays.
|
||||
'dataBreakpoint': Indicates that a data breakpoint is registered for the object.
|
||||
'dataBreakpoint': Deprecated: Indicates that a data breakpoint is registered for the object. The 'hasDataBreakpoint' attribute should generally be used instead.
|
||||
etc.
|
||||
*/
|
||||
kind?: 'property' | 'method' | 'class' | 'data' | 'event' | 'baseClass' | 'innerClass' | 'interface' | 'mostDerivedClass' | 'virtual' | 'dataBreakpoint' | string;
|
||||
|
@ -1884,9 +1884,10 @@ declare module DebugProtocol {
|
|||
'hasObjectId': Indicates that the object can have an Object ID created for it.
|
||||
'canHaveObjectId': Indicates that the object has an Object ID associated with it.
|
||||
'hasSideEffects': Indicates that the evaluation had side effects.
|
||||
'hasDataBreakpoint': Indicates that the object has its value tracked by a data breakpoint.
|
||||
etc.
|
||||
*/
|
||||
attributes?: ('static' | 'constant' | 'readOnly' | 'rawString' | 'hasObjectId' | 'canHaveObjectId' | 'hasSideEffects' | string)[];
|
||||
attributes?: ('static' | 'constant' | 'readOnly' | 'rawString' | 'hasObjectId' | 'canHaveObjectId' | 'hasSideEffects' | 'hasDataBreakpoint' | string)[];
|
||||
/** Visibility of variable. Before introducing additional values, try to use the listed values.
|
||||
Values: 'public', 'private', 'protected', 'internal', 'final', etc.
|
||||
*/
|
||||
|
|
|
@ -21,6 +21,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
|||
import { IUserDataAutoSyncEnablementService, IUserDataSyncResourceEnablementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { SearchExtensionsAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { IExtension, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService';
|
||||
import { EnablementState, IWorkbenchExtensioManagementService, IWorkbenchExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionIgnoredRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations';
|
||||
|
@ -136,6 +137,7 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
|
|||
@IExtensionIgnoredRecommendationsService private readonly extensionIgnoredRecommendationsService: IExtensionIgnoredRecommendationsService,
|
||||
@IUserDataAutoSyncEnablementService private readonly userDataAutoSyncEnablementService: IUserDataAutoSyncEnablementService,
|
||||
@IUserDataSyncResourceEnablementService private readonly userDataSyncResourceEnablementService: IUserDataSyncResourceEnablementService,
|
||||
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService,
|
||||
@optional(ITASExperimentService) tasExperimentService: ITASExperimentService,
|
||||
) {
|
||||
this.tasExperimentService = tasExperimentService;
|
||||
|
@ -208,6 +210,11 @@ export class ExtensionRecommendationNotificationService implements IExtensionRec
|
|||
return RecommendationsNotificationResult.Ignored;
|
||||
}
|
||||
|
||||
// Do not show exe based recommendations in remote window
|
||||
if (source === RecommendationSource.EXE && this.workbenchEnvironmentService.remoteAuthority) {
|
||||
return RecommendationsNotificationResult.IncompatibleWindow;
|
||||
}
|
||||
|
||||
// Ignore exe recommendation if the window
|
||||
// => has shown an exe based recommendation already
|
||||
// => or has shown any two recommendations already
|
||||
|
|
|
@ -691,8 +691,14 @@ export class ExtensionsListView extends ViewPane {
|
|||
}
|
||||
|
||||
// All recommendations
|
||||
if (/@recommended:all/i.test(query.value) || ExtensionsListView.isSearchRecommendedExtensionsQuery(query.value)) {
|
||||
return this.getAllRecommendationsModel(query, options, token);
|
||||
if (/@recommended:all/i.test(query.value)) {
|
||||
return this.getAllRecommendationsModel(options, token);
|
||||
}
|
||||
|
||||
// Search recommendations
|
||||
if (ExtensionsListView.isSearchRecommendedExtensionsQuery(query.value) ||
|
||||
(ExtensionsListView.isRecommendedExtensionsQuery(query.value) && options.sortBy !== undefined)) {
|
||||
return this.searchRecommendations(query, options, token);
|
||||
}
|
||||
|
||||
// Other recommendations
|
||||
|
@ -728,10 +734,8 @@ export class ExtensionsListView extends ViewPane {
|
|||
}
|
||||
|
||||
private async getWorkspaceRecommendationsModel(query: Query, options: IQueryOptions, token: CancellationToken): Promise<IPagedModel<IExtension>> {
|
||||
const value = query.value.replace(/@recommended:workspace/g, '').trim().toLowerCase();
|
||||
const recommendations = await this.getWorkspaceRecommendations();
|
||||
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, { ...options, source: 'recommendations-workspace' }, token))
|
||||
.filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
||||
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, { ...options, source: 'recommendations-workspace' }, token));
|
||||
this.telemetryService.publicLog2<{ count: number }, WorkspaceRecommendationsClassification>('extensionWorkspaceRecommendations:open', { count: installableRecommendations.length });
|
||||
const result: IExtension[] = coalesce(recommendations.map(id => installableRecommendations.find(i => areSameExtensions(i.identifier, { id }))));
|
||||
return new PagedModel(result);
|
||||
|
@ -753,14 +757,19 @@ export class ExtensionsListView extends ViewPane {
|
|||
}
|
||||
|
||||
private async getOtherRecommendationsModel(query: Query, options: IQueryOptions, token: CancellationToken): Promise<IPagedModel<IExtension>> {
|
||||
const value = query.value.replace(/@recommended/g, '').trim().toLowerCase();
|
||||
const otherRecommendations = await this.getOtherRecommendations();
|
||||
const installableRecommendations = await this.getInstallableRecommendations(otherRecommendations, { ...options, source: 'recommendations-other', sortBy: undefined }, token);
|
||||
const result = coalesce(otherRecommendations.map(id => installableRecommendations.find(i => areSameExtensions(i.identifier, { id }))));
|
||||
return new PagedModel(result);
|
||||
}
|
||||
|
||||
private async getOtherRecommendations(): Promise<string[]> {
|
||||
const local = (await this.extensionsWorkbenchService.queryLocal(this.options.server))
|
||||
.map(e => e.identifier.id.toLowerCase());
|
||||
const workspaceRecommendations = (await this.getWorkspaceRecommendations())
|
||||
.map(extensionId => extensionId.toLowerCase());
|
||||
|
||||
const otherRecommendations = distinct(
|
||||
return distinct(
|
||||
flatten(await Promise.all([
|
||||
// Order is important
|
||||
this.extensionRecommendationsService.getImportantRecommendations(),
|
||||
|
@ -768,16 +777,10 @@ export class ExtensionsListView extends ViewPane {
|
|||
this.extensionRecommendationsService.getOtherRecommendations()
|
||||
])).filter(extensionId => !local.includes(extensionId.toLowerCase()) && !workspaceRecommendations.includes(extensionId.toLowerCase())
|
||||
), extensionId => extensionId.toLowerCase());
|
||||
|
||||
const installableRecommendations = (await this.getInstallableRecommendations(otherRecommendations, { ...options, source: 'recommendations-other', sortBy: undefined }, token))
|
||||
.filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
||||
|
||||
const result: IExtension[] = coalesce(otherRecommendations.map(id => installableRecommendations.find(i => areSameExtensions(i.identifier, { id }))));
|
||||
return new PagedModel(result);
|
||||
}
|
||||
|
||||
// Get All types of recommendations, trimmed to show a max of 8 at any given time
|
||||
private async getAllRecommendationsModel(query: Query, options: IQueryOptions, token: CancellationToken): Promise<IPagedModel<IExtension>> {
|
||||
private async getAllRecommendationsModel(options: IQueryOptions, token: CancellationToken): Promise<IPagedModel<IExtension>> {
|
||||
const local = (await this.extensionsWorkbenchService.queryLocal(this.options.server)).map(e => e.identifier.id.toLowerCase());
|
||||
|
||||
const allRecommendations = distinct(
|
||||
|
@ -795,6 +798,15 @@ export class ExtensionsListView extends ViewPane {
|
|||
return new PagedModel(result.slice(0, 8));
|
||||
}
|
||||
|
||||
private async searchRecommendations(query: Query, options: IQueryOptions, token: CancellationToken): Promise<IPagedModel<IExtension>> {
|
||||
const value = query.value.replace(/@recommended/g, '').trim().toLowerCase();
|
||||
const recommendations = distinct([...await this.getWorkspaceRecommendations(), ...await this.getOtherRecommendations()]);
|
||||
const installableRecommendations = (await this.getInstallableRecommendations(recommendations, { ...options, source: 'recommendations', sortBy: undefined }, token))
|
||||
.filter(extension => extension.identifier.id.toLowerCase().indexOf(value) > -1);
|
||||
const result = coalesce(recommendations.map(id => installableRecommendations.find(i => areSameExtensions(i.identifier, { id }))));
|
||||
return new PagedModel(this.sortExtensions(result, options));
|
||||
}
|
||||
|
||||
// Sorts the firstPage of the pager in the same order as given array of extension ids
|
||||
private sortFirstPage(pager: IPager<IExtension>, ids: string[]) {
|
||||
ids = ids.map(x => x.toLowerCase());
|
||||
|
@ -949,7 +961,7 @@ export class ExtensionsListView extends ViewPane {
|
|||
}
|
||||
|
||||
static isSearchRecommendedExtensionsQuery(query: string): boolean {
|
||||
return /@recommended/i.test(query) && !ExtensionsListView.isRecommendedExtensionsQuery(query);
|
||||
return /@recommended\s.+/i.test(query);
|
||||
}
|
||||
|
||||
static isWorkspaceRecommendedExtensionsQuery(query: string): boolean {
|
||||
|
|
|
@ -326,7 +326,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|||
group: '3_compare',
|
||||
order: 20,
|
||||
command: compareResourceCommand,
|
||||
when: ContextKeyExpr.and(ResourceContextKey.HasResource, ResourceSelectedForCompareContext, WorkbenchListDoubleSelection.toNegated())
|
||||
when: ContextKeyExpr.and(ResourceContextKey.HasResource, ResourceSelectedForCompareContext, ResourceContextKey.IsFileSystemResource, WorkbenchListDoubleSelection.toNegated())
|
||||
});
|
||||
|
||||
const selectForCompareCommand = {
|
||||
|
@ -337,7 +337,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|||
group: '3_compare',
|
||||
order: 30,
|
||||
command: selectForCompareCommand,
|
||||
when: ContextKeyExpr.and(ResourceContextKey.HasResource, WorkbenchListDoubleSelection.toNegated())
|
||||
when: ContextKeyExpr.and(ResourceContextKey.HasResource, ResourceContextKey.IsFileSystemResource, WorkbenchListDoubleSelection.toNegated())
|
||||
});
|
||||
|
||||
const compareSelectedCommand = {
|
||||
|
@ -348,7 +348,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|||
group: '3_compare',
|
||||
order: 30,
|
||||
command: compareSelectedCommand,
|
||||
when: ContextKeyExpr.and(ResourceContextKey.HasResource, WorkbenchListDoubleSelection)
|
||||
when: ContextKeyExpr.and(ResourceContextKey.HasResource, WorkbenchListDoubleSelection, ResourceContextKey.IsFileSystemResource)
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
||||
|
|
|
@ -32,6 +32,8 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
|||
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/browser/notebookEditorInput';
|
||||
import { EditorsOrder } from 'vs/workbench/common/editor';
|
||||
import { INotebookEditorWidgetService } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidgetService';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions';
|
||||
|
||||
// Notebook Commands
|
||||
const EXECUTE_NOTEBOOK_COMMAND_ID = 'notebook.execute';
|
||||
|
@ -149,6 +151,9 @@ abstract class NotebookAction extends Action2 {
|
|||
}
|
||||
}
|
||||
|
||||
const telemetryService = accessor.get(ITelemetryService);
|
||||
telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: this.desc.id, from: 'ui' });
|
||||
|
||||
this.runWithContext(accessor, context);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService'
|
|||
import { ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||
import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEditor';
|
||||
import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { IOutline, IOutlineComparator, IOutlineCreator, IOutlineListConfig, IOutlineService, IQuickPickDataSource, IQuickPickOutlineElement, OutlineChangeEvent, OutlineConfigKeys } from 'vs/workbench/services/outline/browser/outline';
|
||||
import { IOutline, IOutlineComparator, IOutlineCreator, IOutlineListConfig, IOutlineService, IQuickPickDataSource, IQuickPickOutlineElement, OutlineChangeEvent, OutlineConfigKeys, OutlineTarget } from 'vs/workbench/services/outline/browser/outline';
|
||||
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
|
@ -294,6 +294,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
|
|||
|
||||
constructor(
|
||||
private readonly _editor: NotebookEditor,
|
||||
private readonly _target: OutlineTarget,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IEditorService private readonly _editorService: IEditorService,
|
||||
|
@ -332,7 +333,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
|
|||
installSelectionListener();
|
||||
|
||||
const options: IWorkbenchDataTreeOptions<OutlineEntry, FuzzyScore> = {
|
||||
collapseByDefault: true,
|
||||
collapseByDefault: _target === OutlineTarget.Breadcrumbs,
|
||||
expandOnlyOnTwistieClick: true,
|
||||
multipleSelectionSupport: false,
|
||||
accessibilityProvider: new NotebookOutlineAccessibility(),
|
||||
|
@ -381,7 +382,12 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
|
|||
return;
|
||||
}
|
||||
|
||||
const includeCodeCells = this._configurationService.getValue<boolean>('notebook.outline.showCodeCells');
|
||||
let includeCodeCells = true;
|
||||
if (this._target === OutlineTarget.OutlinePane) {
|
||||
includeCodeCells = this._configurationService.getValue<boolean>('notebook.outline.showCodeCells');
|
||||
} else if (this._target === OutlineTarget.Breadcrumbs) {
|
||||
includeCodeCells = this._configurationService.getValue<boolean>('notebook.breadcrumbs.showCodeCells');
|
||||
}
|
||||
|
||||
const [selected] = viewModel.selectionHandles;
|
||||
const entries: OutlineEntry[] = [];
|
||||
|
@ -574,8 +580,8 @@ class NotebookOutlineCreator implements IOutlineCreator<NotebookEditor, OutlineE
|
|||
return candidate.getId() === NotebookEditor.ID;
|
||||
}
|
||||
|
||||
async createOutline(editor: NotebookEditor): Promise<IOutline<OutlineEntry> | undefined> {
|
||||
return this._instantiationService.createInstance(NotebookCellOutline, editor);
|
||||
async createOutline(editor: NotebookEditor, target: OutlineTarget): Promise<IOutline<OutlineEntry> | undefined> {
|
||||
return this._instantiationService.createInstance(NotebookCellOutline, editor, target);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -588,9 +594,14 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).regis
|
|||
type: 'object',
|
||||
'properties': {
|
||||
'notebook.outline.showCodeCells': {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
markdownDescription: localize('outline.showCodeCells', "When enabled notebook outline shows code cells.")
|
||||
},
|
||||
'notebook.breadcrumbs.showCodeCells': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
markdownDescription: localize('showCodeCells', "When enabled notebook outline shows code cells.")
|
||||
}
|
||||
markdownDescription: localize('breadcrumbs.showCodeCells', "When enabled notebook breadcrumbs contain code cells.")
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
|
@ -476,6 +476,14 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
));
|
||||
}
|
||||
|
||||
this._originalWebview?.insetMapping.forEach((value, key) => {
|
||||
this._originalWebview?.removeInset(key);
|
||||
});
|
||||
|
||||
this._modifiedWebview?.insetMapping.forEach((value, key) => {
|
||||
this._modifiedWebview?.removeInset(key);
|
||||
});
|
||||
|
||||
this._diffElementViewModels = diffElementViewModels;
|
||||
this._list.splice(0, this._list.length, diffElementViewModels);
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ import { Webview } from 'vs/workbench/contrib/webview/browser/webview';
|
|||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { configureKernelIcon, errorStateIcon, successStateIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons';
|
||||
import { debugIconStartForeground } from 'vs/workbench/contrib/debug/browser/debugColors';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { extname } from 'vs/base/common/resources';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
||||
|
@ -253,7 +255,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
@IContextMenuService private readonly contextMenuService: IContextMenuService,
|
||||
@IMenuService private readonly menuService: IMenuService,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@IThemeService private readonly themeService: IThemeService
|
||||
@IThemeService private readonly themeService: IThemeService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService
|
||||
) {
|
||||
super();
|
||||
this.isEmbedded = creationOptions.isEmbedded || false;
|
||||
|
@ -658,6 +661,24 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
if (this.viewModel === undefined || !this.viewModel.equal(textModel)) {
|
||||
this._detachModel();
|
||||
await this._attachModel(textModel, viewState);
|
||||
|
||||
type WorkbenchNotebookOpenClassification = {
|
||||
scheme: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
|
||||
ext: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
|
||||
viewType: { classification: 'SystemMetaData', purpose: 'FeatureInsight'; };
|
||||
};
|
||||
|
||||
type WorkbenchNotebookOpenEvent = {
|
||||
scheme: string;
|
||||
ext: string;
|
||||
viewType: string;
|
||||
};
|
||||
|
||||
this.telemetryService.publicLog2<WorkbenchNotebookOpenEvent, WorkbenchNotebookOpenClassification>('notebook/editorOpened', {
|
||||
scheme: textModel.uri.scheme,
|
||||
ext: extname(textModel.uri),
|
||||
viewType: textModel.viewType
|
||||
});
|
||||
} else {
|
||||
this.restoreListViewState(viewState);
|
||||
}
|
||||
|
|
|
@ -353,8 +353,8 @@ export function getExecuteCellPlaceholder(viewCell: BaseCellViewModel) {
|
|||
command: undefined,
|
||||
// text: `${keybinding?.getLabel() || 'Ctrl + Enter'} to run`,
|
||||
// tooltip: `${keybinding?.getLabel() || 'Ctrl + Enter'} to run`,
|
||||
text: isWindows ? 'Ctrl + Alt + Enter' : 'Ctrl + Enter to run',
|
||||
tooltip: isWindows ? 'Ctrl + Alt + Enter' : 'Ctrl + Enter to run',
|
||||
text: isWindows ? 'Ctrl + Alt + Enter to run' : 'Ctrl + Enter to run',
|
||||
tooltip: isWindows ? 'Ctrl + Alt + Enter to run' : 'Ctrl + Enter to run',
|
||||
visible: true,
|
||||
opacity: '0.7'
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@ import { createDecorator, IInstantiationService } from 'vs/platform/instantiatio
|
|||
import { URI } from 'vs/base/common/uri';
|
||||
import { CellUri, INotebookEditorModel } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { NotebookEditorModel } from 'vs/workbench/contrib/notebook/common/notebookEditorModel';
|
||||
import { DisposableStore, IDisposable, IReference, ReferenceCollection } from 'vs/base/common/lifecycle';
|
||||
import { combinedDisposable, DisposableStore, IDisposable, IReference, ReferenceCollection } from 'vs/base/common/lifecycle';
|
||||
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
|
@ -86,14 +86,17 @@ export class NotebookModelResolverService implements INotebookEditorModelResolve
|
|||
|
||||
const reference = this._data.acquire(resource.toString(), viewType);
|
||||
const model = await reference.object;
|
||||
NotebookModelResolverService._autoReferenceDirtyModel(model, () => this._data.acquire(resource.toString(), viewType));
|
||||
const autoRef = NotebookModelResolverService._autoReferenceDirtyModel(model, () => this._data.acquire(resource.toString(), viewType));
|
||||
return {
|
||||
object: model,
|
||||
dispose() { reference.dispose(); }
|
||||
dispose() {
|
||||
reference.dispose();
|
||||
autoRef.dispose();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static _autoReferenceDirtyModel(model: INotebookEditorModel, ref: () => IDisposable) {
|
||||
private static _autoReferenceDirtyModel(model: INotebookEditorModel, ref: () => IDisposable): IDisposable {
|
||||
|
||||
const references = new DisposableStore();
|
||||
const listener = model.onDidChangeDirty(() => {
|
||||
|
@ -104,9 +107,11 @@ export class NotebookModelResolverService implements INotebookEditorModelResolve
|
|||
}
|
||||
});
|
||||
|
||||
Event.once(model.notebook.onWillDispose)(() => {
|
||||
const onceListener = Event.once(model.notebook.onWillDispose)(() => {
|
||||
listener.dispose();
|
||||
references.dispose();
|
||||
});
|
||||
|
||||
return combinedDisposable(references, listener, onceListener);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,6 +211,11 @@ export class OutlinePane extends ViewPane {
|
|||
return;
|
||||
}
|
||||
|
||||
if (cts.token.isCancellationRequested) {
|
||||
newOutline?.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
this._editorDisposables.add(newOutline);
|
||||
this._progressBar.stop().hide();
|
||||
|
||||
|
@ -247,7 +252,6 @@ export class OutlinePane extends ViewPane {
|
|||
this._domNode.classList.remove('message');
|
||||
const state = this._treeStates.get(`${newOutline.outlineKind}/${resource}`);
|
||||
tree.setInput(newOutline, state);
|
||||
tree.expandAll();
|
||||
|
||||
} else {
|
||||
// update: refresh tree
|
||||
|
|
|
@ -206,6 +206,7 @@ export class QueryBuilder {
|
|||
const foldersToSearch: ResourceMap<IFolderQuery> = new ResourceMap();
|
||||
const includePattern: glob.IExpression = {};
|
||||
files.forEach(file => {
|
||||
if (file.scheme === Schemas.walkThrough) { return; }
|
||||
|
||||
const providerExists = isAbsolutePath(file);
|
||||
// Special case userdata as we don't have a search provider for it, but it can be searched.
|
||||
|
|
|
@ -291,7 +291,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
|
|||
return;
|
||||
}
|
||||
|
||||
error = error.replace(/See https:\/\/github\.com\/Squirrel\/Squirrel\.Mac\/issues\/182 for more information/, 'See [this link](https://github.com/microsoft/vscode/issues/7426#issuecomment-425093469) for more information');
|
||||
error = error.replace(/See https:\/\/github\.com\/Squirrel\/Squirrel\.Mac\/issues\/182 for more information/, 'This might mean the application was put on quarantine by macOS. See [this link](https://github.com/microsoft/vscode/issues/7426#issuecomment-425093469) for more information');
|
||||
|
||||
this.notificationService.notify({
|
||||
severity: Severity.Error,
|
||||
|
|
|
@ -186,7 +186,6 @@
|
|||
.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task-action {
|
||||
padding: 6px 12px;
|
||||
font-size: 13px;
|
||||
min-width: 100px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,17 +38,14 @@ That is the tip of the iceberg for multi-cursor editing. Have a look at the sele
|
|||
|
||||
### IntelliSense
|
||||
|
||||
Visual Studio Code comes with the powerful IntelliSense for JavaScript and TypeScript pre-installed. In the below example, position the text cursor in front of the error underline, right after the dot and press kb(editor.action.triggerSuggest) to invoke IntelliSense. Notice how the suggestion comes from the Request API.
|
||||
Visual Studio Code comes with the powerful IntelliSense for JavaScript and TypeScript pre-installed. In the below example, position the text cursor right after the dot and press kb(editor.action.triggerSuggest) to invoke IntelliSense. Notice how the suggestions come from the Canvas API.
|
||||
|
||||
|||js
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const canvas = document.querySelector('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send(|Hello \${req.}|);
|
||||
});
|
||||
|
||||
app.listen(3000);
|
||||
context.strokeStyle = 'blue';
|
||||
context.
|
||||
|||
|
||||
|
||||
>**Tip:** while we ship JavaScript and TypeScript support out of the box other languages can be upgraded with better IntelliSense through one of the many [extensions](command:workbench.extensions.action.showPopularExtensions).
|
||||
|
|
|
@ -159,6 +159,8 @@ export class NativeDialogHandler implements IDialogHandler {
|
|||
let version = this.productService.version;
|
||||
if (this.productService.target) {
|
||||
version = `${version} (${this.productService.target} setup)`;
|
||||
} else if (this.productService.darwinUniversalAssetId) {
|
||||
version = `${version} (Universal)`;
|
||||
}
|
||||
|
||||
const osProps = await this.nativeHostService.getOSProperties();
|
||||
|
|
|
@ -54,7 +54,7 @@ export const content: GettingStartedContent = [
|
|||
title: localize('gettingStarted.runProject.title', "Build & run your app"),
|
||||
description: localize('gettingStarted.runProject.description', "Build, run & debug your code in the cloud, right from the browser."),
|
||||
button: {
|
||||
title: localize('gettingStarted.runProject.button', "Run Code"),
|
||||
title: localize('gettingStarted.runProject.button', "Start Debugging (F5)"),
|
||||
command: 'workbench.action.debug.selectandstart'
|
||||
},
|
||||
doneOn: { commandExecuted: 'workbench.action.debug.selectandstart' },
|
||||
|
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
@ -24,12 +24,9 @@ export class WebUserDataAutoSyncEnablementService extends UserDataAutoSyncEnable
|
|||
setEnablement(enabled: boolean) {
|
||||
if (this.enabled !== enabled) {
|
||||
this.enabled = enabled;
|
||||
if (this.workbenchEnvironmentService.options?.settingsSyncOptions) {
|
||||
if (this.workbenchEnvironmentService.options.settingsSyncOptions?.enablementHandler) {
|
||||
this.workbenchEnvironmentService.options.settingsSyncOptions.enablementHandler(this.enabled);
|
||||
}
|
||||
} else {
|
||||
super.setEnablement(enabled);
|
||||
super.setEnablement(enabled);
|
||||
if (this.workbenchEnvironmentService.options?.settingsSyncOptions?.enablementHandler) {
|
||||
this.workbenchEnvironmentService.options.settingsSyncOptions.enablementHandler(this.enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,9 +93,8 @@ import 'vs/workbench/services/outline/browser/outlineService';
|
|||
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService';
|
||||
import { ExtensionManagementCLIService } from 'vs/platform/extensionManagement/common/extensionManagementCLIService';
|
||||
import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService';
|
||||
import { IExtensionGalleryService, IExtensionManagementCLIService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionGalleryService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IListService, ListService } from 'vs/platform/list/browser/listService';
|
||||
|
@ -127,7 +126,6 @@ registerSingleton(IIgnoredExtensionsManagementService, IgnoredExtensionsManageme
|
|||
registerSingleton(IGlobalExtensionEnablementService, GlobalExtensionEnablementService);
|
||||
registerSingleton(IExtensionsStorageSyncService, ExtensionsStorageSyncService);
|
||||
registerSingleton(IExtensionGalleryService, ExtensionGalleryService, true);
|
||||
registerSingleton(IExtensionManagementCLIService, ExtensionManagementCLIService);
|
||||
registerSingleton(IContextViewService, ContextViewService, true);
|
||||
registerSingleton(IListService, ListService, true);
|
||||
registerSingleton(IEditorWorkerService, EditorWorkerServiceImpl);
|
||||
|
|
|
@ -434,25 +434,15 @@ interface IPerformanceMark {
|
|||
interface IWorkbench {
|
||||
|
||||
commands: {
|
||||
|
||||
/**
|
||||
* Allows to execute a command, either built-in or from extensions.
|
||||
* @see [executeCommand](#commands.executeCommand)
|
||||
*/
|
||||
executeCommand(command: string, ...args: any[]): Promise<unknown>;
|
||||
}
|
||||
|
||||
env: {
|
||||
|
||||
/**
|
||||
* Retrieve performance marks that have been collected during startup. This function
|
||||
* returns tuples of source and marks. A source is a dedicated context, like
|
||||
* the renderer or an extension host.
|
||||
*
|
||||
* *Note* that marks can be collected on different machines and in different processes
|
||||
* and that therefore "different clocks" are used. So, comparing `startTime`-properties
|
||||
* across contexts should be taken with a grain of salt.
|
||||
*
|
||||
* @returns A promise that resolves to tuples of source and marks.
|
||||
* @see [retrievePerformanceMarks](#commands.retrievePerformanceMarks)
|
||||
*/
|
||||
retrievePerformanceMarks(): Promise<[string, readonly IPerformanceMark[]][]>;
|
||||
}
|
||||
|
@ -536,6 +526,26 @@ namespace commands {
|
|||
}
|
||||
}
|
||||
|
||||
namespace env {
|
||||
|
||||
/**
|
||||
* Retrieve performance marks that have been collected during startup. This function
|
||||
* returns tuples of source and marks. A source is a dedicated context, like
|
||||
* the renderer or an extension host.
|
||||
*
|
||||
* *Note* that marks can be collected on different machines and in different processes
|
||||
* and that therefore "different clocks" are used. So, comparing `startTime`-properties
|
||||
* across contexts should be taken with a grain of salt.
|
||||
*
|
||||
* @returns A promise that resolves to tuples of source and marks.
|
||||
*/
|
||||
export async function retrievePerformanceMarks(): Promise<[string, readonly IPerformanceMark[]][]> {
|
||||
const workbench = await workbenchPromise;
|
||||
|
||||
return workbench.env.retrievePerformanceMarks();
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
// Factory
|
||||
|
@ -620,7 +630,8 @@ export {
|
|||
IDefaultLayout,
|
||||
|
||||
// Env
|
||||
IPerformanceMark
|
||||
IPerformanceMark,
|
||||
env
|
||||
};
|
||||
|
||||
//#endregion
|
||||
|
|
5
test/monaco/.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
dist/**/*.js
|
||||
dist/**/*.ttf
|
||||
/dist/**/*.js
|
||||
/dist/**/*.ttf
|
||||
/out/
|
||||
|
|
|
@ -75,8 +75,8 @@ describe('API Integration Tests', function (): void {
|
|||
await page.goto(APP);
|
||||
});
|
||||
|
||||
it('Default initialization should be error-less', async function (): Promise<any> {
|
||||
assert.equal(await page.evaluate(`monaco.editor.DefaultEndOfLine[1]`), 'LF');
|
||||
it('`monaco` is not exposed as global', async function (): Promise<any> {
|
||||
assert.equal(await page.evaluate(`typeof monaco`), 'undefined');
|
||||
});
|
||||
|
||||
it('Focus and Type', async function (): Promise<any> {
|
||||
|
|
|
@ -9965,10 +9965,10 @@ vm-browserify@^1.0.1:
|
|||
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
|
||||
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
|
||||
|
||||
vscode-debugprotocol@1.43.0:
|
||||
version "1.43.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.43.0.tgz#fe5bcfa7021c250e78c3cf203d392e98b5de268c"
|
||||
integrity sha512-pnj+9wVS3yPYz/RXoYSN1tCv+D4139ueaY2WC7V6fUd9QZU8IE5s4r/lZUMJ9gAEGz2km/Iv4qcI7Fdlz5xS9w==
|
||||
vscode-debugprotocol@1.44.0:
|
||||
version "1.44.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.44.0.tgz#79d11844f908cc5104afc303b3780ad2e5fd486a"
|
||||
integrity sha512-qf+eBnrDyR2MpP08y1JfzJnFZGHdkk86+SRGRp0XepDGNA6n/Nann5XhtAzdGX/yaZokjTAINK313S2yYhHoPQ==
|
||||
|
||||
vscode-nls-dev@^3.3.1:
|
||||
version "3.3.1"
|
||||
|
|