mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Merge branch 'main' into joh/vscode-dts
This commit is contained in:
commit
d90dd1355b
2
.yarnrc
2
.yarnrc
|
@ -1,4 +1,4 @@
|
||||||
disturl "https://electronjs.org/headers"
|
disturl "https://electronjs.org/headers"
|
||||||
target "13.5.1"
|
target "13.5.2"
|
||||||
runtime "electron"
|
runtime "electron"
|
||||||
build_from_source "true"
|
build_from_source "true"
|
||||||
|
|
|
@ -233,7 +233,7 @@ steps:
|
||||||
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
||||||
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
||||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
|
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
|
||||||
yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests
|
yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests-remote
|
||||||
timeoutInMinutes: 5
|
timeoutInMinutes: 5
|
||||||
displayName: Run smoke tests (Remote)
|
displayName: Run smoke tests (Remote)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
|
@ -220,7 +220,7 @@ steps:
|
||||||
set -e
|
set -e
|
||||||
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
|
APP_PATH=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)
|
||||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
|
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \
|
||||||
yarn smoketest-no-compile --build "$APP_PATH" --remote --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests
|
yarn smoketest-no-compile --build "$APP_PATH" --remote --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" --screenshots $(Build.SourcesDirectory)/.build/logs/smoke-tests-remote
|
||||||
timeoutInMinutes: 5
|
timeoutInMinutes: 5
|
||||||
displayName: Run smoke tests (Remote)
|
displayName: Run smoke tests (Remote)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
|
@ -216,7 +216,7 @@ steps:
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||||
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"
|
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"
|
||||||
exec { yarn smoketest-no-compile --build "$AppRoot" --remote }
|
exec { yarn smoketest-no-compile --build "$AppRoot" --remote --screenshots $(Build.SourcesDirectory)\.build\logs\smoke-tests-remote }
|
||||||
displayName: Run smoke tests (Remote)
|
displayName: Run smoke tests (Remote)
|
||||||
timeoutInMinutes: 5
|
timeoutInMinutes: 5
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||||
|
|
|
@ -7,7 +7,7 @@ module.exports = new class ApiEventNaming {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.meta = {
|
this.meta = {
|
||||||
messages: {
|
messages: {
|
||||||
comment: 'region comments should start with the GH issue link, e.g #region https://github.com/microsoft/vscode/issues/<number>',
|
comment: 'region comments should start with a camel case identifier, `:`, then either a GH issue link or owner, e.g #region myProposalName: https://github.com/microsoft/vscode/issues/<number>',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,14 @@ module.exports = new class ApiEventNaming {
|
||||||
const sourceCode = context.getSourceCode();
|
const sourceCode = context.getSourceCode();
|
||||||
return {
|
return {
|
||||||
['Program']: (_node) => {
|
['Program']: (_node) => {
|
||||||
for (let comment of sourceCode.getAllComments()) {
|
for (const comment of sourceCode.getAllComments()) {
|
||||||
if (comment.type !== 'Line') {
|
if (comment.type !== 'Line') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!comment.value.match(/^\s*#region /)) {
|
if (!/^\s*#region /.test(comment.value)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!comment.value.match(/https:\/\/github.com\/microsoft\/vscode\/issues\/\d+/i)) {
|
if (!/^\s*#region ([a-z]+): (@[a-z]+|https:\/\/github.com\/microsoft\/vscode\/issues\/\d+)/i.test(comment.value)) {
|
||||||
context.report({
|
context.report({
|
||||||
node: comment,
|
node: comment,
|
||||||
messageId: 'comment',
|
messageId: 'comment',
|
||||||
|
|
|
@ -9,7 +9,7 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {
|
||||||
|
|
||||||
readonly meta: eslint.Rule.RuleMetaData = {
|
readonly meta: eslint.Rule.RuleMetaData = {
|
||||||
messages: {
|
messages: {
|
||||||
comment: 'region comments should start with the GH issue link, e.g #region https://github.com/microsoft/vscode/issues/<number>',
|
comment: 'region comments should start with a camel case identifier, `:`, then either a GH issue link or owner, e.g #region myProposalName: https://github.com/microsoft/vscode/issues/<number>',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,18 +17,16 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {
|
||||||
|
|
||||||
const sourceCode = context.getSourceCode();
|
const sourceCode = context.getSourceCode();
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
['Program']: (_node: any) => {
|
['Program']: (_node: any) => {
|
||||||
|
for (const comment of sourceCode.getAllComments()) {
|
||||||
for (let comment of sourceCode.getAllComments()) {
|
|
||||||
if (comment.type !== 'Line') {
|
if (comment.type !== 'Line') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!comment.value.match(/^\s*#region /)) {
|
if (!/^\s*#region /.test(comment.value)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!comment.value.match(/https:\/\/github.com\/microsoft\/vscode\/issues\/\d+/i)) {
|
if (!/^\s*#region ([a-z]+): (@[a-z]+|https:\/\/github.com\/microsoft\/vscode\/issues\/\d+)/i.test(comment.value)) {
|
||||||
context.report({
|
context.report({
|
||||||
node: <any>comment,
|
node: <any>comment,
|
||||||
messageId: 'comment',
|
messageId: 'comment',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "monaco-editor-core",
|
"name": "monaco-editor-core",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.29.2",
|
"version": "0.30.0",
|
||||||
"description": "A browser based code editor",
|
"description": "A browser based code editor",
|
||||||
"author": "Microsoft Corporation",
|
"author": "Microsoft Corporation",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
VSCODE_GIT_ASKPASS_PIPE=`mktemp`
|
VSCODE_GIT_ASKPASS_PIPE=`mktemp`
|
||||||
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_MAIN" $*
|
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_EXTRA_ARGS" "$VSCODE_GIT_ASKPASS_MAIN" $*
|
||||||
cat $VSCODE_GIT_ASKPASS_PIPE
|
cat $VSCODE_GIT_ASKPASS_PIPE
|
||||||
rm $VSCODE_GIT_ASKPASS_PIPE
|
rm $VSCODE_GIT_ASKPASS_PIPE
|
||||||
|
|
|
@ -83,6 +83,7 @@ export class Askpass implements IIPCHandler {
|
||||||
...this.ipc.getEnv(),
|
...this.ipc.getEnv(),
|
||||||
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
|
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
|
||||||
VSCODE_GIT_ASKPASS_NODE: process.execPath,
|
VSCODE_GIT_ASKPASS_NODE: process.execPath,
|
||||||
|
VSCODE_GIT_ASKPASS_EXTRA_ARGS: (process.versions['electron'] && process.versions['microsoft-build']) ? '--ms-enable-electron-run-as-node' : '',
|
||||||
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
|
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,7 @@ export class Model implements IRemoteSourceProviderRegistry, IPushErrorHandlerRe
|
||||||
const repository = new Repository(this.git.open(repositoryRoot, dotGit), this, this, this.globalState, this.outputChannel);
|
const repository = new Repository(this.git.open(repositoryRoot, dotGit), this, this, this.globalState, this.outputChannel);
|
||||||
|
|
||||||
this.open(repository);
|
this.open(repository);
|
||||||
await repository.status();
|
repository.status(); // do not await this, we want SCM to know about the repo asap
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// noop
|
// noop
|
||||||
this.outputChannel.appendLine(`Opening repository for path='${repoPath}' failed; ex=${ex}`);
|
this.outputChannel.appendLine(`Opening repository for path='${repoPath}' failed; ex=${ex}`);
|
||||||
|
|
|
@ -29,10 +29,6 @@ export const activate: ActivationFunction<void> = (ctx) => {
|
||||||
|
|
||||||
const style = document.createElement('style');
|
const style = document.createElement('style');
|
||||||
style.textContent = `
|
style.textContent = `
|
||||||
#preview {
|
|
||||||
font-size: 1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.emptyMarkdownCell::before {
|
.emptyMarkdownCell::before {
|
||||||
content: "${document.documentElement.style.getPropertyValue('--notebook-cell-markup-empty-content')}";
|
content: "${document.documentElement.style.getPropertyValue('--notebook-cell-markup-empty-content')}";
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
@ -165,7 +161,6 @@ export const activate: ActivationFunction<void> = (ctx) => {
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
font-family: var(--vscode-editor-font-family);
|
font-family: var(--vscode-editor-font-family);
|
||||||
font-size: var(--vscode-editor-font-size);
|
|
||||||
|
|
||||||
line-height: 1.357em;
|
line-height: 1.357em;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
|
|
@ -120,6 +120,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||||
private imageInfo: { readonly id: string, readonly width: number, readonly height: number; }[] = [];
|
private imageInfo: { readonly id: string, readonly width: number, readonly height: number; }[] = [];
|
||||||
|
|
||||||
private readonly _fileWatchersBySrc = new Map</* src: */ string, vscode.FileSystemWatcher>();
|
private readonly _fileWatchersBySrc = new Map</* src: */ string, vscode.FileSystemWatcher>();
|
||||||
|
|
||||||
private readonly _onScrollEmitter = this._register(new vscode.EventEmitter<LastScrollLocation>());
|
private readonly _onScrollEmitter = this._register(new vscode.EventEmitter<LastScrollLocation>());
|
||||||
public readonly onScroll = this._onScrollEmitter.event;
|
public readonly onScroll = this._onScrollEmitter.event;
|
||||||
|
|
||||||
|
@ -262,13 +263,13 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||||
* The first call immediately refreshes the preview,
|
* The first call immediately refreshes the preview,
|
||||||
* calls happening shortly thereafter are debounced.
|
* calls happening shortly thereafter are debounced.
|
||||||
*/
|
*/
|
||||||
public refresh() {
|
public refresh(forceUpdate: boolean = false) {
|
||||||
// Schedule update if none is pending
|
// Schedule update if none is pending
|
||||||
if (!this.throttleTimer) {
|
if (!this.throttleTimer) {
|
||||||
if (this.firstUpdate) {
|
if (this.firstUpdate) {
|
||||||
this.updatePreview(true);
|
this.updatePreview(true);
|
||||||
} else {
|
} else {
|
||||||
this.throttleTimer = setTimeout(() => this.updatePreview(true), this.delay);
|
this.throttleTimer = setTimeout(() => this.updatePreview(forceUpdate), this.delay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +334,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const shouldReloadPage = !this.currentVersion || this.currentVersion.resource.toString() !== pendingVersion.resource.toString();
|
const shouldReloadPage = forceUpdate || !this.currentVersion || this.currentVersion.resource.toString() !== pendingVersion.resource.toString();
|
||||||
this.currentVersion = pendingVersion;
|
this.currentVersion = pendingVersion;
|
||||||
|
|
||||||
const content = await (shouldReloadPage
|
const content = await (shouldReloadPage
|
||||||
|
@ -429,7 +430,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||||
if (uri && uri.scheme === 'file' && !this._fileWatchersBySrc.has(src)) {
|
if (uri && uri.scheme === 'file' && !this._fileWatchersBySrc.has(src)) {
|
||||||
const watcher = vscode.workspace.createFileSystemWatcher(uri.fsPath);
|
const watcher = vscode.workspace.createFileSystemWatcher(uri.fsPath);
|
||||||
watcher.onDidChange(() => {
|
watcher.onDidChange(() => {
|
||||||
this.refresh();
|
this.refresh(true);
|
||||||
});
|
});
|
||||||
this._fileWatchersBySrc.set(src, watcher);
|
this._fileWatchersBySrc.set(src, watcher);
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,6 +240,7 @@ export class AzureActiveDirectoryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (added.length || removed.length) {
|
if (added.length || removed.length) {
|
||||||
|
Logger.info(`Sending change event with ${added.length} added and ${removed.length} removed`);
|
||||||
onDidChangeSessions.fire({ added: added, removed: removed, changed: [] });
|
onDidChangeSessions.fire({ added: added, removed: removed, changed: [] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +381,7 @@ export class AzureActiveDirectoryService {
|
||||||
throw codeRes.err;
|
throw codeRes.err;
|
||||||
}
|
}
|
||||||
token = await this.exchangeCodeForToken(codeRes.code, codeVerifier, scope);
|
token = await this.exchangeCodeForToken(codeRes.code, codeVerifier, scope);
|
||||||
this.setToken(token, scope);
|
await this.setToken(token, scope);
|
||||||
Logger.info(`Login successful for scopes: ${scope}`);
|
Logger.info(`Login successful for scopes: ${scope}`);
|
||||||
res.writeHead(302, { Location: '/' });
|
res.writeHead(302, { Location: '/' });
|
||||||
const session = await this.convertToSession(token);
|
const session = await this.convertToSession(token);
|
||||||
|
@ -491,7 +492,7 @@ export class AzureActiveDirectoryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = await this.exchangeCodeForToken(code, verifier, scope);
|
const token = await this.exchangeCodeForToken(code, verifier, scope);
|
||||||
this.setToken(token, scope);
|
await this.setToken(token, scope);
|
||||||
|
|
||||||
const session = await this.convertToSession(token);
|
const session = await this.convertToSession(token);
|
||||||
resolve(session);
|
resolve(session);
|
||||||
|
@ -509,6 +510,7 @@ export class AzureActiveDirectoryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async setToken(token: IToken, scope: string): Promise<void> {
|
private async setToken(token: IToken, scope: string): Promise<void> {
|
||||||
|
Logger.info(`Setting token for scopes: ${scope}`);
|
||||||
const existingTokenIndex = this._tokens.findIndex(t => t.sessionId === token.sessionId);
|
const existingTokenIndex = this._tokens.findIndex(t => t.sessionId === token.sessionId);
|
||||||
if (existingTokenIndex > -1) {
|
if (existingTokenIndex > -1) {
|
||||||
this._tokens.splice(existingTokenIndex, 1, token);
|
this._tokens.splice(existingTokenIndex, 1, token);
|
||||||
|
@ -522,6 +524,7 @@ export class AzureActiveDirectoryService {
|
||||||
this._refreshTimeouts.set(token.sessionId, setTimeout(async () => {
|
this._refreshTimeouts.set(token.sessionId, setTimeout(async () => {
|
||||||
try {
|
try {
|
||||||
const refreshedToken = await this.refreshToken(token.refreshToken, scope, token.sessionId);
|
const refreshedToken = await this.refreshToken(token.refreshToken, scope, token.sessionId);
|
||||||
|
Logger.info('Triggering change session event...');
|
||||||
onDidChangeSessions.fire({ added: [], removed: [], changed: [this.convertToSessionSync(refreshedToken)] });
|
onDidChangeSessions.fire({ added: [], removed: [], changed: [this.convertToSessionSync(refreshedToken)] });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.message === REFRESH_NETWORK_FAILURE) {
|
if (e.message === REFRESH_NETWORK_FAILURE) {
|
||||||
|
@ -537,7 +540,7 @@ export class AzureActiveDirectoryService {
|
||||||
}, 1000 * (token.expiresIn - 30)));
|
}, 1000 * (token.expiresIn - 30)));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.storeTokenData();
|
await this.storeTokenData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getTokenFromResponse(json: ITokenResponse, scope: string, existingId?: string): IToken {
|
private getTokenFromResponse(json: ITokenResponse, scope: string, existingId?: string): IToken {
|
||||||
|
@ -649,7 +652,7 @@ export class AzureActiveDirectoryService {
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
const json = await result.json();
|
const json = await result.json();
|
||||||
const token = this.getTokenFromResponse(json, scope, sessionId);
|
const token = this.getTokenFromResponse(json, scope, sessionId);
|
||||||
this.setToken(token, scope);
|
await this.setToken(token, scope);
|
||||||
Logger.info(`Token refresh success for scopes: ${token.scope}`);
|
Logger.info(`Token refresh success for scopes: ${token.scope}`);
|
||||||
return token;
|
return token;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -83,6 +83,10 @@ export function activate(context: vscode.ExtensionContext) {
|
||||||
const commandArgs = ['--port=0', '--disable-telemetry'];
|
const commandArgs = ['--port=0', '--disable-telemetry'];
|
||||||
const env = getNewEnv();
|
const env = getNewEnv();
|
||||||
const remoteDataDir = process.env['TESTRESOLVER_DATA_FOLDER'] || path.join(os.homedir(), serverDataFolderName || `${dataFolderName}-testresolver`);
|
const remoteDataDir = process.env['TESTRESOLVER_DATA_FOLDER'] || path.join(os.homedir(), serverDataFolderName || `${dataFolderName}-testresolver`);
|
||||||
|
const logsDir = process.env['TESTRESOLVER_LOGS_FOLDER'];
|
||||||
|
if (logsDir) {
|
||||||
|
commandArgs.push('--logsPath', logsDir);
|
||||||
|
}
|
||||||
|
|
||||||
env['VSCODE_AGENT_FOLDER'] = remoteDataDir;
|
env['VSCODE_AGENT_FOLDER'] = remoteDataDir;
|
||||||
outputChannel.appendLine(`Using data folder at ${remoteDataDir}`);
|
outputChannel.appendLine(`Using data folder at ${remoteDataDir}`);
|
||||||
|
|
16
package.json
16
package.json
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "code-oss-dev",
|
"name": "code-oss-dev",
|
||||||
"version": "1.63.0",
|
"version": "1.63.0",
|
||||||
"distro": "f4a21145f5ec390f681f48c7140bf4f60d2987ac",
|
"distro": "cc8976e5470edb06e4b3abd29841ffe7bf5042d2",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Microsoft Corporation"
|
"name": "Microsoft Corporation"
|
||||||
},
|
},
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@microsoft/applicationinsights-web": "^2.6.4",
|
"@microsoft/applicationinsights-web": "^2.6.4",
|
||||||
"@parcel/watcher": "2.0.0",
|
"@parcel/watcher": "2.0.1",
|
||||||
"@vscode/sqlite3": "4.0.12",
|
"@vscode/sqlite3": "4.0.12",
|
||||||
"@vscode/vscode-languagedetection": "1.0.21",
|
"@vscode/vscode-languagedetection": "1.0.21",
|
||||||
"applicationinsights": "1.0.8",
|
"applicationinsights": "1.0.8",
|
||||||
|
@ -84,12 +84,12 @@
|
||||||
"vscode-regexpp": "^3.1.0",
|
"vscode-regexpp": "^3.1.0",
|
||||||
"vscode-ripgrep": "^1.12.1",
|
"vscode-ripgrep": "^1.12.1",
|
||||||
"vscode-textmate": "5.4.1",
|
"vscode-textmate": "5.4.1",
|
||||||
"xterm": "4.15.0-beta.10",
|
"xterm": "4.16.0-beta.2",
|
||||||
"xterm-addon-search": "0.9.0-beta.5",
|
"xterm-addon-search": "0.9.0-beta.6",
|
||||||
"xterm-addon-serialize": "0.7.0-beta.2",
|
"xterm-addon-serialize": "0.7.0-beta.3",
|
||||||
"xterm-addon-unicode11": "0.3.0",
|
"xterm-addon-unicode11": "0.4.0-beta.1",
|
||||||
"xterm-addon-webgl": "0.12.0-beta.15",
|
"xterm-addon-webgl": "0.12.0-beta.16",
|
||||||
"xterm-headless": "4.15.0-beta.10",
|
"xterm-headless": "4.16.0-beta.2",
|
||||||
"yauzl": "^2.9.2",
|
"yauzl": "^2.9.2",
|
||||||
"yazl": "^2.4.3"
|
"yazl": "^2.4.3"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@microsoft/applicationinsights-web": "^2.6.4",
|
"@microsoft/applicationinsights-web": "^2.6.4",
|
||||||
"@parcel/watcher": "2.0.0",
|
"@parcel/watcher": "2.0.1",
|
||||||
"@vscode/vscode-languagedetection": "1.0.21",
|
"@vscode/vscode-languagedetection": "1.0.21",
|
||||||
"applicationinsights": "1.0.8",
|
"applicationinsights": "1.0.8",
|
||||||
"cookie": "^0.4.0",
|
"cookie": "^0.4.0",
|
||||||
|
@ -24,12 +24,12 @@
|
||||||
"vscode-regexpp": "^3.1.0",
|
"vscode-regexpp": "^3.1.0",
|
||||||
"vscode-ripgrep": "^1.12.1",
|
"vscode-ripgrep": "^1.12.1",
|
||||||
"vscode-textmate": "5.4.1",
|
"vscode-textmate": "5.4.1",
|
||||||
"xterm": "4.15.0-beta.10",
|
"xterm": "4.16.0-beta.2",
|
||||||
"xterm-addon-search": "0.9.0-beta.5",
|
"xterm-addon-search": "0.9.0-beta.6",
|
||||||
"xterm-addon-serialize": "0.7.0-beta.2",
|
"xterm-addon-serialize": "0.7.0-beta.3",
|
||||||
"xterm-addon-unicode11": "0.3.0",
|
"xterm-addon-unicode11": "0.4.0-beta.1",
|
||||||
"xterm-addon-webgl": "0.12.0-beta.15",
|
"xterm-addon-webgl": "0.12.0-beta.16",
|
||||||
"xterm-headless": "4.15.0-beta.10",
|
"xterm-headless": "4.16.0-beta.2",
|
||||||
"yauzl": "^2.9.2",
|
"yauzl": "^2.9.2",
|
||||||
"yazl": "^2.4.3"
|
"yazl": "^2.4.3"
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
"tas-client-umd": "0.1.4",
|
"tas-client-umd": "0.1.4",
|
||||||
"vscode-oniguruma": "1.5.1",
|
"vscode-oniguruma": "1.5.1",
|
||||||
"vscode-textmate": "5.4.1",
|
"vscode-textmate": "5.4.1",
|
||||||
"xterm": "4.15.0-beta.10",
|
"xterm": "4.16.0-beta.2",
|
||||||
"xterm-addon-search": "0.9.0-beta.5",
|
"xterm-addon-search": "0.9.0-beta.6",
|
||||||
"xterm-addon-unicode11": "0.3.0",
|
"xterm-addon-unicode11": "0.4.0-beta.1",
|
||||||
"xterm-addon-webgl": "0.12.0-beta.15"
|
"xterm-addon-webgl": "0.12.0-beta.16"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,22 +113,22 @@ vscode-textmate@5.4.1:
|
||||||
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.4.1.tgz#09d566724fc76b60b3ad9791eebf1f0b50f29e5a"
|
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.4.1.tgz#09d566724fc76b60b3ad9791eebf1f0b50f29e5a"
|
||||||
integrity sha512-4CvPHmfuZQaXrcCpathdh6jo7myuR+MU8BvscgQADuponpbqfmu2rwTOtCXhGwwEgStvJF8V4s9FwMKRVLNmKQ==
|
integrity sha512-4CvPHmfuZQaXrcCpathdh6jo7myuR+MU8BvscgQADuponpbqfmu2rwTOtCXhGwwEgStvJF8V4s9FwMKRVLNmKQ==
|
||||||
|
|
||||||
xterm-addon-search@0.9.0-beta.5:
|
xterm-addon-search@0.9.0-beta.6:
|
||||||
version "0.9.0-beta.5"
|
version "0.9.0-beta.6"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0-beta.5.tgz#e0e60a203d1c9d6c8af933648a46865dba299302"
|
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0-beta.6.tgz#8b016baac5580dc0ba93bb52610bc4f5776d3b17"
|
||||||
integrity sha512-ylfqim0ISBvuuX83LQwgu/06p5GC545QsAo9SssXw03TPpIrcd0zwaVMEnhOftSIzM9EKRRsyx3GbBjgUdiF5w==
|
integrity sha512-UAEzas4O+NrF7BSGf0C9N5ngAkmbtr/hSTFvLAM/Rw7EfLUatf8aLMqAWZTggRGMwDjuqR0GXJI4+e5QrJhQfw==
|
||||||
|
|
||||||
xterm-addon-unicode11@0.3.0:
|
xterm-addon-unicode11@0.4.0-beta.1:
|
||||||
version "0.3.0"
|
version "0.4.0-beta.1"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.3.0.tgz#e4435c3c91a5294a7eb8b79c380acbb28a659463"
|
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.4.0-beta.1.tgz#aeefd26e87bad15d8dfd8a1e0b804fe408c9b882"
|
||||||
integrity sha512-x5fHDZT2j9tlTlHnzPHt++9uKZ2kJ/lYQOj3L6xJA22xoJsS8UQRw/5YIFg2FUHqEAbV77Z1fZij/9NycMSH/A==
|
integrity sha512-pG8mpxnqpYDry0e20vuEFKhd4kKIcLLNwdNftNvfo+R/EjYRnTYnF+H8L+7eQHq6hqDH61xCEP4H4qR2CyT4pg==
|
||||||
|
|
||||||
xterm-addon-webgl@0.12.0-beta.15:
|
xterm-addon-webgl@0.12.0-beta.16:
|
||||||
version "0.12.0-beta.15"
|
version "0.12.0-beta.16"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.12.0-beta.15.tgz#9ae82127f2a39b3cb7f5ae45a6af223810c933d4"
|
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.12.0-beta.16.tgz#63a0f1f5be9e66286e035448e2011e3065769ad5"
|
||||||
integrity sha512-LWZ3iLspQOCc26OoT8qa+SuyuIcn2cAMRbBkinOuQCk4aW5kjovIrGovj9yVAcXNvOBnPm3sUqmnwGlN579kDA==
|
integrity sha512-g6v3RegOhSsD9Zt8ArWBMNT30QyPUlIWEIvP/xLHAluUZ1S5sDjFyZDB0nJAyn9MwQozJpwb0ylYO1nznN/TzA==
|
||||||
|
|
||||||
xterm@4.15.0-beta.10:
|
xterm@4.16.0-beta.2:
|
||||||
version "4.15.0-beta.10"
|
version "4.16.0-beta.2"
|
||||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.15.0-beta.10.tgz#8cda3d7885e8345f2fc6cf9275a43f3833d29acf"
|
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.16.0-beta.2.tgz#251beef21a232143f272da74c7005bc4d832ca79"
|
||||||
integrity sha512-valoh5ZcY/y7Pe+ffgcSAEFeuZfjzVeUUXcthdxTTsrGEiU1s4QR2EOg4U5jn5wye/Nc6mSfLW3s79R6Ac186w==
|
integrity sha512-PD0agueJ7qvbn1/QhZriAQXf+ykaoPKgQN9qiIGf88VMxHs8T47MYHW/+qPsrXagTmbrENtncughTIzOzv8Q5Q==
|
||||||
|
|
|
@ -83,10 +83,10 @@
|
||||||
resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.4.tgz#40e1c0ad20743fcee1604a7df2c57faf0aa1af87"
|
resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.4.tgz#40e1c0ad20743fcee1604a7df2c57faf0aa1af87"
|
||||||
integrity sha512-Ot53G927ykMF8cQ3/zq4foZtdk+Tt1YpX7aUTHxBU7UHNdkEiBvBfZSq+rnlUmKCJ19VatwPG4mNzvcGpBj4og==
|
integrity sha512-Ot53G927ykMF8cQ3/zq4foZtdk+Tt1YpX7aUTHxBU7UHNdkEiBvBfZSq+rnlUmKCJ19VatwPG4mNzvcGpBj4og==
|
||||||
|
|
||||||
"@parcel/watcher@2.0.0":
|
"@parcel/watcher@2.0.1":
|
||||||
version "2.0.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.0.0.tgz#ebe992a4838b35c3da9a568eb95a71cb26ddf551"
|
resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.0.1.tgz#ec4bb6c43d9588a1ffd3d2abe6df5b501463c62d"
|
||||||
integrity sha512-ByalKmRRXNNAhwZ0X1r0XeIhh1jG8zgdlvjgHk9ZV3YxiersEGNQkwew+RfqJbIL4gOJfvC2ey6lg5kaeRainw==
|
integrity sha512-XegFF4L8sFn1RzU5KKOZxXUuzgOSwd6+X2ez3Cy6MVhYMbiLZ1moceMTqDhuT3N8DNbdumK3zP1wojsIsnX40w==
|
||||||
dependencies:
|
dependencies:
|
||||||
node-addon-api "^3.2.1"
|
node-addon-api "^3.2.1"
|
||||||
node-gyp-build "^4.3.0"
|
node-gyp-build "^4.3.0"
|
||||||
|
@ -541,35 +541,35 @@ xregexp@2.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943"
|
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943"
|
||||||
integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=
|
integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=
|
||||||
|
|
||||||
xterm-addon-search@0.9.0-beta.5:
|
xterm-addon-search@0.9.0-beta.6:
|
||||||
version "0.9.0-beta.5"
|
version "0.9.0-beta.6"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0-beta.5.tgz#e0e60a203d1c9d6c8af933648a46865dba299302"
|
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0-beta.6.tgz#8b016baac5580dc0ba93bb52610bc4f5776d3b17"
|
||||||
integrity sha512-ylfqim0ISBvuuX83LQwgu/06p5GC545QsAo9SssXw03TPpIrcd0zwaVMEnhOftSIzM9EKRRsyx3GbBjgUdiF5w==
|
integrity sha512-UAEzas4O+NrF7BSGf0C9N5ngAkmbtr/hSTFvLAM/Rw7EfLUatf8aLMqAWZTggRGMwDjuqR0GXJI4+e5QrJhQfw==
|
||||||
|
|
||||||
xterm-addon-serialize@0.7.0-beta.2:
|
xterm-addon-serialize@0.7.0-beta.3:
|
||||||
version "0.7.0-beta.2"
|
version "0.7.0-beta.3"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-serialize/-/xterm-addon-serialize-0.7.0-beta.2.tgz#ced9f664c74ab88448e7b63850721bc272aa6806"
|
resolved "https://registry.yarnpkg.com/xterm-addon-serialize/-/xterm-addon-serialize-0.7.0-beta.3.tgz#a8ce52a59685041bd3b6d6a2a77a3df8bc3daf29"
|
||||||
integrity sha512-KuSwdx2AAliUv7SvjKYUKHrB7vscbHLv8QsmwSDI3pgL1BpjyLJ8LR99iFFfuNpPW9CG4TX6adKPIJXtqiN3Vg==
|
integrity sha512-fgB0h8JiSN1cOMh3slenysprnGfFwbDZ/D38WA0Pdjxf3YDy4j2SwoUajlvXpkFWR7sHjVHmgpw/nHggO731KA==
|
||||||
|
|
||||||
xterm-addon-unicode11@0.3.0:
|
xterm-addon-unicode11@0.4.0-beta.1:
|
||||||
version "0.3.0"
|
version "0.4.0-beta.1"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.3.0.tgz#e4435c3c91a5294a7eb8b79c380acbb28a659463"
|
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.4.0-beta.1.tgz#aeefd26e87bad15d8dfd8a1e0b804fe408c9b882"
|
||||||
integrity sha512-x5fHDZT2j9tlTlHnzPHt++9uKZ2kJ/lYQOj3L6xJA22xoJsS8UQRw/5YIFg2FUHqEAbV77Z1fZij/9NycMSH/A==
|
integrity sha512-pG8mpxnqpYDry0e20vuEFKhd4kKIcLLNwdNftNvfo+R/EjYRnTYnF+H8L+7eQHq6hqDH61xCEP4H4qR2CyT4pg==
|
||||||
|
|
||||||
xterm-addon-webgl@0.12.0-beta.15:
|
xterm-addon-webgl@0.12.0-beta.16:
|
||||||
version "0.12.0-beta.15"
|
version "0.12.0-beta.16"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.12.0-beta.15.tgz#9ae82127f2a39b3cb7f5ae45a6af223810c933d4"
|
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.12.0-beta.16.tgz#63a0f1f5be9e66286e035448e2011e3065769ad5"
|
||||||
integrity sha512-LWZ3iLspQOCc26OoT8qa+SuyuIcn2cAMRbBkinOuQCk4aW5kjovIrGovj9yVAcXNvOBnPm3sUqmnwGlN579kDA==
|
integrity sha512-g6v3RegOhSsD9Zt8ArWBMNT30QyPUlIWEIvP/xLHAluUZ1S5sDjFyZDB0nJAyn9MwQozJpwb0ylYO1nznN/TzA==
|
||||||
|
|
||||||
xterm-headless@4.15.0-beta.10:
|
xterm-headless@4.16.0-beta.2:
|
||||||
version "4.15.0-beta.10"
|
version "4.16.0-beta.2"
|
||||||
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-4.15.0-beta.10.tgz#2dbcb40dfda7ecfdacc7b63889c80da965480ce7"
|
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-4.16.0-beta.2.tgz#62e66a655a30c814e3a311f3542d42c87446cecd"
|
||||||
integrity sha512-kDAzmaeFX8hAJvbPUJc4dW4SoVBSg4onCVOPyi8QTmxZz1o7I9mX4U7DX1v3PceyfrU27A9k6zXjuTuPjxCCSQ==
|
integrity sha512-g92HDaIZcu1TQFlrjq2CHtt7A2qAwSD6s8RwncU/7u1kaq2e7rc9O3OKfu5v3QzgaRSKuugtquMr0OTKjkmLUg==
|
||||||
|
|
||||||
xterm@4.15.0-beta.10:
|
xterm@4.16.0-beta.2:
|
||||||
version "4.15.0-beta.10"
|
version "4.16.0-beta.2"
|
||||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.15.0-beta.10.tgz#8cda3d7885e8345f2fc6cf9275a43f3833d29acf"
|
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.16.0-beta.2.tgz#251beef21a232143f272da74c7005bc4d832ca79"
|
||||||
integrity sha512-valoh5ZcY/y7Pe+ffgcSAEFeuZfjzVeUUXcthdxTTsrGEiU1s4QR2EOg4U5jn5wye/Nc6mSfLW3s79R6Ac186w==
|
integrity sha512-PD0agueJ7qvbn1/QhZriAQXf+ykaoPKgQN9qiIGf88VMxHs8T47MYHW/+qPsrXagTmbrENtncughTIzOzv8Q5Q==
|
||||||
|
|
||||||
yauzl@^2.9.2:
|
yauzl@^2.9.2:
|
||||||
version "2.10.0"
|
version "2.10.0"
|
||||||
|
|
|
@ -7,5 +7,5 @@ function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[
|
||||||
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
|
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
|
||||||
ELECTRON="$CONTENTS/MacOS/Electron"
|
ELECTRON="$CONTENTS/MacOS/Electron"
|
||||||
CLI="$CONTENTS/Resources/app/out/cli.js"
|
CLI="$CONTENTS/Resources/app/out/cli.js"
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -50,5 +50,5 @@ fi
|
||||||
|
|
||||||
ELECTRON="$VSCODE_PATH/@@NAME@@"
|
ELECTRON="$VSCODE_PATH/@@NAME@@"
|
||||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -21,8 +21,9 @@ IF "%VSCODEUSERDATADIR%" == "" (
|
||||||
|
|
||||||
set REMOTE_VSCODE=%AUTHORITY%%EXT_PATH%
|
set REMOTE_VSCODE=%AUTHORITY%%EXT_PATH%
|
||||||
set VSCODECRASHDIR=%~dp0\..\..\..\.build\crashes
|
set VSCODECRASHDIR=%~dp0\..\..\..\.build\crashes
|
||||||
set VSCODELOGSDIR=%~dp0\..\..\..\.build\logs\remote-integration-tests
|
set VSCODELOGSDIR=%~dp0\..\..\..\.build\logs\integration-tests-remote
|
||||||
set TESTRESOLVER_DATA_FOLDER=%TMP%\testresolverdatafolder-%RANDOM%-%TIME:~6,5%
|
set TESTRESOLVER_DATA_FOLDER=%TMP%\testresolverdatafolder-%RANDOM%-%TIME:~6,5%
|
||||||
|
set TESTRESOLVER_LOGS_FOLDER=%VSCODELOGSDIR%\server
|
||||||
|
|
||||||
if "%VSCODE_REMOTE_SERVER_PATH%"=="" (
|
if "%VSCODE_REMOTE_SERVER_PATH%"=="" (
|
||||||
echo "Using remote server out of sources for integration tests"
|
echo "Using remote server out of sources for integration tests"
|
||||||
|
|
|
@ -29,7 +29,7 @@ fi
|
||||||
|
|
||||||
export REMOTE_VSCODE=$AUTHORITY$EXT_PATH
|
export REMOTE_VSCODE=$AUTHORITY$EXT_PATH
|
||||||
VSCODECRASHDIR=$ROOT/.build/crashes
|
VSCODECRASHDIR=$ROOT/.build/crashes
|
||||||
VSCODELOGSDIR=$ROOT/.build/logs/remote-integration-tests
|
VSCODELOGSDIR=$ROOT/.build/logs/integration-tests-remote
|
||||||
|
|
||||||
# Figure out which Electron to use for running tests
|
# Figure out which Electron to use for running tests
|
||||||
if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ]
|
if [ -z "$INTEGRATION_TEST_ELECTRON_PATH" ]
|
||||||
|
@ -74,6 +74,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export TESTRESOLVER_DATA_FOLDER=$TESTRESOLVER_DATA_FOLDER
|
export TESTRESOLVER_DATA_FOLDER=$TESTRESOLVER_DATA_FOLDER
|
||||||
|
export TESTRESOLVER_LOGS_FOLDER=$VSCODELOGSDIR/server
|
||||||
|
|
||||||
# Figure out which remote server to use for running tests
|
# Figure out which remote server to use for running tests
|
||||||
if [ -z "$VSCODE_REMOTE_SERVER_PATH" ]
|
if [ -z "$VSCODE_REMOTE_SERVER_PATH" ]
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
setlocal
|
setlocal
|
||||||
set VSCODE_DEV=
|
set VSCODE_DEV=
|
||||||
set ELECTRON_RUN_AS_NODE=1
|
set ELECTRON_RUN_AS_NODE=1
|
||||||
"%~dp0..\@@NAME@@.exe" "%~dp0..\resources\app\out\cli.js" %*
|
"%~dp0..\@@NAME@@.exe" "%~dp0..\resources\app\out\cli.js" --ms-enable-electron-run-as-node %*
|
||||||
endlocal
|
endlocal
|
|
@ -43,7 +43,7 @@ if [ $IN_WSL = true ]; then
|
||||||
# use the Remote WSL extension if installed
|
# use the Remote WSL extension if installed
|
||||||
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
||||||
|
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID >/tmp/remote-wsl-loc.txt 2>/dev/null </dev/null
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node --locate-extension $WSL_EXT_ID >/tmp/remote-wsl-loc.txt 2>/dev/null </dev/null
|
||||||
WSL_EXT_WLOC=$(cat /tmp/remote-wsl-loc.txt)
|
WSL_EXT_WLOC=$(cat /tmp/remote-wsl-loc.txt)
|
||||||
|
|
||||||
if [ -n "$WSL_EXT_WLOC" ]; then
|
if [ -n "$WSL_EXT_WLOC" ]; then
|
||||||
|
@ -58,5 +58,5 @@ elif [ -x "$(command -v cygpath)" ]; then
|
||||||
else
|
else
|
||||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
fi
|
fi
|
||||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -24,7 +24,7 @@ set ELECTRON_ENABLE_LOGGING=1
|
||||||
set ELECTRON_ENABLE_STACK_DUMPING=1
|
set ELECTRON_ENABLE_STACK_DUMPING=1
|
||||||
|
|
||||||
:: Launch Code
|
:: Launch Code
|
||||||
%CODE% --inspect=5874 out\cli.js %~dp0.. %*
|
%CODE% --inspect=5874 out\cli.js --ms-enable-electron-run-as-node %~dp0.. %*
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
:builtin
|
:builtin
|
||||||
|
|
|
@ -34,7 +34,7 @@ function code() {
|
||||||
VSCODE_DEV=1 \
|
VSCODE_DEV=1 \
|
||||||
ELECTRON_ENABLE_LOGGING=1 \
|
ELECTRON_ENABLE_LOGGING=1 \
|
||||||
ELECTRON_ENABLE_STACK_DUMPING=1 \
|
ELECTRON_ENABLE_STACK_DUMPING=1 \
|
||||||
"$CODE" --inspect=5874 "$ROOT/out/cli.js" . "$@"
|
"$CODE" --inspect=5874 "$ROOT/out/cli.js" --ms-enable-electron-run-as-node . "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
code "$@"
|
code "$@"
|
||||||
|
|
|
@ -58,7 +58,7 @@ function code-wsl()
|
||||||
cd $ROOT
|
cd $ROOT
|
||||||
export WSLENV=ELECTRON_RUN_AS_NODE/w:VSCODE_DEV/w:$WSLENV
|
export WSLENV=ELECTRON_RUN_AS_NODE/w:VSCODE_DEV/w:$WSLENV
|
||||||
local WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
local WSL_EXT_ID="ms-vscode-remote.remote-wsl"
|
||||||
local WSL_EXT_WLOC=$(echo "" | VSCODE_DEV=1 ELECTRON_RUN_AS_NODE=1 "$ROOT/.build/electron/Code - OSS.exe" "out/cli.js" --locate-extension $WSL_EXT_ID)
|
local WSL_EXT_WLOC=$(echo "" | VSCODE_DEV=1 ELECTRON_RUN_AS_NODE=1 "$ROOT/.build/electron/Code - OSS.exe" "out/cli.js" --ms-enable-electron-run-as-node --locate-extension $WSL_EXT_ID)
|
||||||
cd $CWD
|
cd $CWD
|
||||||
if [ -n "$WSL_EXT_WLOC" ]; then
|
if [ -n "$WSL_EXT_WLOC" ]; then
|
||||||
# replace \r\n with \n in WSL_EXT_WLOC
|
# replace \r\n with \n in WSL_EXT_WLOC
|
||||||
|
|
|
@ -10,7 +10,7 @@ set NAMESHORT=%NAMESHORT: "=%
|
||||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||||
set CODE=".build\electron\%NAMESHORT%"
|
set CODE=".build\electron\%NAMESHORT%"
|
||||||
|
|
||||||
%CODE% %*
|
%CODE% %* --ms-enable-electron-run-as-node
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,11 @@ export VSCODE_DEV=1
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
||||||
"$CODE" \
|
"$CODE" \
|
||||||
"$@"
|
"$@" \
|
||||||
|
--ms-enable-electron-run-as-node
|
||||||
else
|
else
|
||||||
ELECTRON_RUN_AS_NODE=1 \
|
ELECTRON_RUN_AS_NODE=1 \
|
||||||
"$CODE" \
|
"$CODE" \
|
||||||
"$@"
|
"$@" \
|
||||||
|
--ms-enable-electron-run-as-node
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -26,6 +26,7 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
|
||||||
compile-extension:markdown-language-features^
|
compile-extension:markdown-language-features^
|
||||||
compile-extension:typescript-language-features^
|
compile-extension:typescript-language-features^
|
||||||
compile-extension:vscode-custom-editor-tests^
|
compile-extension:vscode-custom-editor-tests^
|
||||||
|
compile-extension:vscode-notebook-tests^
|
||||||
compile-extension:emmet^
|
compile-extension:emmet^
|
||||||
compile-extension:css-language-features-server^
|
compile-extension:css-language-features-server^
|
||||||
compile-extension:html-language-features-server^
|
compile-extension:html-language-features-server^
|
||||||
|
|
|
@ -32,6 +32,7 @@ else
|
||||||
yarn gulp compile-extension:vscode-api-tests \
|
yarn gulp compile-extension:vscode-api-tests \
|
||||||
compile-extension:vscode-colorize-tests \
|
compile-extension:vscode-colorize-tests \
|
||||||
compile-extension:vscode-custom-editor-tests \
|
compile-extension:vscode-custom-editor-tests \
|
||||||
|
compile-extension:vscode-notebook-tests \
|
||||||
compile-extension:markdown-language-features \
|
compile-extension:markdown-language-features \
|
||||||
compile-extension:typescript-language-features \
|
compile-extension:typescript-language-features \
|
||||||
compile-extension:emmet \
|
compile-extension:emmet \
|
||||||
|
|
|
@ -163,7 +163,6 @@ export class Sash extends Disposable {
|
||||||
|
|
||||||
private el: HTMLElement;
|
private el: HTMLElement;
|
||||||
private layoutProvider: ISashLayoutProvider;
|
private layoutProvider: ISashLayoutProvider;
|
||||||
private hidden: boolean;
|
|
||||||
private orientation!: Orientation;
|
private orientation!: Orientation;
|
||||||
private size: number;
|
private size: number;
|
||||||
private hoverDelay = globalHoverDelay;
|
private hoverDelay = globalHoverDelay;
|
||||||
|
@ -317,7 +316,6 @@ export class Sash extends Disposable {
|
||||||
|
|
||||||
this._register(onDidChangeHoverDelay.event(delay => this.hoverDelay = delay));
|
this._register(onDidChangeHoverDelay.event(delay => this.hoverDelay = delay));
|
||||||
|
|
||||||
this.hidden = false;
|
|
||||||
this.layoutProvider = layoutProvider;
|
this.layoutProvider = layoutProvider;
|
||||||
|
|
||||||
this.orthogonalStartSash = options.orthogonalStartSash;
|
this.orthogonalStartSash = options.orthogonalStartSash;
|
||||||
|
@ -504,22 +502,6 @@ export class Sash extends Disposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
show(): void {
|
|
||||||
this.hidden = false;
|
|
||||||
this.el.style.removeProperty('display');
|
|
||||||
this.el.setAttribute('aria-hidden', 'false');
|
|
||||||
}
|
|
||||||
|
|
||||||
hide(): void {
|
|
||||||
this.hidden = true;
|
|
||||||
this.el.style.display = 'none';
|
|
||||||
this.el.setAttribute('aria-hidden', 'true');
|
|
||||||
}
|
|
||||||
|
|
||||||
isHidden(): boolean {
|
|
||||||
return this.hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
private getOrthogonalSash(e: PointerEvent): Sash | undefined {
|
private getOrthogonalSash(e: PointerEvent): Sash | undefined {
|
||||||
if (!e.target || !(e.target instanceof HTMLElement)) {
|
if (!e.target || !(e.target instanceof HTMLElement)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
left: 3px;
|
left: 3px;
|
||||||
height: 3px;
|
height: 3px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-shadow: #DDD 0 6px 6px -6px inset;
|
|
||||||
}
|
}
|
||||||
.monaco-scrollable-element > .shadow.left {
|
.monaco-scrollable-element > .shadow.left {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -44,7 +43,6 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 3px;
|
width: 3px;
|
||||||
box-shadow: #DDD 6px 0 6px -6px inset;
|
|
||||||
}
|
}
|
||||||
.monaco-scrollable-element > .shadow.top-left-corner {
|
.monaco-scrollable-element > .shadow.top-left-corner {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -53,59 +51,3 @@
|
||||||
height: 3px;
|
height: 3px;
|
||||||
width: 3px;
|
width: 3px;
|
||||||
}
|
}
|
||||||
.monaco-scrollable-element > .shadow.top.left {
|
|
||||||
box-shadow: #DDD 6px 6px 6px -6px inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Default Style ---------- */
|
|
||||||
|
|
||||||
.vs .monaco-scrollable-element > .scrollbar > .slider {
|
|
||||||
background: rgba(100, 100, 100, .4);
|
|
||||||
}
|
|
||||||
.vs-dark .monaco-scrollable-element > .scrollbar > .slider {
|
|
||||||
background: rgba(121, 121, 121, .4);
|
|
||||||
}
|
|
||||||
.hc-black .monaco-scrollable-element > .scrollbar > .slider {
|
|
||||||
background: rgba(111, 195, 223, .6);
|
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-scrollable-element > .scrollbar > .slider:hover {
|
|
||||||
background: rgba(100, 100, 100, .7);
|
|
||||||
}
|
|
||||||
.hc-black .monaco-scrollable-element > .scrollbar > .slider:hover {
|
|
||||||
background: rgba(111, 195, 223, .8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-scrollable-element > .scrollbar > .slider.active {
|
|
||||||
background: rgba(0, 0, 0, .6);
|
|
||||||
}
|
|
||||||
.vs-dark .monaco-scrollable-element > .scrollbar > .slider.active {
|
|
||||||
background: rgba(191, 191, 191, .4);
|
|
||||||
}
|
|
||||||
.hc-black .monaco-scrollable-element > .scrollbar > .slider.active {
|
|
||||||
background: rgba(111, 195, 223, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vs-dark .monaco-scrollable-element .shadow.top {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vs-dark .monaco-scrollable-element .shadow.left {
|
|
||||||
box-shadow: #000 6px 0 6px -6px inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vs-dark .monaco-scrollable-element .shadow.top.left {
|
|
||||||
box-shadow: #000 6px 6px 6px -6px inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hc-black .monaco-scrollable-element .shadow.top {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hc-black .monaco-scrollable-element .shadow.left {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hc-black .monaco-scrollable-element .shadow.top.left {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { IListOptions, IListOptionsUpdate, IListStyles, List } from 'vs/base/bro
|
||||||
import { ISplitViewDescriptor, IView, Orientation, SplitView } from 'vs/base/browser/ui/splitview/splitview';
|
import { ISplitViewDescriptor, IView, Orientation, SplitView } from 'vs/base/browser/ui/splitview/splitview';
|
||||||
import { ITableColumn, ITableContextMenuEvent, ITableEvent, ITableGestureEvent, ITableMouseEvent, ITableRenderer, ITableTouchEvent, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table';
|
import { ITableColumn, ITableContextMenuEvent, ITableEvent, ITableGestureEvent, ITableMouseEvent, ITableRenderer, ITableTouchEvent, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table';
|
||||||
import { Emitter, Event } from 'vs/base/common/event';
|
import { Emitter, Event } from 'vs/base/common/event';
|
||||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';
|
import { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';
|
||||||
import { ISpliceable } from 'vs/base/common/sequence';
|
import { ISpliceable } from 'vs/base/common/sequence';
|
||||||
import { IThemable } from 'vs/base/common/styler';
|
import { IThemable } from 'vs/base/common/styler';
|
||||||
|
@ -148,9 +148,11 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
||||||
readonly domNode: HTMLElement;
|
readonly domNode: HTMLElement;
|
||||||
private splitview: SplitView;
|
private splitview: SplitView;
|
||||||
private list: List<TRow>;
|
private list: List<TRow>;
|
||||||
private columnLayoutDisposable: IDisposable;
|
|
||||||
private cachedHeight: number = 0;
|
|
||||||
private styleElement: HTMLStyleElement;
|
private styleElement: HTMLStyleElement;
|
||||||
|
protected readonly disposables = new DisposableStore();
|
||||||
|
|
||||||
|
private cachedWidth: number = 0;
|
||||||
|
private cachedHeight: number = 0;
|
||||||
|
|
||||||
get onDidChangeFocus(): Event<ITableEvent<TRow>> { return this.list.onDidChangeFocus; }
|
get onDidChangeFocus(): Event<ITableEvent<TRow>> { return this.list.onDidChangeFocus; }
|
||||||
get onDidChangeSelection(): Event<ITableEvent<TRow>> { return this.list.onDidChangeSelection; }
|
get onDidChangeSelection(): Event<ITableEvent<TRow>> { return this.list.onDidChangeSelection; }
|
||||||
|
@ -196,21 +198,27 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
||||||
views: headers.map(view => ({ size: view.column.weight, view }))
|
views: headers.map(view => ({ size: view.column.weight, view }))
|
||||||
};
|
};
|
||||||
|
|
||||||
this.splitview = new SplitView(this.domNode, {
|
this.splitview = this.disposables.add(new SplitView(this.domNode, {
|
||||||
orientation: Orientation.HORIZONTAL,
|
orientation: Orientation.HORIZONTAL,
|
||||||
scrollbarVisibility: ScrollbarVisibility.Hidden,
|
scrollbarVisibility: ScrollbarVisibility.Hidden,
|
||||||
getSashOrthogonalSize: () => this.cachedHeight,
|
getSashOrthogonalSize: () => this.cachedHeight,
|
||||||
descriptor
|
descriptor
|
||||||
});
|
}));
|
||||||
|
|
||||||
this.splitview.el.style.height = `${virtualDelegate.headerRowHeight}px`;
|
this.splitview.el.style.height = `${virtualDelegate.headerRowHeight}px`;
|
||||||
this.splitview.el.style.lineHeight = `${virtualDelegate.headerRowHeight}px`;
|
this.splitview.el.style.lineHeight = `${virtualDelegate.headerRowHeight}px`;
|
||||||
|
|
||||||
const renderer = new TableListRenderer(columns, renderers, i => this.splitview.getViewSize(i));
|
const renderer = new TableListRenderer(columns, renderers, i => this.splitview.getViewSize(i));
|
||||||
this.list = new List(user, this.domNode, asListVirtualDelegate(virtualDelegate), [renderer], _options);
|
this.list = this.disposables.add(new List(user, this.domNode, asListVirtualDelegate(virtualDelegate), [renderer], _options));
|
||||||
|
|
||||||
this.columnLayoutDisposable = Event.any(...headers.map(h => h.onDidLayout))
|
Event.any(...headers.map(h => h.onDidLayout))
|
||||||
(([index, size]) => renderer.layoutColumn(index, size));
|
(([index, size]) => renderer.layoutColumn(index, size), null, this.disposables);
|
||||||
|
|
||||||
|
this.splitview.onDidSashReset(index => {
|
||||||
|
const totalWeight = columns.reduce((r, c) => r + c.weight, 0);
|
||||||
|
const size = columns[index].weight / totalWeight * this.cachedWidth;
|
||||||
|
this.splitview.resizeView(index, size);
|
||||||
|
}, null, this.disposables);
|
||||||
|
|
||||||
this.styleElement = createStyleSheet(this.domNode);
|
this.styleElement = createStyleSheet(this.domNode);
|
||||||
this.style({});
|
this.style({});
|
||||||
|
@ -248,6 +256,7 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
||||||
height = height ?? getContentHeight(this.domNode);
|
height = height ?? getContentHeight(this.domNode);
|
||||||
width = width ?? getContentWidth(this.domNode);
|
width = width ?? getContentWidth(this.domNode);
|
||||||
|
|
||||||
|
this.cachedWidth = width;
|
||||||
this.cachedHeight = height;
|
this.cachedHeight = height;
|
||||||
this.splitview.layout(width);
|
this.splitview.layout(width);
|
||||||
|
|
||||||
|
@ -337,8 +346,6 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
this.splitview.dispose();
|
this.disposables.dispose();
|
||||||
this.list.dispose();
|
|
||||||
this.columnLayoutDisposable.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,9 +229,9 @@ export function getCaseInsensitive(target: obj, key: string): any {
|
||||||
|
|
||||||
export function filter(obj: obj, predicate: (key: string, value: any) => boolean): obj {
|
export function filter(obj: obj, predicate: (key: string, value: any) => boolean): obj {
|
||||||
const result = Object.create(null);
|
const result = Object.create(null);
|
||||||
for (const key of Object.keys(obj)) {
|
for (const [key, value] of Object.entries(obj)) {
|
||||||
if (predicate(key, obj[key])) {
|
if (predicate(key, value)) {
|
||||||
result[key] = obj[key];
|
result[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -13,8 +13,9 @@ import { INewScrollPosition, ScrollType } from 'vs/editor/common/editorCommon';
|
||||||
import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';
|
import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';
|
||||||
import { ViewContext } from 'vs/editor/common/view/viewContext';
|
import { ViewContext } from 'vs/editor/common/view/viewContext';
|
||||||
import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
||||||
import { getThemeTypeSelector } from 'vs/platform/theme/common/themeService';
|
import { registerThemingParticipant, getThemeTypeSelector } from 'vs/platform/theme/common/themeService';
|
||||||
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||||
|
import { scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||||
|
|
||||||
export class EditorScrollbar extends ViewPart {
|
export class EditorScrollbar extends ViewPart {
|
||||||
|
|
||||||
|
@ -180,3 +181,51 @@ export class EditorScrollbar extends ViewPart {
|
||||||
this.scrollbar.renderNow();
|
this.scrollbar.renderNow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerThemingParticipant((theme, collector) => {
|
||||||
|
|
||||||
|
// Scrollbars
|
||||||
|
const scrollbarShadowColor = theme.getColor(scrollbarShadow);
|
||||||
|
if (scrollbarShadowColor) {
|
||||||
|
collector.addRule(`
|
||||||
|
.monaco-scrollable-element > .shadow.top {
|
||||||
|
box-shadow: ${scrollbarShadowColor} 0 6px 6px -6px inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-scrollable-element > .shadow.left {
|
||||||
|
box-shadow: ${scrollbarShadowColor} 6px 0 6px -6px inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-scrollable-element > .shadow.top.left {
|
||||||
|
box-shadow: ${scrollbarShadowColor} 6px 6px 6px -6px inset;
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground);
|
||||||
|
if (scrollbarSliderBackgroundColor) {
|
||||||
|
collector.addRule(`
|
||||||
|
.monaco-scrollable-element > .scrollbar > .slider {
|
||||||
|
background: ${scrollbarSliderBackgroundColor};
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground);
|
||||||
|
if (scrollbarSliderHoverBackgroundColor) {
|
||||||
|
collector.addRule(`
|
||||||
|
.monaco-scrollable-element > .scrollbar > .slider:hover {
|
||||||
|
background: ${scrollbarSliderHoverBackgroundColor};
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground);
|
||||||
|
if (scrollbarSliderActiveBackgroundColor) {
|
||||||
|
collector.addRule(`
|
||||||
|
.monaco-scrollable-element > .scrollbar > .slider.active {
|
||||||
|
background: ${scrollbarSliderActiveBackgroundColor};
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
@ -4373,7 +4373,7 @@ export const EditorOptions = {
|
||||||
default: 0,
|
default: 0,
|
||||||
minimum: 0,
|
minimum: 0,
|
||||||
maximum: 100,
|
maximum: 100,
|
||||||
markdownDescription: nls.localize('codeLensFontSize', "Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")
|
markdownDescription: nls.localize('codeLensFontSize', "Controls the font size in pixels for CodeLens. When set to `0`, 90% of `#editor.fontSize#` is used.")
|
||||||
})),
|
})),
|
||||||
colorDecorators: register(new EditorBooleanOption(
|
colorDecorators: register(new EditorBooleanOption(
|
||||||
EditorOption.colorDecorators, 'colorDecorators', true,
|
EditorOption.colorDecorators, 'colorDecorators', true,
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { Disposable, IDisposable, MutableDisposable, toDisposable } from 'vs/bas
|
||||||
import { commonPrefixLength, commonSuffixLength } from 'vs/base/common/strings';
|
import { commonPrefixLength, commonSuffixLength } from 'vs/base/common/strings';
|
||||||
import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands';
|
import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands';
|
||||||
import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';
|
import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||||
import { RedoCommand, UndoCommand } from 'vs/editor/browser/editorExtensions';
|
|
||||||
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||||
import { EditOperation } from 'vs/editor/common/core/editOperation';
|
import { EditOperation } from 'vs/editor/common/core/editOperation';
|
||||||
import { Position } from 'vs/editor/common/core/position';
|
import { Position } from 'vs/editor/common/core/position';
|
||||||
|
@ -43,8 +42,6 @@ export class InlineCompletionsModel extends Disposable implements GhostTextWidge
|
||||||
this._register(commandService.onDidExecuteCommand(e => {
|
this._register(commandService.onDidExecuteCommand(e => {
|
||||||
// These commands don't trigger onDidType.
|
// These commands don't trigger onDidType.
|
||||||
const commands = new Set([
|
const commands = new Set([
|
||||||
UndoCommand.id,
|
|
||||||
RedoCommand.id,
|
|
||||||
CoreEditingCommands.Tab.id,
|
CoreEditingCommands.Tab.id,
|
||||||
CoreEditingCommands.DeleteLeft.id,
|
CoreEditingCommands.DeleteLeft.id,
|
||||||
CoreEditingCommands.DeleteRight.id,
|
CoreEditingCommands.DeleteRight.id,
|
||||||
|
|
|
@ -491,7 +491,6 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||||
this._resizeSash = this._disposables.add(new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL }));
|
this._resizeSash = this._disposables.add(new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL }));
|
||||||
|
|
||||||
if (!this.options.isResizeable) {
|
if (!this.options.isResizeable) {
|
||||||
this._resizeSash.hide();
|
|
||||||
this._resizeSash.state = SashState.Disabled;
|
this._resizeSash.state = SashState.Disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ export function getEncodedLanguageId(languageId: string): number {
|
||||||
* @event
|
* @event
|
||||||
*/
|
*/
|
||||||
export function onLanguage(languageId: string, callback: () => void): IDisposable {
|
export function onLanguage(languageId: string, callback: () => void): IDisposable {
|
||||||
let disposable = StaticServices.modeService.get().onDidEncounterLanguage((languageId) => {
|
let disposable = StaticServices.modeService.get().onDidEncounterLanguage((encounteredLanguageId) => {
|
||||||
if (languageId === languageId) {
|
if (encounteredLanguageId === languageId) {
|
||||||
// stop listening
|
// stop listening
|
||||||
disposable.dispose();
|
disposable.dispose();
|
||||||
// invoke actual listener
|
// invoke actual listener
|
||||||
|
|
|
@ -132,6 +132,19 @@ class StandaloneTheme implements IStandaloneTheme {
|
||||||
encodedTokensColors = baseData.encodedTokensColors;
|
encodedTokensColors = baseData.encodedTokensColors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Pick up default colors from `editor.foreground` and `editor.background` if available
|
||||||
|
const editorForeground = this.themeData.colors['editor.foreground'];
|
||||||
|
const editorBackground = this.themeData.colors['editor.background'];
|
||||||
|
if (editorForeground || editorBackground) {
|
||||||
|
const rule: ITokenThemeRule = { token: '' };
|
||||||
|
if (editorForeground) {
|
||||||
|
rule.foreground = editorForeground;
|
||||||
|
}
|
||||||
|
if (editorBackground) {
|
||||||
|
rule.background = editorBackground;
|
||||||
|
}
|
||||||
|
rules.push(rule);
|
||||||
|
}
|
||||||
rules = rules.concat(this.themeData.rules);
|
rules = rules.concat(this.themeData.rules);
|
||||||
if (this.themeData.encodedTokensColors) {
|
if (this.themeData.encodedTokensColors) {
|
||||||
encodedTokensColors = this.themeData.encodedTokensColors;
|
encodedTokensColors = this.themeData.encodedTokensColors;
|
||||||
|
|
|
@ -106,4 +106,7 @@ export interface NativeParsedArgs {
|
||||||
'allow-insecure-localhost'?: boolean;
|
'allow-insecure-localhost'?: boolean;
|
||||||
'log-net-log'?: string;
|
'log-net-log'?: string;
|
||||||
'vmodule'?: string;
|
'vmodule'?: string;
|
||||||
|
|
||||||
|
// MS Build command line arg
|
||||||
|
'ms-enable-electron-run-as-node'?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
|
||||||
'inspect-extensions': { type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
|
'inspect-extensions': { type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") },
|
||||||
'inspect-brk-extensions': { type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
|
'inspect-brk-extensions': { type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") },
|
||||||
'disable-gpu': { type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
|
'disable-gpu': { type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") },
|
||||||
|
'ms-enable-electron-run-as-node': { type: 'boolean' },
|
||||||
'max-memory': { type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes)."), args: 'memory' },
|
'max-memory': { type: 'string', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes)."), args: 'memory' },
|
||||||
'telemetry': { type: 'boolean', cat: 't', description: localize('telemetry', "Shows all telemetry events which VS code collects.") },
|
'telemetry': { type: 'boolean', cat: 't', description: localize('telemetry', "Shows all telemetry events which VS code collects.") },
|
||||||
|
|
||||||
|
|
|
@ -127,13 +127,14 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
|
||||||
// handle popular non-POSIX shells
|
// handle popular non-POSIX shells
|
||||||
const name = basename(systemShellUnix);
|
const name = basename(systemShellUnix);
|
||||||
let command: string, shellArgs: Array<string>;
|
let command: string, shellArgs: Array<string>;
|
||||||
|
const extraArgs = (process.versions['electron'] && process.versions['microsoft-build']) ? '--ms-enable-electron-run-as-node' : '';
|
||||||
if (/^pwsh(-preview)?$/.test(name)) {
|
if (/^pwsh(-preview)?$/.test(name)) {
|
||||||
// Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
|
// Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
|
||||||
// you escape single quotes inside of a single quoted string.
|
// you escape single quotes inside of a single quoted string.
|
||||||
command = `& '${process.execPath}' -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;
|
command = `& '${process.execPath}' ${extraArgs} -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;
|
||||||
shellArgs = ['-Login', '-Command'];
|
shellArgs = ['-Login', '-Command'];
|
||||||
} else {
|
} else {
|
||||||
command = `'${process.execPath}' -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
|
command = `'${process.execPath}' ${extraArgs} -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
|
||||||
|
|
||||||
if (name === 'tcsh') {
|
if (name === 'tcsh') {
|
||||||
shellArgs = ['-ic'];
|
shellArgs = ['-ic'];
|
||||||
|
|
|
@ -484,7 +484,6 @@ export class WorkbenchTable<TRow> extends Table<TRow> {
|
||||||
private horizontalScrolling: boolean | undefined;
|
private horizontalScrolling: boolean | undefined;
|
||||||
private _styler: IDisposable | undefined;
|
private _styler: IDisposable | undefined;
|
||||||
private _useAltAsMultipleSelectionModifier: boolean;
|
private _useAltAsMultipleSelectionModifier: boolean;
|
||||||
private readonly disposables: DisposableStore;
|
|
||||||
private navigator: TableResourceNavigator<TRow>;
|
private navigator: TableResourceNavigator<TRow>;
|
||||||
get onDidOpen(): Event<IOpenEvent<TRow | undefined>> { return this.navigator.onDidOpen; }
|
get onDidOpen(): Event<IOpenEvent<TRow | undefined>> { return this.navigator.onDidOpen; }
|
||||||
|
|
||||||
|
@ -513,7 +512,6 @@ export class WorkbenchTable<TRow> extends Table<TRow> {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
this.disposables = new DisposableStore();
|
|
||||||
this.disposables.add(workbenchListOptionsDisposable);
|
this.disposables.add(workbenchListOptionsDisposable);
|
||||||
|
|
||||||
this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
|
this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
|
||||||
|
|
|
@ -57,7 +57,7 @@ else {
|
||||||
// Running out of sources
|
// Running out of sources
|
||||||
if (Object.keys(product).length === 0) {
|
if (Object.keys(product).length === 0) {
|
||||||
Object.assign(product, {
|
Object.assign(product, {
|
||||||
version: '1.62.0-dev',
|
version: '1.63.0-dev',
|
||||||
nameShort: 'Code - OSS Dev',
|
nameShort: 'Code - OSS Dev',
|
||||||
nameLong: 'Code - OSS Dev',
|
nameLong: 'Code - OSS Dev',
|
||||||
applicationName: 'code-oss',
|
applicationName: 'code-oss',
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Emitter, Event } from 'vs/base/common/event';
|
import { Emitter, Event } from 'vs/base/common/event';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync';
|
import { IUserDataSyncLogService, IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync';
|
||||||
|
|
||||||
export interface IUserDataSyncAccount {
|
export interface IUserDataSyncAccount {
|
||||||
readonly authenticationProviderId: string;
|
readonly authenticationProviderId: string;
|
||||||
|
@ -39,10 +39,12 @@ export class UserDataSyncAccountService extends Disposable implements IUserDataS
|
||||||
private wasTokenFailed: boolean = false;
|
private wasTokenFailed: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IUserDataSyncStoreService private readonly userDataSyncStoreService: IUserDataSyncStoreService
|
@IUserDataSyncStoreService private readonly userDataSyncStoreService: IUserDataSyncStoreService,
|
||||||
|
@IUserDataSyncLogService private readonly logService: IUserDataSyncLogService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this._register(userDataSyncStoreService.onTokenFailed(() => {
|
this._register(userDataSyncStoreService.onTokenFailed(() => {
|
||||||
|
this.logService.info('Settings Sync auth token failed', this.account?.authenticationProviderId, this.wasTokenFailed);
|
||||||
this.updateAccount(undefined);
|
this.updateAccount(undefined);
|
||||||
this._onTokenFailed.fire(this.wasTokenFailed);
|
this._onTokenFailed.fire(this.wasTokenFailed);
|
||||||
this.wasTokenFailed = true;
|
this.wasTokenFailed = true;
|
||||||
|
|
|
@ -236,6 +236,7 @@ export function main(desc: ProductDescription, args: string[]): void {
|
||||||
} else {
|
} else {
|
||||||
const cliCwd = dirname(cliCommand);
|
const cliCwd = dirname(cliCommand);
|
||||||
const env = { ...process.env, ELECTRON_RUN_AS_NODE: '1' };
|
const env = { ...process.env, ELECTRON_RUN_AS_NODE: '1' };
|
||||||
|
newCommandline.unshift('--ms-enable-electron-run-as-node');
|
||||||
newCommandline.unshift('resources/app/out/cli.js');
|
newCommandline.unshift('resources/app/out/cli.js');
|
||||||
if (parsedArgs['verbose']) {
|
if (parsedArgs['verbose']) {
|
||||||
console.log(`Invoking: ${cliCommand} ${newCommandline.join(' ')} in ${cliCwd}`);
|
console.log(`Invoking: ${cliCommand} ${newCommandline.join(' ')} in ${cliCwd}`);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { IServerChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||||
import { createRandomIPCHandle } from 'vs/base/parts/ipc/node/ipc.net';
|
import { createRandomIPCHandle } from 'vs/base/parts/ipc/node/ipc.net';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment';
|
import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment';
|
||||||
import { IPtyService, IShellLaunchConfig, ITerminalProfile, ITerminalsLayoutInfo } from 'vs/platform/terminal/common/terminal';
|
import { IPtyService, IShellLaunchConfig, ITerminalProfile } from 'vs/platform/terminal/common/terminal';
|
||||||
import { IGetTerminalLayoutInfoArgs, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
|
import { IGetTerminalLayoutInfoArgs, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
|
||||||
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||||
import { createRemoteURITransformer } from 'vs/server/remoteUriTransformer';
|
import { createRemoteURITransformer } from 'vs/server/remoteUriTransformer';
|
||||||
|
@ -124,8 +124,8 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel<
|
||||||
case '$getProfiles': return this._getProfiles.apply(this, args);
|
case '$getProfiles': return this._getProfiles.apply(this, args);
|
||||||
case '$getEnvironment': return this._getEnvironment();
|
case '$getEnvironment': return this._getEnvironment();
|
||||||
case '$getWslPath': return this._getWslPath(args[0]);
|
case '$getWslPath': return this._getWslPath(args[0]);
|
||||||
case '$getTerminalLayoutInfo': return this._getTerminalLayoutInfo(<IGetTerminalLayoutInfoArgs>args);
|
case '$getTerminalLayoutInfo': return this._ptyService.getTerminalLayoutInfo(<IGetTerminalLayoutInfoArgs>args);
|
||||||
case '$setTerminalLayoutInfo': return this._setTerminalLayoutInfo(<ISetTerminalLayoutInfoArgs>args);
|
case '$setTerminalLayoutInfo': return this._ptyService.setTerminalLayoutInfo(<ISetTerminalLayoutInfoArgs>args);
|
||||||
case '$serializeTerminalState': return this._ptyService.serializeTerminalState.apply(this._ptyService, args);
|
case '$serializeTerminalState': return this._ptyService.serializeTerminalState.apply(this._ptyService, args);
|
||||||
case '$reviveTerminalProcesses': return this._ptyService.reviveTerminalProcesses.apply(this._ptyService, args);
|
case '$reviveTerminalProcesses': return this._ptyService.reviveTerminalProcesses.apply(this._ptyService, args);
|
||||||
case '$setUnicodeVersion': return this._ptyService.setUnicodeVersion.apply(this._ptyService, args);
|
case '$setUnicodeVersion': return this._ptyService.setUnicodeVersion.apply(this._ptyService, args);
|
||||||
|
@ -315,13 +315,6 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel<
|
||||||
return this._ptyService.getWslPath(original);
|
return this._ptyService.getWslPath(original);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _setTerminalLayoutInfo(args: ISetTerminalLayoutInfoArgs): void {
|
|
||||||
this._ptyService.setTerminalLayoutInfo(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async _getTerminalLayoutInfo(args: IGetTerminalLayoutInfoArgs): Promise<ITerminalsLayoutInfo | undefined> {
|
|
||||||
return this._ptyService.getTerminalLayoutInfo(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _reduceConnectionGraceTime(): Promise<void> {
|
private _reduceConnectionGraceTime(): Promise<void> {
|
||||||
return this._ptyService.reduceConnectionGraceTime();
|
return this._ptyService.reduceConnectionGraceTime();
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { IActiveCodeEditor, IViewZone } from 'vs/editor/browser/editorBrowser';
|
||||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||||
import { reviveWebviewContentOptions } from 'vs/workbench/api/browser/mainThreadWebviews';
|
import { reviveWebviewContentOptions } from 'vs/workbench/api/browser/mainThreadWebviews';
|
||||||
import { ExtHostContext, ExtHostEditorInsetsShape, IExtHostContext, IWebviewOptions, MainContext, MainThreadEditorInsetsShape } from 'vs/workbench/api/common/extHost.protocol';
|
import { ExtHostContext, ExtHostEditorInsetsShape, IExtHostContext, IWebviewContentOptions, MainContext, MainThreadEditorInsetsShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||||
import { IWebviewService, IWebviewElement } from 'vs/workbench/contrib/webview/browser/webview';
|
import { IWebviewService, IWebviewElement } from 'vs/workbench/contrib/webview/browser/webview';
|
||||||
import { extHostNamedCustomer } from '../common/extHostCustomers';
|
import { extHostNamedCustomer } from '../common/extHostCustomers';
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
|
||||||
this._disposables.dispose();
|
this._disposables.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
async $createEditorInset(handle: number, id: string, uri: UriComponents, line: number, height: number, options: IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void> {
|
async $createEditorInset(handle: number, id: string, uri: UriComponents, line: number, height: number, options: IWebviewContentOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void> {
|
||||||
|
|
||||||
let editor: IActiveCodeEditor | undefined;
|
let editor: IActiveCodeEditor | undefined;
|
||||||
id = id.substr(0, id.indexOf(',')); //todo@jrieken HACK
|
id = id.substr(0, id.indexOf(',')); //todo@jrieken HACK
|
||||||
|
@ -121,7 +121,7 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
|
||||||
inset.webview.html = value;
|
inset.webview.html = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$setOptions(handle: number, options: IWebviewOptions): void {
|
$setOptions(handle: number, options: IWebviewContentOptions): void {
|
||||||
const inset = this.getInset(handle);
|
const inset = this.getInset(handle);
|
||||||
inset.webview.contentOptions = reviveWebviewContentOptions(options);
|
inset.webview.contentOptions = reviveWebviewContentOptions(options);
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,15 +431,6 @@ export class MainThreadSCM implements MainThreadSCMShape {
|
||||||
repository.input.visible = visible;
|
repository.input.visible = visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
$setInputBoxFocus(sourceControlHandle: number): void {
|
|
||||||
const repository = this._repositories.get(sourceControlHandle);
|
|
||||||
if (!repository) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
repository.input.setFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
$showValidationMessage(sourceControlHandle: number, message: string | IMarkdownString, type: InputValidationType) {
|
$showValidationMessage(sourceControlHandle: number, message: string | IMarkdownString, type: InputValidationType) {
|
||||||
const repository = this._repositories.get(sourceControlHandle);
|
const repository = this._repositories.get(sourceControlHandle);
|
||||||
if (!repository) {
|
if (!repository) {
|
||||||
|
|
|
@ -5,17 +5,17 @@
|
||||||
|
|
||||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||||
import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
|
import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { MainThreadWebviews, reviveWebviewContentOptions, reviveWebviewExtension } from 'vs/workbench/api/browser/mainThreadWebviews';
|
import { MainThreadWebviews, reviveWebviewContentOptions, reviveWebviewExtension } from 'vs/workbench/api/browser/mainThreadWebviews';
|
||||||
import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol';
|
import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol';
|
||||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
|
||||||
import { EditorGroupColumn, columnToEditorGroup, editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn';
|
|
||||||
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||||
|
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||||
import { WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview';
|
import { WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview';
|
||||||
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
|
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
|
||||||
import { WebviewIcons } from 'vs/workbench/contrib/webviewPanel/browser/webviewIconManager';
|
import { WebviewIcons } from 'vs/workbench/contrib/webviewPanel/browser/webviewIconManager';
|
||||||
import { ICreateWebViewShowOptions, IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
|
import { ICreateWebViewShowOptions, IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
|
||||||
|
import { columnToEditorGroup, editorGroupToColumn } from 'vs/workbench/services/editor/common/editorGroupColumn';
|
||||||
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||||
|
@ -151,13 +151,8 @@ export class MainThreadWebviewPanels extends Disposable implements extHostProtoc
|
||||||
extensionData: extHostProtocol.WebviewExtensionDescription,
|
extensionData: extHostProtocol.WebviewExtensionDescription,
|
||||||
handle: extHostProtocol.WebviewHandle,
|
handle: extHostProtocol.WebviewHandle,
|
||||||
viewType: string,
|
viewType: string,
|
||||||
initData: {
|
initData: extHostProtocol.IWebviewInitData,
|
||||||
title: string;
|
showOptions: extHostProtocol.WebviewPanelShowOptions,
|
||||||
webviewOptions: extHostProtocol.IWebviewOptions;
|
|
||||||
panelOptions: extHostProtocol.IWebviewPanelOptions;
|
|
||||||
serializeBuffersForPostMessage: boolean;
|
|
||||||
},
|
|
||||||
showOptions: { viewColumn?: EditorGroupColumn, preserveFocus?: boolean; },
|
|
||||||
): void {
|
): void {
|
||||||
const mainThreadShowOptions: ICreateWebViewShowOptions = Object.create(null);
|
const mainThreadShowOptions: ICreateWebViewShowOptions = Object.create(null);
|
||||||
if (showOptions) {
|
if (showOptions) {
|
||||||
|
@ -192,7 +187,7 @@ export class MainThreadWebviewPanels extends Disposable implements extHostProtoc
|
||||||
webview.setName(value);
|
webview.setName(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public $setIconPath(handle: extHostProtocol.WebviewHandle, value: { light: UriComponents, dark: UriComponents; } | undefined): void {
|
public $setIconPath(handle: extHostProtocol.WebviewHandle, value: extHostProtocol.IWebviewIconPath | undefined): void {
|
||||||
const webview = this.getWebviewInput(handle);
|
const webview = this.getWebviewInput(handle);
|
||||||
webview.iconPath = reviveWebviewIcon(value);
|
webview.iconPath = reviveWebviewIcon(value);
|
||||||
}
|
}
|
||||||
|
@ -316,12 +311,14 @@ export class MainThreadWebviewPanels extends Disposable implements extHostProtoc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reviveWebviewIcon(
|
function reviveWebviewIcon(value: extHostProtocol.IWebviewIconPath | undefined): WebviewIcons | undefined {
|
||||||
value: { light: UriComponents, dark: UriComponents; } | undefined
|
if (!value) {
|
||||||
): WebviewIcons | undefined {
|
return undefined;
|
||||||
return value
|
}
|
||||||
? { light: URI.revive(value.light), dark: URI.revive(value.dark) }
|
return {
|
||||||
: undefined;
|
light: URI.revive(value.light),
|
||||||
|
dark: URI.revive(value.dark),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function reviveWebviewOptions(panelOptions: extHostProtocol.IWebviewPanelOptions): WebviewOptions {
|
function reviveWebviewOptions(panelOptions: extHostProtocol.IWebviewPanelOptions): WebviewOptions {
|
||||||
|
|
|
@ -55,7 +55,7 @@ export class MainThreadWebviews extends Disposable implements extHostProtocol.Ma
|
||||||
webview.html = value;
|
webview.html = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public $setOptions(handle: extHostProtocol.WebviewHandle, options: extHostProtocol.IWebviewOptions): void {
|
public $setOptions(handle: extHostProtocol.WebviewHandle, options: extHostProtocol.IWebviewContentOptions): void {
|
||||||
const webview = this.getWebview(handle);
|
const webview = this.getWebview(handle);
|
||||||
webview.contentOptions = reviveWebviewContentOptions(options);
|
webview.contentOptions = reviveWebviewContentOptions(options);
|
||||||
}
|
}
|
||||||
|
@ -123,10 +123,13 @@ export class MainThreadWebviews extends Disposable implements extHostProtocol.Ma
|
||||||
}
|
}
|
||||||
|
|
||||||
export function reviveWebviewExtension(extensionData: extHostProtocol.WebviewExtensionDescription): WebviewExtensionDescription {
|
export function reviveWebviewExtension(extensionData: extHostProtocol.WebviewExtensionDescription): WebviewExtensionDescription {
|
||||||
return { id: extensionData.id, location: URI.revive(extensionData.location) };
|
return {
|
||||||
|
id: extensionData.id,
|
||||||
|
location: URI.revive(extensionData.location),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function reviveWebviewContentOptions(webviewOptions: extHostProtocol.IWebviewOptions): WebviewContentOptions {
|
export function reviveWebviewContentOptions(webviewOptions: extHostProtocol.IWebviewContentOptions): WebviewContentOptions {
|
||||||
return {
|
return {
|
||||||
allowScripts: webviewOptions.enableScripts,
|
allowScripts: webviewOptions.enableScripts,
|
||||||
allowForms: webviewOptions.enableForms,
|
allowForms: webviewOptions.enableForms,
|
||||||
|
|
|
@ -226,7 +226,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||||
|
|
||||||
const authentication: typeof vscode.authentication = {
|
const authentication: typeof vscode.authentication = {
|
||||||
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
|
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
|
||||||
if (options?.forceNewSession || options?.silent) {
|
if (options?.forceNewSession) {
|
||||||
checkProposedApiEnabled(extension);
|
checkProposedApiEnabled(extension);
|
||||||
}
|
}
|
||||||
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
|
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
|
||||||
|
|
|
@ -618,11 +618,11 @@ export interface MainThreadTelemetryShape extends IDisposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MainThreadEditorInsetsShape extends IDisposable {
|
export interface MainThreadEditorInsetsShape extends IDisposable {
|
||||||
$createEditorInset(handle: number, id: string, uri: UriComponents, line: number, height: number, options: IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void>;
|
$createEditorInset(handle: number, id: string, uri: UriComponents, line: number, height: number, options: IWebviewContentOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): Promise<void>;
|
||||||
$disposeEditorInset(handle: number): void;
|
$disposeEditorInset(handle: number): void;
|
||||||
|
|
||||||
$setHtml(handle: number, value: string): void;
|
$setHtml(handle: number, value: string): void;
|
||||||
$setOptions(handle: number, options: IWebviewOptions): void;
|
$setOptions(handle: number, options: IWebviewContentOptions): void;
|
||||||
$postMessage(handle: number, value: any): Promise<boolean>;
|
$postMessage(handle: number, value: any): Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -681,12 +681,12 @@ export interface IWebviewPortMapping {
|
||||||
readonly extensionHostPort: number;
|
readonly extensionHostPort: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IWebviewOptions {
|
export interface IWebviewContentOptions {
|
||||||
readonly enableScripts?: boolean;
|
readonly enableScripts?: boolean;
|
||||||
readonly enableForms?: boolean;
|
readonly enableForms?: boolean;
|
||||||
readonly enableCommandUris?: boolean;
|
readonly enableCommandUris?: boolean;
|
||||||
readonly localResourceRoots?: ReadonlyArray<UriComponents>;
|
readonly localResourceRoots?: readonly UriComponents[];
|
||||||
readonly portMapping?: ReadonlyArray<IWebviewPortMapping>;
|
readonly portMapping?: readonly IWebviewPortMapping[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IWebviewPanelOptions {
|
export interface IWebviewPanelOptions {
|
||||||
|
@ -729,27 +729,34 @@ export interface WebviewMessageArrayBufferReference {
|
||||||
|
|
||||||
export interface MainThreadWebviewsShape extends IDisposable {
|
export interface MainThreadWebviewsShape extends IDisposable {
|
||||||
$setHtml(handle: WebviewHandle, value: string): void;
|
$setHtml(handle: WebviewHandle, value: string): void;
|
||||||
$setOptions(handle: WebviewHandle, options: IWebviewOptions): void;
|
$setOptions(handle: WebviewHandle, options: IWebviewContentOptions): void;
|
||||||
$postMessage(handle: WebviewHandle, value: string, ...buffers: VSBuffer[]): Promise<boolean>
|
$postMessage(handle: WebviewHandle, value: string, ...buffers: VSBuffer[]): Promise<boolean>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IWebviewIconPath {
|
||||||
|
readonly light: UriComponents;
|
||||||
|
readonly dark: UriComponents;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IWebviewInitData {
|
||||||
|
readonly title: string;
|
||||||
|
readonly webviewOptions: IWebviewContentOptions;
|
||||||
|
readonly panelOptions: IWebviewPanelOptions;
|
||||||
|
readonly serializeBuffersForPostMessage: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface MainThreadWebviewPanelsShape extends IDisposable {
|
export interface MainThreadWebviewPanelsShape extends IDisposable {
|
||||||
$createWebviewPanel(
|
$createWebviewPanel(
|
||||||
extension: WebviewExtensionDescription,
|
extension: WebviewExtensionDescription,
|
||||||
handle: WebviewHandle,
|
handle: WebviewHandle,
|
||||||
viewType: string,
|
viewType: string,
|
||||||
initData: {
|
initData: IWebviewInitData,
|
||||||
title: string;
|
|
||||||
webviewOptions: IWebviewOptions;
|
|
||||||
panelOptions: IWebviewPanelOptions;
|
|
||||||
serializeBuffersForPostMessage: boolean;
|
|
||||||
},
|
|
||||||
showOptions: WebviewPanelShowOptions,
|
showOptions: WebviewPanelShowOptions,
|
||||||
): void;
|
): void;
|
||||||
$disposeWebview(handle: WebviewHandle): void;
|
$disposeWebview(handle: WebviewHandle): void;
|
||||||
$reveal(handle: WebviewHandle, showOptions: WebviewPanelShowOptions): void;
|
$reveal(handle: WebviewHandle, showOptions: WebviewPanelShowOptions): void;
|
||||||
$setTitle(handle: WebviewHandle, value: string): void;
|
$setTitle(handle: WebviewHandle, value: string): void;
|
||||||
$setIconPath(handle: WebviewHandle, value: { light: UriComponents, dark: UriComponents; } | undefined): void;
|
$setIconPath(handle: WebviewHandle, value: IWebviewIconPath | undefined): void;
|
||||||
|
|
||||||
$registerSerializer(viewType: string, options: { serializeBuffersForPostMessage: boolean }): void;
|
$registerSerializer(viewType: string, options: { serializeBuffersForPostMessage: boolean }): void;
|
||||||
$unregisterSerializer(viewType: string): void;
|
$unregisterSerializer(viewType: string): void;
|
||||||
|
@ -796,7 +803,7 @@ export interface ExtHostWebviewPanelsShape {
|
||||||
initData: {
|
initData: {
|
||||||
title: string;
|
title: string;
|
||||||
state: any;
|
state: any;
|
||||||
webviewOptions: IWebviewOptions;
|
webviewOptions: IWebviewContentOptions;
|
||||||
panelOptions: IWebviewPanelOptions;
|
panelOptions: IWebviewPanelOptions;
|
||||||
},
|
},
|
||||||
position: EditorGroupColumn,
|
position: EditorGroupColumn,
|
||||||
|
@ -810,7 +817,7 @@ export interface ExtHostCustomEditorsShape {
|
||||||
viewType: string,
|
viewType: string,
|
||||||
initData: {
|
initData: {
|
||||||
title: string;
|
title: string;
|
||||||
webviewOptions: IWebviewOptions;
|
webviewOptions: IWebviewContentOptions;
|
||||||
panelOptions: IWebviewPanelOptions;
|
panelOptions: IWebviewPanelOptions;
|
||||||
},
|
},
|
||||||
position: EditorGroupColumn,
|
position: EditorGroupColumn,
|
||||||
|
@ -1096,7 +1103,6 @@ export interface MainThreadSCMShape extends IDisposable {
|
||||||
$setInputBoxValue(sourceControlHandle: number, value: string): void;
|
$setInputBoxValue(sourceControlHandle: number, value: string): void;
|
||||||
$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void;
|
$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void;
|
||||||
$setInputBoxVisibility(sourceControlHandle: number, visible: boolean): void;
|
$setInputBoxVisibility(sourceControlHandle: number, visible: boolean): void;
|
||||||
$setInputBoxFocus(sourceControlHandle: number): void;
|
|
||||||
$showValidationMessage(sourceControlHandle: number, message: string | IMarkdownString, type: InputValidationType): void;
|
$showValidationMessage(sourceControlHandle: number, message: string | IMarkdownString, type: InputValidationType): void;
|
||||||
$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void;
|
$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ export class ExtHostCustomEditors implements extHostProtocol.ExtHostCustomEditor
|
||||||
viewType: string,
|
viewType: string,
|
||||||
initData: {
|
initData: {
|
||||||
title: string;
|
title: string;
|
||||||
webviewOptions: extHostProtocol.IWebviewOptions;
|
webviewOptions: extHostProtocol.IWebviewContentOptions;
|
||||||
panelOptions: extHostProtocol.IWebviewPanelOptions;
|
panelOptions: extHostProtocol.IWebviewPanelOptions;
|
||||||
},
|
},
|
||||||
position: EditorGroupColumn,
|
position: EditorGroupColumn,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
||||||
import { IExtensionDescription, checkProposedApiEnabled } from 'vs/platform/extensions/common/extensions';
|
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||||
import { ILogger, ILoggerService } from 'vs/platform/log/common/log';
|
import { ILogger, ILoggerService } from 'vs/platform/log/common/log';
|
||||||
import { OutputChannelUpdateMode } from 'vs/workbench/contrib/output/common/output';
|
import { OutputChannelUpdateMode } from 'vs/workbench/contrib/output/common/output';
|
||||||
import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer';
|
import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer';
|
||||||
|
@ -127,7 +127,7 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape {
|
||||||
this.channels.set(channel.id, channel);
|
this.channels.set(channel.id, channel);
|
||||||
channel.visible = channel.id === this.visibleChannelId;
|
channel.visible = channel.id === this.visibleChannelId;
|
||||||
});
|
});
|
||||||
return this.createExtHostOutputChannel(name, extHostOutputChannel, extension);
|
return this.createExtHostOutputChannel(name, extHostOutputChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async doCreateOutputChannel(name: string, extension: IExtensionDescription): Promise<ExtHostOutputChannel> {
|
private async doCreateOutputChannel(name: string, extension: IExtensionDescription): Promise<ExtHostOutputChannel> {
|
||||||
|
@ -145,58 +145,42 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape {
|
||||||
return this.outputDirectoryPromise;
|
return this.outputDirectoryPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
private createExtHostOutputChannel(name: string, channelPromise: Promise<ExtHostOutputChannel>, extensionDescription: IExtensionDescription): vscode.OutputChannel {
|
private createExtHostOutputChannel(name: string, channelPromise: Promise<ExtHostOutputChannel>): vscode.OutputChannel {
|
||||||
const validate = (channel: ExtHostOutputChannel, checkProposedApi?: boolean) => {
|
let disposed = false;
|
||||||
if (checkProposedApi) {
|
const validate = () => {
|
||||||
checkProposedApiEnabled(extensionDescription);
|
if (disposed) {
|
||||||
}
|
|
||||||
if (channel.disposed) {
|
|
||||||
throw new Error('Channel has been closed');
|
throw new Error('Channel has been closed');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
get name(): string { return name; },
|
get name(): string { return name; },
|
||||||
append(value: string): void {
|
append(value: string): void {
|
||||||
channelPromise.then(channel => {
|
validate();
|
||||||
validate(channel);
|
channelPromise.then(channel => channel.append(value));
|
||||||
channel.append(value);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
appendLine(value: string): void {
|
appendLine(value: string): void {
|
||||||
channelPromise.then(channel => {
|
validate();
|
||||||
validate(channel);
|
channelPromise.then(channel => channel.appendLine(value));
|
||||||
channel.appendLine(value);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
clear(): void {
|
clear(): void {
|
||||||
channelPromise.then(channel => {
|
validate();
|
||||||
validate(channel);
|
channelPromise.then(channel => channel.clear());
|
||||||
channel.clear();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
replace(value: string): void {
|
replace(value: string): void {
|
||||||
channelPromise.then(channel => {
|
validate();
|
||||||
validate(channel, true);
|
channelPromise.then(channel => channel.replace(value));
|
||||||
channel.replace(value);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
show(columnOrPreserveFocus?: vscode.ViewColumn | boolean, preserveFocus?: boolean): void {
|
show(columnOrPreserveFocus?: vscode.ViewColumn | boolean, preserveFocus?: boolean): void {
|
||||||
channelPromise.then(channel => {
|
validate();
|
||||||
validate(channel);
|
channelPromise.then(channel => channel.show(columnOrPreserveFocus, preserveFocus));
|
||||||
channel.show(columnOrPreserveFocus, preserveFocus);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
hide(): void {
|
hide(): void {
|
||||||
channelPromise.then(channel => {
|
validate();
|
||||||
validate(channel);
|
channelPromise.then(channel => channel.hide());
|
||||||
channel.hide();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
channelPromise.then(channel => {
|
disposed = true;
|
||||||
validate(channel);
|
channelPromise.then(channel => channel.dispose());
|
||||||
channel.dispose();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
||||||
// ---- QuickInput
|
// ---- QuickInput
|
||||||
|
|
||||||
createQuickPick<T extends QuickPickItem>(extensionId: ExtensionIdentifier, enableProposedApi: boolean): QuickPick<T> {
|
createQuickPick<T extends QuickPickItem>(extensionId: ExtensionIdentifier, enableProposedApi: boolean): QuickPick<T> {
|
||||||
const session: ExtHostQuickPick<T> = new ExtHostQuickPick(extensionId, enableProposedApi, () => this._sessions.delete(session._id));
|
const session: ExtHostQuickPick<T> = new ExtHostQuickPick(extensionId, () => this._sessions.delete(session._id));
|
||||||
this._sessions.set(session._id, session);
|
this._sessions.set(session._id, session);
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
@ -531,7 +531,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
||||||
private readonly _onDidChangeSelectionEmitter = new Emitter<T[]>();
|
private readonly _onDidChangeSelectionEmitter = new Emitter<T[]>();
|
||||||
private readonly _onDidTriggerItemButtonEmitter = new Emitter<QuickPickItemButtonEvent<T>>();
|
private readonly _onDidTriggerItemButtonEmitter = new Emitter<QuickPickItemButtonEvent<T>>();
|
||||||
|
|
||||||
constructor(extensionId: ExtensionIdentifier, private readonly enableProposedApi: boolean, onDispose: () => void) {
|
constructor(extensionId: ExtensionIdentifier, onDispose: () => void) {
|
||||||
super(extensionId, onDispose);
|
super(extensionId, onDispose);
|
||||||
this._disposables.push(
|
this._disposables.push(
|
||||||
this._onDidChangeActiveEmitter,
|
this._onDidChangeActiveEmitter,
|
||||||
|
@ -561,16 +561,13 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
||||||
detail: item.detail,
|
detail: item.detail,
|
||||||
picked: item.picked,
|
picked: item.picked,
|
||||||
alwaysShow: item.alwaysShow,
|
alwaysShow: item.alwaysShow,
|
||||||
// Proposed API only at the moment
|
buttons: item.buttons?.map<TransferQuickInputButton>((button, i) => {
|
||||||
buttons: item.buttons && this.enableProposedApi
|
return {
|
||||||
? item.buttons.map<TransferQuickInputButton>((button, i) => {
|
...getIconPathOrClass(button),
|
||||||
return {
|
tooltip: button.tooltip,
|
||||||
...getIconPathOrClass(button),
|
handle: i
|
||||||
tooltip: button.tooltip,
|
};
|
||||||
handle: i
|
}),
|
||||||
};
|
|
||||||
})
|
|
||||||
: undefined,
|
|
||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,16 +266,6 @@ export class ExtHostSCMInputBox implements vscode.SourceControlInputBox {
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
focus(): void {
|
|
||||||
checkProposedApiEnabled(this._extension);
|
|
||||||
|
|
||||||
if (!this._visible) {
|
|
||||||
this.visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._proxy.$setInputBoxFocus(this._sourceControlHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
showValidationMessage(message: string | vscode.MarkdownString, type: vscode.SourceControlInputBoxValidationType) {
|
showValidationMessage(message: string | vscode.MarkdownString, type: vscode.SourceControlInputBoxValidationType) {
|
||||||
checkProposedApiEnabled(this._extension);
|
checkProposedApiEnabled(this._extension);
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ export class ExtHostWebviews implements extHostProtocol.ExtHostWebviewsShape {
|
||||||
this._logService.warn(`${extensionId} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`);
|
this._logService.warn(`${extensionId} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public createNewWebview(handle: string, options: extHostProtocol.IWebviewOptions, extension: IExtensionDescription): ExtHostWebview {
|
public createNewWebview(handle: string, options: extHostProtocol.IWebviewContentOptions, extension: IExtensionDescription): ExtHostWebview {
|
||||||
const webview = new ExtHostWebview(handle, this._webviewProxy, reviveOptions(options), this.initData, this.workspace, extension, this._deprecationService);
|
const webview = new ExtHostWebview(handle, this._webviewProxy, reviveOptions(options), this.initData, this.workspace, extension, this._deprecationService);
|
||||||
this._webviews.set(handle, webview);
|
this._webviews.set(handle, webview);
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ export function serializeWebviewOptions(
|
||||||
extension: IExtensionDescription,
|
extension: IExtensionDescription,
|
||||||
workspace: IExtHostWorkspace | undefined,
|
workspace: IExtHostWorkspace | undefined,
|
||||||
options: vscode.WebviewOptions,
|
options: vscode.WebviewOptions,
|
||||||
): extHostProtocol.IWebviewOptions {
|
): extHostProtocol.IWebviewContentOptions {
|
||||||
return {
|
return {
|
||||||
enableCommandUris: options.enableCommandUris,
|
enableCommandUris: options.enableCommandUris,
|
||||||
enableScripts: options.enableScripts,
|
enableScripts: options.enableScripts,
|
||||||
|
@ -212,7 +212,7 @@ export function serializeWebviewOptions(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function reviveOptions(options: extHostProtocol.IWebviewOptions): vscode.WebviewOptions {
|
export function reviveOptions(options: extHostProtocol.IWebviewContentOptions): vscode.WebviewOptions {
|
||||||
return {
|
return {
|
||||||
enableCommandUris: options.enableCommandUris,
|
enableCommandUris: options.enableCommandUris,
|
||||||
enableScripts: options.enableScripts,
|
enableScripts: options.enableScripts,
|
||||||
|
|
|
@ -281,7 +281,7 @@ export class ExtHostWebviewPanels implements extHostProtocol.ExtHostWebviewPanel
|
||||||
initData: {
|
initData: {
|
||||||
title: string;
|
title: string;
|
||||||
state: any;
|
state: any;
|
||||||
webviewOptions: extHostProtocol.IWebviewOptions;
|
webviewOptions: extHostProtocol.IWebviewContentOptions;
|
||||||
panelOptions: extHostProtocol.IWebviewPanelOptions;
|
panelOptions: extHostProtocol.IWebviewPanelOptions;
|
||||||
},
|
},
|
||||||
position: EditorGroupColumn
|
position: EditorGroupColumn
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { IEditorPaneRegistry, IEditorPaneDescriptor } from 'vs/workbench/browser
|
||||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||||
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IEditorProgressService, IOperation, LongRunningOperation } from 'vs/platform/progress/common/progress';
|
import { IEditorProgressService, LongRunningOperation } from 'vs/platform/progress/common/progress';
|
||||||
import { IEditorGroupView, DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor';
|
import { IEditorGroupView, DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor';
|
||||||
import { Emitter } from 'vs/base/common/event';
|
import { Emitter } from 'vs/base/common/event';
|
||||||
import { assertIsDefined } from 'vs/base/common/types';
|
import { assertIsDefined } from 'vs/base/common/types';
|
||||||
|
@ -146,20 +146,8 @@ export class EditorPanes extends Disposable {
|
||||||
// Editor pane
|
// Editor pane
|
||||||
const pane = this.doShowEditorPane(descriptor);
|
const pane = this.doShowEditorPane(descriptor);
|
||||||
|
|
||||||
// Show progress while setting input after a certain timeout.
|
|
||||||
// If the workbench is opening be more relaxed about progress
|
|
||||||
// showing by increasing the delay a little bit to reduce flicker.
|
|
||||||
const operation = this.editorOperation.start(this.layoutService.isRestored() ? 800 : 3200);
|
|
||||||
|
|
||||||
// Apply input to pane
|
// Apply input to pane
|
||||||
let changed: boolean;
|
const { changed, cancelled } = await this.doSetInput(pane, editor, options, context);
|
||||||
let cancelled: boolean;
|
|
||||||
try {
|
|
||||||
changed = await this.doSetInput(pane, operation, editor, options, context);
|
|
||||||
cancelled = !operation.isCurrent();
|
|
||||||
} finally {
|
|
||||||
operation.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Focus unless cancelled
|
// Focus unless cancelled
|
||||||
if (!cancelled) {
|
if (!cancelled) {
|
||||||
|
@ -263,22 +251,36 @@ export class EditorPanes extends Disposable {
|
||||||
this._onDidChangeSizeConstraints.fire(undefined);
|
this._onDidChangeSizeConstraints.fire(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async doSetInput(editorPane: EditorPane, operation: IOperation, editor: EditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext): Promise<boolean> {
|
private async doSetInput(editorPane: EditorPane, editor: EditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext): Promise<{ changed: boolean, cancelled: boolean }> {
|
||||||
const forceReload = options?.forceReload;
|
|
||||||
|
// If the input did not change, return early and only
|
||||||
|
// apply the options unless the options instruct us to
|
||||||
|
// force open it even if it is the same
|
||||||
const inputMatches = editorPane.input?.matches(editor);
|
const inputMatches = editorPane.input?.matches(editor);
|
||||||
|
if (inputMatches && !options?.forceReload) {
|
||||||
// If the input did not change, return early and only apply the options
|
|
||||||
// unless the options instruct us to force open it even if it is the same
|
|
||||||
if (inputMatches && !forceReload) {
|
|
||||||
editorPane.setOptions(options);
|
editorPane.setOptions(options);
|
||||||
|
|
||||||
|
return { changed: false, cancelled: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise set the input to the editor pane
|
// Start a new editor input operation to report progress
|
||||||
else {
|
// and to support cancellation. Any new operation that is
|
||||||
|
// started will cancel the previous one.
|
||||||
|
const operation = this.editorOperation.start(this.layoutService.isRestored() ? 800 : 3200);
|
||||||
|
|
||||||
|
// Set the input to the editor pane
|
||||||
|
let cancelled = false;
|
||||||
|
try {
|
||||||
await editorPane.setInput(editor, options, context, operation.token);
|
await editorPane.setInput(editor, options, context, operation.token);
|
||||||
|
|
||||||
|
if (!operation.isCurrent()) {
|
||||||
|
cancelled = true;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
operation.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return !inputMatches;
|
return { changed: !inputMatches, cancelled };
|
||||||
}
|
}
|
||||||
|
|
||||||
private doHideActiveEditorPane(): void {
|
private doHideActiveEditorPane(): void {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import 'vs/css!./media/style';
|
import 'vs/css!./media/style';
|
||||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||||
import { iconForeground, foreground, selectionBackground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground, inputPlaceholderForeground, toolbarHoverBackground, toolbarActiveBackground, toolbarHoverOutline, listFocusHighlightForeground } from 'vs/platform/theme/common/colorRegistry';
|
import { iconForeground, foreground, selectionBackground, focusBorder, listHighlightForeground, inputPlaceholderForeground, toolbarHoverBackground, toolbarActiveBackground, toolbarHoverOutline, listFocusHighlightForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||||
import { WORKBENCH_BACKGROUND, TITLE_BAR_ACTIVE_BACKGROUND } from 'vs/workbench/common/theme';
|
import { WORKBENCH_BACKGROUND, TITLE_BAR_ACTIVE_BACKGROUND } from 'vs/workbench/common/theme';
|
||||||
import { isWeb, isIOS, isMacintosh, isWindows } from 'vs/base/common/platform';
|
import { isWeb, isIOS, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||||
import { createMetaElement } from 'vs/base/browser/dom';
|
import { createMetaElement } from 'vs/base/browser/dom';
|
||||||
|
@ -71,51 +71,6 @@ registerThemingParticipant((theme, collector) => {
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scrollbars
|
|
||||||
const scrollbarShadowColor = theme.getColor(scrollbarShadow);
|
|
||||||
if (scrollbarShadowColor) {
|
|
||||||
collector.addRule(`
|
|
||||||
.monaco-workbench .monaco-scrollable-element > .shadow.top {
|
|
||||||
box-shadow: ${scrollbarShadowColor} 0 6px 6px -6px inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-workbench .monaco-scrollable-element > .shadow.left {
|
|
||||||
box-shadow: ${scrollbarShadowColor} 6px 0 6px -6px inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-workbench .monaco-scrollable-element > .shadow.top.left {
|
|
||||||
box-shadow: ${scrollbarShadowColor} 6px 6px 6px -6px inset;
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground);
|
|
||||||
if (scrollbarSliderBackgroundColor) {
|
|
||||||
collector.addRule(`
|
|
||||||
.monaco-workbench .monaco-scrollable-element > .scrollbar > .slider {
|
|
||||||
background: ${scrollbarSliderBackgroundColor};
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground);
|
|
||||||
if (scrollbarSliderHoverBackgroundColor) {
|
|
||||||
collector.addRule(`
|
|
||||||
.monaco-workbench .monaco-scrollable-element > .scrollbar > .slider:hover {
|
|
||||||
background: ${scrollbarSliderHoverBackgroundColor};
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground);
|
|
||||||
if (scrollbarSliderActiveBackgroundColor) {
|
|
||||||
collector.addRule(`
|
|
||||||
.monaco-workbench .monaco-scrollable-element > .scrollbar > .slider.active {
|
|
||||||
background: ${scrollbarSliderActiveBackgroundColor};
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Focus outline
|
// Focus outline
|
||||||
const focusOutline = theme.getColor(focusBorder);
|
const focusOutline = theme.getColor(focusBorder);
|
||||||
if (focusOutline) {
|
if (focusOutline) {
|
||||||
|
|
|
@ -574,13 +574,16 @@ class Launch extends AbstractLaunch implements ILaunch {
|
||||||
} catch {
|
} catch {
|
||||||
// launch.json not found: create one by collecting launch configs from debugConfigProviders
|
// launch.json not found: create one by collecting launch configs from debugConfigProviders
|
||||||
content = await this.getInitialConfigurationContent(this.workspace.uri, type, token);
|
content = await this.getInitialConfigurationContent(this.workspace.uri, type, token);
|
||||||
if (content) {
|
if (!content) {
|
||||||
created = true; // pin only if config file is created #8727
|
// Cancelled
|
||||||
try {
|
return { editor: null, created: false };
|
||||||
await this.textFileService.write(resource, content);
|
}
|
||||||
} catch (error) {
|
|
||||||
throw new Error(nls.localize('DebugConfig.failed', "Unable to create 'launch.json' file inside the '.vscode' folder ({0}).", error.message));
|
created = true; // pin only if config file is created #8727
|
||||||
}
|
try {
|
||||||
|
await this.textFileService.write(resource, content);
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(nls.localize('DebugConfig.failed', "Unable to create 'launch.json' file inside the '.vscode' folder ({0}).", error.message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@ interface OpenersMemento {
|
||||||
[id: string]: RegisteredExternalOpener;
|
[id: string]: RegisteredExternalOpener;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class ContributedExternalUriOpenersStore extends Disposable {
|
export class ContributedExternalUriOpenersStore extends Disposable {
|
||||||
|
|
||||||
private static readonly STORAGE_ID = 'externalUriOpeners';
|
private static readonly STORAGE_ID = 'externalUriOpeners';
|
||||||
|
@ -37,8 +35,8 @@ export class ContributedExternalUriOpenersStore extends Disposable {
|
||||||
|
|
||||||
this._memento = new Memento(ContributedExternalUriOpenersStore.STORAGE_ID, storageService);
|
this._memento = new Memento(ContributedExternalUriOpenersStore.STORAGE_ID, storageService);
|
||||||
this._mementoObject = this._memento.getMemento(StorageScope.GLOBAL, StorageTarget.MACHINE);
|
this._mementoObject = this._memento.getMemento(StorageScope.GLOBAL, StorageTarget.MACHINE);
|
||||||
for (const id of Object.keys(this._mementoObject || {})) {
|
for (const [id, value] of Object.entries(this._mementoObject || {})) {
|
||||||
this.add(id, this._mementoObject[id].extensionId, { isCurrentlyRegistered: false });
|
this.add(id, value.extensionId, { isCurrentlyRegistered: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.invalidateOpenersOnExtensionsChanged();
|
this.invalidateOpenersOnExtensionsChanged();
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
|
||||||
import { IFileService, whenProviderRegistered } from 'vs/platform/files/common/files';
|
import { IFileService, whenProviderRegistered } from 'vs/platform/files/common/files';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/services/output/common/output';
|
import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/services/output/common/output';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||||
import { isWeb } from 'vs/base/common/platform';
|
import { isWeb } from 'vs/base/common/platform';
|
||||||
|
@ -24,8 +24,9 @@ import { LogsDataCleaner } from 'vs/workbench/contrib/logs/common/logsDataCleane
|
||||||
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
|
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
|
||||||
import { supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
import { supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
import { IProductService } from 'vs/platform/product/common/productService';
|
import { IProductService } from 'vs/platform/product/common/productService';
|
||||||
import { timeout } from 'vs/base/common/async';
|
import { createCancelablePromise, timeout } from 'vs/base/common/async';
|
||||||
import { getErrorMessage } from 'vs/base/common/errors';
|
import { canceled, getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors';
|
||||||
|
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||||
|
|
||||||
const workbenchActionsRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
const workbenchActionsRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||||
workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(SetLogLevelAction), 'Developer: Set Log Level...', CATEGORIES.Developer.value);
|
workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(SetLogLevelAction), 'Developer: Set Log Level...', CATEGORIES.Developer.value);
|
||||||
|
@ -99,24 +100,31 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
|
||||||
await whenProviderRegistered(file, this.fileService);
|
await whenProviderRegistered(file, this.fileService);
|
||||||
const outputChannelRegistry = Registry.as<IOutputChannelRegistry>(OutputExt.OutputChannels);
|
const outputChannelRegistry = Registry.as<IOutputChannelRegistry>(OutputExt.OutputChannels);
|
||||||
try {
|
try {
|
||||||
await this.whenFileExists(file, 1);
|
const promise = createCancelablePromise(token => this.whenFileExists(file, 1, token));
|
||||||
|
this._register(toDisposable(() => promise.cancel()));
|
||||||
|
await promise;
|
||||||
outputChannelRegistry.registerChannel({ id, label, file, log: true });
|
outputChannelRegistry.registerChannel({ id, label, file, log: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logService.error('Error while registering log channel', file.toString(), getErrorMessage(error));
|
if (!isPromiseCanceledError(error)) {
|
||||||
|
this.logService.error('Error while registering log channel', file.toString(), getErrorMessage(error));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async whenFileExists(file: URI, trial: number): Promise<void> {
|
private async whenFileExists(file: URI, trial: number, token: CancellationToken): Promise<void> {
|
||||||
const exists = await this.fileService.exists(file);
|
const exists = await this.fileService.exists(file);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (token.isCancellationRequested) {
|
||||||
|
throw canceled();
|
||||||
|
}
|
||||||
if (trial > 10) {
|
if (trial > 10) {
|
||||||
throw new Error(`Timed out while waiting for file to be created`);
|
throw new Error(`Timed out while waiting for file to be created`);
|
||||||
}
|
}
|
||||||
this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, file.toString());
|
this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, file.toString());
|
||||||
await timeout(1000);
|
await timeout(1000, token);
|
||||||
await this.whenFileExists(file, trial + 1);
|
await this.whenFileExists(file, trial + 1, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { CATEGORIES } from 'vs/workbench/common/actions';
|
||||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||||
import { Memento } from 'vs/workbench/common/memento';
|
import { Memento } from 'vs/workbench/common/memento';
|
||||||
import { HAS_OPENED_NOTEBOOK } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
import { HAS_OPENED_NOTEBOOK } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||||
import { OpenGettingStarted } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||||
|
@ -45,7 +45,7 @@ export class NotebookGettingStarted extends Disposable implements IWorkbenchCont
|
||||||
hasOpenedNotebook.set(true);
|
hasOpenedNotebook.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const needToShowGettingStarted = _configurationService.getValue(OpenGettingStarted) && !storedValue[hasShownGettingStartedKey];
|
const needToShowGettingStarted = _configurationService.getValue(NotebookSetting.openGettingStarted) && !storedValue[hasShownGettingStartedKey];
|
||||||
if (!storedValue[hasOpenedNotebookKey] || needToShowGettingStarted) {
|
if (!storedValue[hasOpenedNotebookKey] || needToShowGettingStarted) {
|
||||||
const onDidOpenNotebook = () => {
|
const onDidOpenNotebook = () => {
|
||||||
hasOpenedNotebook.set(true);
|
hasOpenedNotebook.set(true);
|
||||||
|
@ -83,7 +83,7 @@ registerAction2(class NotebookClearNotebookLayoutAction extends Action2 {
|
||||||
id: 'workbench.notebook.layout.gettingStarted',
|
id: 'workbench.notebook.layout.gettingStarted',
|
||||||
title: localize('workbench.notebook.layout.gettingStarted.label', "Reset notebook getting started"),
|
title: localize('workbench.notebook.layout.gettingStarted.label', "Reset notebook getting started"),
|
||||||
f1: true,
|
f1: true,
|
||||||
precondition: ContextKeyExpr.equals(`config.${OpenGettingStarted}`, true),
|
precondition: ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true),
|
||||||
category: CATEGORIES.Developer,
|
category: CATEGORIES.Developer,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/act
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { INotebookActionContext, NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
import { INotebookActionContext, NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
||||||
import { CellToolbarLocation } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
|
|
||||||
const TOGGLE_CELL_TOOLBAR_POSITION = 'notebook.toggleCellToolbarPosition';
|
const TOGGLE_CELL_TOOLBAR_POSITION = 'notebook.toggleCellToolbarPosition';
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ export class ToggleCellToolbarPositionAction extends Action2 {
|
||||||
// from toolbar
|
// from toolbar
|
||||||
const viewType = editor.textModel.viewType;
|
const viewType = editor.textModel.viewType;
|
||||||
const configurationService = accessor.get(IConfigurationService);
|
const configurationService = accessor.get(IConfigurationService);
|
||||||
const toolbarPosition = configurationService.getValue<string | { [key: string]: string }>(CellToolbarLocation);
|
const toolbarPosition = configurationService.getValue<string | { [key: string]: string }>(NotebookSetting.cellToolbarLocation);
|
||||||
const newConfig = this.togglePosition(viewType, toolbarPosition);
|
const newConfig = this.togglePosition(viewType, toolbarPosition);
|
||||||
await configurationService.updateValue(CellToolbarLocation, newConfig);
|
await configurationService.updateValue(NotebookSetting.cellToolbarLocation, newConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
|
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { CellToolbarLocation, CompactView, ConsolidatedRunButton, FocusIndicator, GlobalToolbar, InsertToolbarLocation, ShowCellStatusBar, UndoRedoPerCell } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { IWorkbenchAssignmentService } from 'vs/workbench/services/assignment/common/assignmentService';
|
import { IWorkbenchAssignmentService } from 'vs/workbench/services/assignment/common/assignmentService';
|
||||||
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||||
|
@ -22,34 +22,34 @@ export enum NotebookProfileType {
|
||||||
|
|
||||||
const profiles = {
|
const profiles = {
|
||||||
[NotebookProfileType.default]: {
|
[NotebookProfileType.default]: {
|
||||||
[FocusIndicator]: 'gutter',
|
[NotebookSetting.focusIndicator]: 'gutter',
|
||||||
[InsertToolbarLocation]: 'both',
|
[NotebookSetting.insertToolbarLocation]: 'both',
|
||||||
[GlobalToolbar]: true,
|
[NotebookSetting.globalToolbar]: true,
|
||||||
[CellToolbarLocation]: { default: 'right' },
|
[NotebookSetting.cellToolbarLocation]: { default: 'right' },
|
||||||
[CompactView]: true,
|
[NotebookSetting.compactView]: true,
|
||||||
[ShowCellStatusBar]: 'visible',
|
[NotebookSetting.showCellStatusBar]: 'visible',
|
||||||
[ConsolidatedRunButton]: true,
|
[NotebookSetting.consolidatedRunButton]: true,
|
||||||
[UndoRedoPerCell]: false
|
[NotebookSetting.undoRedoPerCell]: false
|
||||||
},
|
},
|
||||||
[NotebookProfileType.jupyter]: {
|
[NotebookProfileType.jupyter]: {
|
||||||
[FocusIndicator]: 'gutter',
|
[NotebookSetting.focusIndicator]: 'gutter',
|
||||||
[InsertToolbarLocation]: 'notebookToolbar',
|
[NotebookSetting.insertToolbarLocation]: 'notebookToolbar',
|
||||||
[GlobalToolbar]: true,
|
[NotebookSetting.globalToolbar]: true,
|
||||||
[CellToolbarLocation]: { default: 'left' },
|
[NotebookSetting.cellToolbarLocation]: { default: 'left' },
|
||||||
[CompactView]: true,
|
[NotebookSetting.compactView]: true,
|
||||||
[ShowCellStatusBar]: 'visible',
|
[NotebookSetting.showCellStatusBar]: 'visible',
|
||||||
[ConsolidatedRunButton]: false,
|
[NotebookSetting.consolidatedRunButton]: false,
|
||||||
[UndoRedoPerCell]: true
|
[NotebookSetting.undoRedoPerCell]: true
|
||||||
},
|
},
|
||||||
[NotebookProfileType.colab]: {
|
[NotebookProfileType.colab]: {
|
||||||
[FocusIndicator]: 'border',
|
[NotebookSetting.focusIndicator]: 'border',
|
||||||
[InsertToolbarLocation]: 'betweenCells',
|
[NotebookSetting.insertToolbarLocation]: 'betweenCells',
|
||||||
[GlobalToolbar]: false,
|
[NotebookSetting.globalToolbar]: false,
|
||||||
[CellToolbarLocation]: { default: 'right' },
|
[NotebookSetting.cellToolbarLocation]: { default: 'right' },
|
||||||
[CompactView]: false,
|
[NotebookSetting.compactView]: false,
|
||||||
[ShowCellStatusBar]: 'hidden',
|
[NotebookSetting.showCellStatusBar]: 'hidden',
|
||||||
[ConsolidatedRunButton]: true,
|
[NotebookSetting.consolidatedRunButton]: true,
|
||||||
[UndoRedoPerCell]: false
|
[NotebookSetting.undoRedoPerCell]: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,13 +101,13 @@ export class NotebookProfileContribution extends Disposable {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// check if settings are already modified
|
// check if settings are already modified
|
||||||
const focusIndicator = configService.getValue(FocusIndicator);
|
const focusIndicator = configService.getValue(NotebookSetting.focusIndicator);
|
||||||
const insertToolbarPosition = configService.getValue(InsertToolbarLocation);
|
const insertToolbarPosition = configService.getValue(NotebookSetting.insertToolbarLocation);
|
||||||
const globalToolbar = configService.getValue(GlobalToolbar);
|
const globalToolbar = configService.getValue(NotebookSetting.globalToolbar);
|
||||||
// const cellToolbarLocation = configService.getValue(CellToolbarLocation);
|
// const cellToolbarLocation = configService.getValue(NotebookSetting.cellToolbarLocation);
|
||||||
const compactView = configService.getValue(CompactView);
|
const compactView = configService.getValue(NotebookSetting.compactView);
|
||||||
const showCellStatusBar = configService.getValue(ShowCellStatusBar);
|
const showCellStatusBar = configService.getValue(NotebookSetting.showCellStatusBar);
|
||||||
const consolidatedRunButton = configService.getValue(ConsolidatedRunButton);
|
const consolidatedRunButton = configService.getValue(NotebookSetting.consolidatedRunButton);
|
||||||
if (focusIndicator === 'border'
|
if (focusIndicator === 'border'
|
||||||
&& insertToolbarPosition === 'both'
|
&& insertToolbarPosition === 'both'
|
||||||
&& globalToolbar === false
|
&& globalToolbar === false
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { insertCell } from 'vs/workbench/contrib/notebook/browser/controller/cel
|
||||||
import { cellExecutionArgs, CellToolbarOrder, CELL_TITLE_CELL_GROUP_ID, executeNotebookCondition, getContextFromActiveEditor, getContextFromUri, INotebookActionContext, INotebookCellActionContext, INotebookCellToolbarActionContext, INotebookCommandContext, NotebookAction, NotebookCellAction, NotebookMultiCellAction, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, parseMultiCellExecutionArgs } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
import { cellExecutionArgs, CellToolbarOrder, CELL_TITLE_CELL_GROUP_ID, executeNotebookCondition, getContextFromActiveEditor, getContextFromUri, INotebookActionContext, INotebookCellActionContext, INotebookCellToolbarActionContext, INotebookCommandContext, NotebookAction, NotebookCellAction, NotebookMultiCellAction, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, parseMultiCellExecutionArgs } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
||||||
import { CellEditState, CellFocusMode, EXECUTE_CELL_COMMAND_ID, NOTEBOOK_CELL_EXECUTING, NOTEBOOK_CELL_EXECUTION_STATE, NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_CELL_TYPE, NOTEBOOK_HAS_RUNNING_CELL, NOTEBOOK_INTERRUPTIBLE_KERNEL, NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_KERNEL_COUNT, NOTEBOOK_MISSING_KERNEL_EXTENSION } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
import { CellEditState, CellFocusMode, EXECUTE_CELL_COMMAND_ID, NOTEBOOK_CELL_EXECUTING, NOTEBOOK_CELL_EXECUTION_STATE, NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_CELL_TYPE, NOTEBOOK_HAS_RUNNING_CELL, NOTEBOOK_INTERRUPTIBLE_KERNEL, NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_KERNEL_COUNT, NOTEBOOK_MISSING_KERNEL_EXTENSION } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||||
import * as icons from 'vs/workbench/contrib/notebook/browser/notebookIcons';
|
import * as icons from 'vs/workbench/contrib/notebook/browser/notebookIcons';
|
||||||
import { CellKind, ConsolidatedRunButton, NotebookCellExecutionState } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { CellKind, NotebookSetting, NotebookCellExecutionState } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
||||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
|
@ -207,7 +207,7 @@ registerAction2(class ExecuteAboveCells extends NotebookMultiCellAction {
|
||||||
id: MenuId.NotebookCellExecute,
|
id: MenuId.NotebookCellExecute,
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
executeCondition,
|
executeCondition,
|
||||||
ContextKeyExpr.equals(`config.${ConsolidatedRunButton}`, true))
|
ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, true))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: MenuId.NotebookCellTitle,
|
id: MenuId.NotebookCellTitle,
|
||||||
|
@ -215,7 +215,7 @@ registerAction2(class ExecuteAboveCells extends NotebookMultiCellAction {
|
||||||
group: CELL_TITLE_CELL_GROUP_ID,
|
group: CELL_TITLE_CELL_GROUP_ID,
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
executeCondition,
|
executeCondition,
|
||||||
ContextKeyExpr.equals(`config.${ConsolidatedRunButton}`, false))
|
ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
icon: icons.executeAboveIcon
|
icon: icons.executeAboveIcon
|
||||||
|
@ -253,7 +253,7 @@ registerAction2(class ExecuteCellAndBelow extends NotebookMultiCellAction {
|
||||||
id: MenuId.NotebookCellExecute,
|
id: MenuId.NotebookCellExecute,
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
executeCondition,
|
executeCondition,
|
||||||
ContextKeyExpr.equals(`config.${ConsolidatedRunButton}`, true))
|
ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, true))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: MenuId.NotebookCellTitle,
|
id: MenuId.NotebookCellTitle,
|
||||||
|
@ -261,7 +261,7 @@ registerAction2(class ExecuteCellAndBelow extends NotebookMultiCellAction {
|
||||||
group: CELL_TITLE_CELL_GROUP_ID,
|
group: CELL_TITLE_CELL_GROUP_ID,
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
executeCondition,
|
executeCondition,
|
||||||
ContextKeyExpr.equals(`config.${ConsolidatedRunButton}`, false))
|
ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
icon: icons.executeBelowIcon
|
icon: icons.executeBelowIcon
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { insertCell } from 'vs/workbench/contrib/notebook/browser/controller/cel
|
||||||
import { INotebookActionContext, NotebookAction } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
import { INotebookActionContext, NotebookAction } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
||||||
import { NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_EDITOR_EDITABLE } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
import { NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_EDITOR_EDITABLE } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||||
import { CellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel';
|
import { CellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel';
|
||||||
import { CellKind, GlobalToolbarShowLabel } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { CellKind, NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
|
|
||||||
const INSERT_CODE_CELL_ABOVE_COMMAND_ID = 'notebook.cell.insertCodeCellAbove';
|
const INSERT_CODE_CELL_ABOVE_COMMAND_ID = 'notebook.cell.insertCodeCellAbove';
|
||||||
const INSERT_CODE_CELL_BELOW_COMMAND_ID = 'notebook.cell.insertCodeCellBelow';
|
const INSERT_CODE_CELL_BELOW_COMMAND_ID = 'notebook.cell.insertCodeCellBelow';
|
||||||
|
@ -323,7 +323,7 @@ MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
||||||
NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true),
|
NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true),
|
||||||
ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells'),
|
ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells'),
|
||||||
ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden'),
|
ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden'),
|
||||||
ContextKeyExpr.notEquals(`config.${GlobalToolbarShowLabel}`, false)
|
ContextKeyExpr.notEquals(`config.${NotebookSetting.globalToolbarShowLabel}`, false)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
|
||||||
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
||||||
import { NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
import { NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
|
||||||
import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||||
import { OpenGettingStarted } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
|
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
|
||||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
||||||
id: 'workbench.notebook.layout.select',
|
id: 'workbench.notebook.layout.select',
|
||||||
title: localize('workbench.notebook.layout.select.label', "Select between Notebook Layouts"),
|
title: localize('workbench.notebook.layout.select.label', "Select between Notebook Layouts"),
|
||||||
f1: true,
|
f1: true,
|
||||||
precondition: ContextKeyExpr.equals(`config.${OpenGettingStarted}`, true),
|
precondition: ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true),
|
||||||
category: NOTEBOOK_ACTIONS_CATEGORY,
|
category: NOTEBOOK_ACTIONS_CATEGORY,
|
||||||
menu: [
|
menu: [
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
NOTEBOOK_IS_ACTIVE_EDITOR,
|
NOTEBOOK_IS_ACTIVE_EDITOR,
|
||||||
ContextKeyExpr.notEquals('config.notebook.globalToolbar', true),
|
ContextKeyExpr.notEquals('config.notebook.globalToolbar', true),
|
||||||
ContextKeyExpr.equals(`config.${OpenGettingStarted}`, true)
|
ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)
|
||||||
),
|
),
|
||||||
order: 0
|
order: 0
|
||||||
},
|
},
|
||||||
|
@ -41,7 +41,7 @@ registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
||||||
group: 'notebookLayout',
|
group: 'notebookLayout',
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
ContextKeyExpr.equals('config.notebook.globalToolbar', true),
|
ContextKeyExpr.equals('config.notebook.globalToolbar', true),
|
||||||
ContextKeyExpr.equals(`config.${OpenGettingStarted}`, true)
|
ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)
|
||||||
),
|
),
|
||||||
order: 0
|
order: 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,13 @@ import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { DiffElementViewModelBase, getFormatedMetadataJSON, OUTPUT_EDITOR_HEIGHT_MAGIC, PropertyFoldingState, SideBySideDiffElementViewModel, SingleSideDiffElementViewModel } from 'vs/workbench/contrib/notebook/browser/diff/diffElementViewModel';
|
import { DiffElementViewModelBase, getFormatedMetadataJSON, getFormatedOutputJSON, OUTPUT_EDITOR_HEIGHT_MAGIC, PropertyFoldingState, SideBySideDiffElementViewModel, SingleSideDiffElementViewModel } from 'vs/workbench/contrib/notebook/browser/diff/diffElementViewModel';
|
||||||
import { CellDiffSideBySideRenderTemplate, CellDiffSingleSideRenderTemplate, DiffSide, DIFF_CELL_MARGIN, INotebookTextDiffEditor, NOTEBOOK_DIFF_CELL_INPUT, NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED } from 'vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser';
|
import { CellDiffSideBySideRenderTemplate, CellDiffSingleSideRenderTemplate, DiffSide, DIFF_CELL_MARGIN, INotebookTextDiffEditor, NOTEBOOK_DIFF_CELL_INPUT, NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED } from 'vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser';
|
||||||
import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditorWidget';
|
import { CodeEditorWidget, ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditorWidget';
|
||||||
import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget';
|
import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget';
|
||||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||||
import { CellEditType, CellUri, IOutputDto, NotebookCellMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { CellEditType, CellUri, NotebookCellMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
|
import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
|
||||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||||
import { IMenu, IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions';
|
import { IMenu, IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||||
|
@ -99,6 +99,7 @@ export const fixedDiffEditorOptions: IDiffEditorConstructionOptions = {
|
||||||
class PropertyHeader extends Disposable {
|
class PropertyHeader extends Disposable {
|
||||||
protected _foldingIndicator!: HTMLElement;
|
protected _foldingIndicator!: HTMLElement;
|
||||||
protected _statusSpan!: HTMLElement;
|
protected _statusSpan!: HTMLElement;
|
||||||
|
protected _description!: HTMLElement;
|
||||||
protected _toolbar!: ToolBar;
|
protected _toolbar!: ToolBar;
|
||||||
protected _menu!: IMenu;
|
protected _menu!: IMenu;
|
||||||
protected _propertyExpanded?: IContextKey<boolean>;
|
protected _propertyExpanded?: IContextKey<boolean>;
|
||||||
|
@ -109,7 +110,7 @@ class PropertyHeader extends Disposable {
|
||||||
readonly notebookEditor: INotebookTextDiffEditor,
|
readonly notebookEditor: INotebookTextDiffEditor,
|
||||||
readonly accessor: {
|
readonly accessor: {
|
||||||
updateInfoRendering: (renderOutput: boolean) => void;
|
updateInfoRendering: (renderOutput: boolean) => void;
|
||||||
checkIfModified: (cell: DiffElementViewModelBase) => boolean;
|
checkIfModified: (cell: DiffElementViewModelBase) => false | { reason: string | undefined };
|
||||||
getFoldingState: (cell: DiffElementViewModelBase) => PropertyFoldingState;
|
getFoldingState: (cell: DiffElementViewModelBase) => PropertyFoldingState;
|
||||||
updateFoldingState: (cell: DiffElementViewModelBase, newState: PropertyFoldingState) => void;
|
updateFoldingState: (cell: DiffElementViewModelBase, newState: PropertyFoldingState) => void;
|
||||||
unChangedLabel: string;
|
unChangedLabel: string;
|
||||||
|
@ -132,14 +133,20 @@ class PropertyHeader extends Disposable {
|
||||||
this._foldingIndicator.classList.add(this.accessor.prefix);
|
this._foldingIndicator.classList.add(this.accessor.prefix);
|
||||||
this._updateFoldingIcon();
|
this._updateFoldingIcon();
|
||||||
const metadataStatus = DOM.append(this.propertyHeaderContainer, DOM.$('div.property-status'));
|
const metadataStatus = DOM.append(this.propertyHeaderContainer, DOM.$('div.property-status'));
|
||||||
|
|
||||||
this._statusSpan = DOM.append(metadataStatus, DOM.$('span'));
|
this._statusSpan = DOM.append(metadataStatus, DOM.$('span'));
|
||||||
|
this._description = DOM.append(metadataStatus, DOM.$('span.property-description'));
|
||||||
|
|
||||||
if (metadataChanged) {
|
if (metadataChanged) {
|
||||||
this._statusSpan.textContent = this.accessor.changedLabel;
|
this._statusSpan.textContent = this.accessor.changedLabel;
|
||||||
this._statusSpan.style.fontWeight = 'bold';
|
this._statusSpan.style.fontWeight = 'bold';
|
||||||
|
if (metadataChanged.reason) {
|
||||||
|
this._description.textContent = metadataChanged.reason;
|
||||||
|
}
|
||||||
this.propertyHeaderContainer.classList.add('modified');
|
this.propertyHeaderContainer.classList.add('modified');
|
||||||
} else {
|
} else {
|
||||||
this._statusSpan.textContent = this.accessor.unChangedLabel;
|
this._statusSpan.textContent = this.accessor.unChangedLabel;
|
||||||
|
this._description.textContent = '';
|
||||||
this.propertyHeaderContainer.classList.remove('modified');
|
this.propertyHeaderContainer.classList.remove('modified');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +169,7 @@ class PropertyHeader extends Disposable {
|
||||||
const scopedContextKeyService = this.contextKeyService.createScoped(cellToolbarContainer);
|
const scopedContextKeyService = this.contextKeyService.createScoped(cellToolbarContainer);
|
||||||
this._register(scopedContextKeyService);
|
this._register(scopedContextKeyService);
|
||||||
const propertyChanged = NOTEBOOK_DIFF_CELL_PROPERTY.bindTo(scopedContextKeyService);
|
const propertyChanged = NOTEBOOK_DIFF_CELL_PROPERTY.bindTo(scopedContextKeyService);
|
||||||
propertyChanged.set(metadataChanged);
|
propertyChanged.set(!!metadataChanged);
|
||||||
this._propertyExpanded = NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED.bindTo(scopedContextKeyService);
|
this._propertyExpanded = NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED.bindTo(scopedContextKeyService);
|
||||||
|
|
||||||
this._menu = this.menuService.createMenu(this.accessor.menuId, scopedContextKeyService);
|
this._menu = this.menuService.createMenu(this.accessor.menuId, scopedContextKeyService);
|
||||||
|
@ -224,6 +231,9 @@ class PropertyHeader extends Disposable {
|
||||||
if (metadataChanged) {
|
if (metadataChanged) {
|
||||||
this._statusSpan.textContent = this.accessor.changedLabel;
|
this._statusSpan.textContent = this.accessor.changedLabel;
|
||||||
this._statusSpan.style.fontWeight = 'bold';
|
this._statusSpan.style.fontWeight = 'bold';
|
||||||
|
if (metadataChanged.reason) {
|
||||||
|
this._description.textContent = metadataChanged.reason;
|
||||||
|
}
|
||||||
this.propertyHeaderContainer.classList.add('modified');
|
this.propertyHeaderContainer.classList.add('modified');
|
||||||
const actions: IAction[] = [];
|
const actions: IAction[] = [];
|
||||||
createAndFillInActionBarActions(this._menu, undefined, actions);
|
createAndFillInActionBarActions(this._menu, undefined, actions);
|
||||||
|
@ -231,6 +241,7 @@ class PropertyHeader extends Disposable {
|
||||||
} else {
|
} else {
|
||||||
this._statusSpan.textContent = this.accessor.unChangedLabel;
|
this._statusSpan.textContent = this.accessor.unChangedLabel;
|
||||||
this._statusSpan.style.fontWeight = 'normal';
|
this._statusSpan.style.fontWeight = 'normal';
|
||||||
|
this._description.textContent = '';
|
||||||
this.propertyHeaderContainer.classList.remove('modified');
|
this.propertyHeaderContainer.classList.remove('modified');
|
||||||
this._toolbar.setActions([]);
|
this._toolbar.setActions([]);
|
||||||
}
|
}
|
||||||
|
@ -612,16 +623,12 @@ abstract class AbstractElementRenderer extends Disposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getFormatedOutputJSON(outputs: IOutputDto[]) {
|
|
||||||
return JSON.stringify(outputs.map(op => ({ outputs: op.outputs })), undefined, '\t');
|
|
||||||
}
|
|
||||||
|
|
||||||
private _buildOutputEditor() {
|
private _buildOutputEditor() {
|
||||||
this._outputEditorDisposeStore.clear();
|
this._outputEditorDisposeStore.clear();
|
||||||
|
|
||||||
if ((this.cell.type === 'modified' || this.cell.type === 'unchanged') && !this.notebookEditor.textModel!.transientOptions.transientOutputs) {
|
if ((this.cell.type === 'modified' || this.cell.type === 'unchanged') && !this.notebookEditor.textModel!.transientOptions.transientOutputs) {
|
||||||
const originalOutputsSource = this._getFormatedOutputJSON(this.cell.original?.outputs || []);
|
const originalOutputsSource = getFormatedOutputJSON(this.cell.original?.outputs || []);
|
||||||
const modifiedOutputsSource = this._getFormatedOutputJSON(this.cell.modified?.outputs || []);
|
const modifiedOutputsSource = getFormatedOutputJSON(this.cell.modified?.outputs || []);
|
||||||
if (originalOutputsSource !== modifiedOutputsSource) {
|
if (originalOutputsSource !== modifiedOutputsSource) {
|
||||||
const mode = this.modeService.create('json');
|
const mode = this.modeService.create('json');
|
||||||
const originalModel = this.modelService.createModel(originalOutputsSource, mode, undefined, true);
|
const originalModel = this.modelService.createModel(originalOutputsSource, mode, undefined, true);
|
||||||
|
@ -664,7 +671,7 @@ abstract class AbstractElementRenderer extends Disposable {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._outputEditorDisposeStore.add(this.cell.modified!.textModel.onDidChangeOutputs(() => {
|
this._outputEditorDisposeStore.add(this.cell.modified!.textModel.onDidChangeOutputs(() => {
|
||||||
const modifiedOutputsSource = this._getFormatedOutputJSON(this.cell.modified?.outputs || []);
|
const modifiedOutputsSource = getFormatedOutputJSON(this.cell.modified?.outputs || []);
|
||||||
modifiedModel.setValue(modifiedOutputsSource);
|
modifiedModel.setValue(modifiedOutputsSource);
|
||||||
this._outputHeader.refresh();
|
this._outputHeader.refresh();
|
||||||
}));
|
}));
|
||||||
|
@ -684,7 +691,7 @@ abstract class AbstractElementRenderer extends Disposable {
|
||||||
this._outputEditorDisposeStore.add(this._outputEditor);
|
this._outputEditorDisposeStore.add(this._outputEditor);
|
||||||
|
|
||||||
const mode = this.modeService.create('json');
|
const mode = this.modeService.create('json');
|
||||||
const originaloutputSource = this._getFormatedOutputJSON(
|
const originaloutputSource = getFormatedOutputJSON(
|
||||||
this.notebookEditor.textModel!.transientOptions.transientOutputs
|
this.notebookEditor.textModel!.transientOptions.transientOutputs
|
||||||
? []
|
? []
|
||||||
: this.cell.type === 'insert'
|
: this.cell.type === 'insert'
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/no
|
||||||
import { hash } from 'vs/base/common/hash';
|
import { hash } from 'vs/base/common/hash';
|
||||||
import { format } from 'vs/base/common/jsonFormatter';
|
import { format } from 'vs/base/common/jsonFormatter';
|
||||||
import { applyEdits } from 'vs/base/common/jsonEdit';
|
import { applyEdits } from 'vs/base/common/jsonEdit';
|
||||||
import { ICellOutput, NotebookCellMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { ICellOutput, IOutputDto, IOutputItemDto, NotebookCellMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { DiffNestedCellViewModel } from 'vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel';
|
import { DiffNestedCellViewModel } from 'vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
import { NotebookDiffEditorEventDispatcher, NotebookDiffViewEventType } from 'vs/workbench/contrib/notebook/browser/diff/eventDispatcher';
|
import { NotebookDiffEditorEventDispatcher, NotebookDiffViewEventType } from 'vs/workbench/contrib/notebook/browser/diff/eventDispatcher';
|
||||||
|
@ -274,8 +274,8 @@ export abstract class DiffElementViewModelBase extends Disposable {
|
||||||
this.editorEventDispatcher.emit([{ type: NotebookDiffViewEventType.CellLayoutChanged, source: this._layoutInfo }]);
|
this.editorEventDispatcher.emit([{ type: NotebookDiffViewEventType.CellLayoutChanged, source: this._layoutInfo }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract checkIfOutputsModified(): boolean;
|
abstract checkIfOutputsModified(): false | { reason: string | undefined; };
|
||||||
abstract checkMetadataIfModified(): boolean;
|
abstract checkMetadataIfModified(): false | { reason: string | undefined; };
|
||||||
abstract isOutputEmpty(): boolean;
|
abstract isOutputEmpty(): boolean;
|
||||||
abstract getRichOutputTotalHeight(): number;
|
abstract getRichOutputTotalHeight(): number;
|
||||||
abstract getCellByUri(cellUri: URI): IGenericCellViewModel;
|
abstract getCellByUri(cellUri: URI): IGenericCellViewModel;
|
||||||
|
@ -375,11 +375,28 @@ export class SideBySideDiffElementViewModel extends DiffElementViewModelBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIfOutputsModified() {
|
checkIfOutputsModified() {
|
||||||
return !this.mainDocumentTextModel.transientOptions.transientOutputs && !outputsEqual(this.original?.outputs ?? [], this.modified?.outputs ?? []);
|
if (this.mainDocumentTextModel.transientOptions.transientOutputs) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ret = outputsEqual(this.original?.outputs ?? [], this.modified?.outputs ?? []);
|
||||||
|
|
||||||
|
if (ret === OutputComparison.Unchanged) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
reason: ret === OutputComparison.Metadata ? 'Output metadata is changed' : undefined
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
checkMetadataIfModified(): boolean {
|
checkMetadataIfModified() {
|
||||||
return hash(getFormatedMetadataJSON(this.mainDocumentTextModel, this.original?.metadata || {}, this.original?.language)) !== hash(getFormatedMetadataJSON(this.mainDocumentTextModel, this.modified?.metadata ?? {}, this.modified?.language));
|
const modified = hash(getFormatedMetadataJSON(this.mainDocumentTextModel, this.original?.metadata || {}, this.original?.language)) !== hash(getFormatedMetadataJSON(this.mainDocumentTextModel, this.modified?.metadata ?? {}, this.modified?.language));
|
||||||
|
if (modified) {
|
||||||
|
return { reason: undefined };
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateOutputHeight(diffSide: DiffSide, index: number, height: number) {
|
updateOutputHeight(diffSide: DiffSide, index: number, height: number) {
|
||||||
|
@ -489,11 +506,11 @@ export class SingleSideDiffElementViewModel extends DiffElementViewModelBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkIfOutputsModified(): boolean {
|
checkIfOutputsModified(): false | { reason: string | undefined } {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkMetadataIfModified(): boolean {
|
checkMetadataIfModified(): false | { reason: string | undefined } {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,9 +553,15 @@ export class SingleSideDiffElementViewModel extends DiffElementViewModelBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const enum OutputComparison {
|
||||||
|
Unchanged = 0,
|
||||||
|
Metadata = 1,
|
||||||
|
Other = 2
|
||||||
|
}
|
||||||
|
|
||||||
function outputsEqual(original: ICellOutput[], modified: ICellOutput[]) {
|
function outputsEqual(original: ICellOutput[], modified: ICellOutput[]) {
|
||||||
if (original.length !== modified.length) {
|
if (original.length !== modified.length) {
|
||||||
return false;
|
return OutputComparison.Other;
|
||||||
}
|
}
|
||||||
|
|
||||||
const len = original.length;
|
const len = original.length;
|
||||||
|
@ -547,11 +570,11 @@ function outputsEqual(original: ICellOutput[], modified: ICellOutput[]) {
|
||||||
const b = modified[i];
|
const b = modified[i];
|
||||||
|
|
||||||
if (hash(a.metadata) !== hash(b.metadata)) {
|
if (hash(a.metadata) !== hash(b.metadata)) {
|
||||||
return false;
|
return OutputComparison.Metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a.outputs.length !== b.outputs.length) {
|
if (a.outputs.length !== b.outputs.length) {
|
||||||
return false;
|
return OutputComparison.Other;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let j = 0; j < a.outputs.length; j++) {
|
for (let j = 0; j < a.outputs.length; j++) {
|
||||||
|
@ -559,22 +582,22 @@ function outputsEqual(original: ICellOutput[], modified: ICellOutput[]) {
|
||||||
const bOutputItem = b.outputs[j];
|
const bOutputItem = b.outputs[j];
|
||||||
|
|
||||||
if (aOutputItem.mime !== bOutputItem.mime) {
|
if (aOutputItem.mime !== bOutputItem.mime) {
|
||||||
return false;
|
return OutputComparison.Other;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aOutputItem.data.buffer.length !== bOutputItem.data.buffer.length) {
|
if (aOutputItem.data.buffer.length !== bOutputItem.data.buffer.length) {
|
||||||
return false;
|
return OutputComparison.Other;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let k = 0; k < aOutputItem.data.buffer.length; k++) {
|
for (let k = 0; k < aOutputItem.data.buffer.length; k++) {
|
||||||
if (aOutputItem.data.buffer[k] !== bOutputItem.data.buffer[k]) {
|
if (aOutputItem.data.buffer[k] !== bOutputItem.data.buffer[k]) {
|
||||||
return false;
|
return OutputComparison.Other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return OutputComparison.Unchanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFormatedMetadataJSON(documentTextModel: NotebookTextModel, metadata: NotebookCellMetadata, language?: string) {
|
export function getFormatedMetadataJSON(documentTextModel: NotebookTextModel, metadata: NotebookCellMetadata, language?: string) {
|
||||||
|
@ -604,3 +627,38 @@ export function getFormatedMetadataJSON(documentTextModel: NotebookTextModel, me
|
||||||
|
|
||||||
return metadataSource;
|
return metadataSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getStreamOutputData(outputs: IOutputItemDto[]) {
|
||||||
|
if (!outputs.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const first = outputs[0];
|
||||||
|
const mime = first.mime;
|
||||||
|
const sameStream = !outputs.find(op => op.mime !== mime);
|
||||||
|
|
||||||
|
if (sameStream) {
|
||||||
|
return outputs.map(opit => opit.data.toString()).join('');
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getFormatedOutputJSON(outputs: IOutputDto[]) {
|
||||||
|
if (outputs.length === 1) {
|
||||||
|
const streamOutputData = getStreamOutputData(outputs[0].outputs);
|
||||||
|
if (streamOutputData) {
|
||||||
|
return streamOutputData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify(outputs.map(output => {
|
||||||
|
return ({
|
||||||
|
metadata: output.metadata,
|
||||||
|
outputItems: output.outputs.map(opit => ({
|
||||||
|
mimeType: opit.mime,
|
||||||
|
data: opit.data.toString()
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
}), undefined, '\t');
|
||||||
|
}
|
||||||
|
|
|
@ -129,10 +129,15 @@
|
||||||
|
|
||||||
.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-status span,
|
.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-status span,
|
||||||
.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-status span {
|
.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-status span {
|
||||||
margin: 0 8px;
|
margin: 0 0 0 8px;
|
||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notebook-text-diff-editor .cell-diff-editor-container .output-header-container .property-status span.property-description,
|
||||||
|
.notebook-text-diff-editor .cell-diff-editor-container .metadata-header-container .property-status span.property-description {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
.notebook-text-diff-editor {
|
.notebook-text-diff-editor {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEd
|
||||||
import { isCompositeNotebookEditorInput, NotebookEditorInput, NotebookEditorInputOptions } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
import { isCompositeNotebookEditorInput, NotebookEditorInput, NotebookEditorInputOptions } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
||||||
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
|
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
|
||||||
import { NotebookService } from 'vs/workbench/contrib/notebook/browser/notebookServiceImpl';
|
import { NotebookService } from 'vs/workbench/contrib/notebook/browser/notebookServiceImpl';
|
||||||
import { CellKind, CellToolbarLocation, CellToolbarVisibility, CellUri, DisplayOrderKey, UndoRedoPerCell, IResolvedNotebookEditorModel, NotebookDocumentBackupData, NotebookTextDiffEditorPreview, NotebookWorkingCopyTypeIdentifier, ShowCellStatusBar, CompactView, FocusIndicator, InsertToolbarLocation, GlobalToolbar, ConsolidatedOutputButton, ShowFoldingControls, DragAndDropEnabled, NotebookCellEditorOptionsCustomizations, ConsolidatedRunButton, TextOutputLineLimit, GlobalToolbarShowLabel, IOutputItemDto } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { CellKind, CellUri, IResolvedNotebookEditorModel, NotebookDocumentBackupData, NotebookWorkingCopyTypeIdentifier, NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
|
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
|
||||||
import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
|
import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
|
||||||
|
@ -45,7 +45,7 @@ import { NotebookEditorWidgetService } from 'vs/workbench/contrib/notebook/brows
|
||||||
import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
|
import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
|
||||||
import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';
|
import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';
|
||||||
import { Event } from 'vs/base/common/event';
|
import { Event } from 'vs/base/common/event';
|
||||||
import { getFormatedMetadataJSON } from 'vs/workbench/contrib/notebook/browser/diff/diffElementViewModel';
|
import { getFormatedMetadataJSON, getStreamOutputData } from 'vs/workbench/contrib/notebook/browser/diff/diffElementViewModel';
|
||||||
import { NotebookModelResolverServiceImpl } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl';
|
import { NotebookModelResolverServiceImpl } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl';
|
||||||
import { INotebookKernelService } from 'vs/workbench/contrib/notebook/common/notebookKernelService';
|
import { INotebookKernelService } from 'vs/workbench/contrib/notebook/common/notebookKernelService';
|
||||||
import { NotebookKernelService } from 'vs/workbench/contrib/notebook/browser/notebookKernelServiceImpl';
|
import { NotebookKernelService } from 'vs/workbench/contrib/notebook/browser/notebookKernelServiceImpl';
|
||||||
|
@ -208,7 +208,7 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
const undoRedoPerCell = configurationService.getValue<boolean>(UndoRedoPerCell);
|
const undoRedoPerCell = configurationService.getValue<boolean>(NotebookSetting.undoRedoPerCell);
|
||||||
|
|
||||||
this._register(undoRedoService.registerUriComparisonKeyComputer(CellUri.scheme, {
|
this._register(undoRedoService.registerUriComparisonKeyComputer(CellUri.scheme, {
|
||||||
getComparisonKey: (uri: URI): string => {
|
getComparisonKey: (uri: URI): string => {
|
||||||
|
@ -372,22 +372,6 @@ class CellInfoContentProvider {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getStreamOutputData(outputs: IOutputItemDto[]) {
|
|
||||||
if (!outputs.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const first = outputs[0];
|
|
||||||
const mime = first.mime;
|
|
||||||
const sameStream = !outputs.find(op => op.mime !== mime);
|
|
||||||
|
|
||||||
if (sameStream) {
|
|
||||||
return outputs.map(opit => opit.data.toString()).join('');
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async provideOutputTextContent(resource: URI): Promise<ITextModel | null> {
|
async provideOutputTextContent(resource: URI): Promise<ITextModel | null> {
|
||||||
const existing = this._modelService.getModel(resource);
|
const existing = this._modelService.getModel(resource);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
@ -408,7 +392,7 @@ class CellInfoContentProvider {
|
||||||
if (cell.handle === data.handle) {
|
if (cell.handle === data.handle) {
|
||||||
if (cell.outputs.length === 1) {
|
if (cell.outputs.length === 1) {
|
||||||
// single output
|
// single output
|
||||||
const streamOutputData = this._getStreamOutputData(cell.outputs[0].outputs);
|
const streamOutputData = getStreamOutputData(cell.outputs[0].outputs);
|
||||||
if (streamOutputData) {
|
if (streamOutputData) {
|
||||||
result = this._modelService.createModel(
|
result = this._modelService.createModel(
|
||||||
streamOutputData,
|
streamOutputData,
|
||||||
|
@ -656,7 +640,7 @@ configurationRegistry.registerConfiguration({
|
||||||
title: nls.localize('notebookConfigurationTitle', "Notebook"),
|
title: nls.localize('notebookConfigurationTitle', "Notebook"),
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
[DisplayOrderKey]: {
|
[NotebookSetting.displayOrder]: {
|
||||||
description: nls.localize('notebook.displayOrder.description', "Priority list for output mime types"),
|
description: nls.localize('notebook.displayOrder.description', "Priority list for output mime types"),
|
||||||
type: ['array'],
|
type: ['array'],
|
||||||
items: {
|
items: {
|
||||||
|
@ -664,7 +648,7 @@ configurationRegistry.registerConfiguration({
|
||||||
},
|
},
|
||||||
default: []
|
default: []
|
||||||
},
|
},
|
||||||
[CellToolbarLocation]: {
|
[NotebookSetting.cellToolbarLocation]: {
|
||||||
description: nls.localize('notebook.cellToolbarLocation.description', "Where the cell toolbar should be shown, or whether it should be hidden."),
|
description: nls.localize('notebook.cellToolbarLocation.description', "Where the cell toolbar should be shown, or whether it should be hidden."),
|
||||||
type: 'object',
|
type: 'object',
|
||||||
additionalProperties: {
|
additionalProperties: {
|
||||||
|
@ -677,7 +661,7 @@ configurationRegistry.registerConfiguration({
|
||||||
},
|
},
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[ShowCellStatusBar]: {
|
[NotebookSetting.showCellStatusBar]: {
|
||||||
description: nls.localize('notebook.showCellStatusbar.description', "Whether the cell status bar should be shown."),
|
description: nls.localize('notebook.showCellStatusbar.description', "Whether the cell status bar should be shown."),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: ['hidden', 'visible', 'visibleAfterExecute'],
|
enum: ['hidden', 'visible', 'visibleAfterExecute'],
|
||||||
|
@ -688,39 +672,39 @@ configurationRegistry.registerConfiguration({
|
||||||
default: 'visible',
|
default: 'visible',
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[NotebookTextDiffEditorPreview]: {
|
[NotebookSetting.textDiffEditorPreview]: {
|
||||||
description: nls.localize('notebook.diff.enablePreview.description', "Whether to use the enhanced text diff editor for notebook."),
|
description: nls.localize('notebook.diff.enablePreview.description', "Whether to use the enhanced text diff editor for notebook."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[CellToolbarVisibility]: {
|
[NotebookSetting.cellToolbarVisibility]: {
|
||||||
markdownDescription: nls.localize('notebook.cellToolbarVisibility.description', "Whether the cell toolbar should appear on hover or click."),
|
markdownDescription: nls.localize('notebook.cellToolbarVisibility.description', "Whether the cell toolbar should appear on hover or click."),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: ['hover', 'click'],
|
enum: ['hover', 'click'],
|
||||||
default: 'click',
|
default: 'click',
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[UndoRedoPerCell]: {
|
[NotebookSetting.undoRedoPerCell]: {
|
||||||
description: nls.localize('notebook.undoRedoPerCell.description', "Whether to use separate undo/redo stack for each cell."),
|
description: nls.localize('notebook.undoRedoPerCell.description', "Whether to use separate undo/redo stack for each cell."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[CompactView]: {
|
[NotebookSetting.compactView]: {
|
||||||
description: nls.localize('notebook.compactView.description', "Control whether the notebook editor should be rendered in a compact form. For example, when turned on, it will decrease the left margin width."),
|
description: nls.localize('notebook.compactView.description', "Control whether the notebook editor should be rendered in a compact form. For example, when turned on, it will decrease the left margin width."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[FocusIndicator]: {
|
[NotebookSetting.focusIndicator]: {
|
||||||
description: nls.localize('notebook.focusIndicator.description', "Controls where the focus indicator is rendered, either along the cell borders or on the left gutter"),
|
description: nls.localize('notebook.focusIndicator.description', "Controls where the focus indicator is rendered, either along the cell borders or on the left gutter"),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: ['border', 'gutter'],
|
enum: ['border', 'gutter'],
|
||||||
default: 'gutter',
|
default: 'gutter',
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[InsertToolbarLocation]: {
|
[NotebookSetting.insertToolbarLocation]: {
|
||||||
description: nls.localize('notebook.insertToolbarPosition.description', "Control where the insert cell actions should appear."),
|
description: nls.localize('notebook.insertToolbarPosition.description', "Control where the insert cell actions should appear."),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: ['betweenCells', 'notebookToolbar', 'both', 'hidden'],
|
enum: ['betweenCells', 'notebookToolbar', 'both', 'hidden'],
|
||||||
|
@ -733,19 +717,19 @@ configurationRegistry.registerConfiguration({
|
||||||
default: 'both',
|
default: 'both',
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[GlobalToolbar]: {
|
[NotebookSetting.globalToolbar]: {
|
||||||
description: nls.localize('notebook.globalToolbar.description', "Control whether to render a global toolbar inside the notebook editor."),
|
description: nls.localize('notebook.globalToolbar.description', "Control whether to render a global toolbar inside the notebook editor."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[ConsolidatedOutputButton]: {
|
[NotebookSetting.consolidatedOutputButton]: {
|
||||||
description: nls.localize('notebook.consolidatedOutputButton.description', "Control whether outputs action should be rendered in the output toolbar."),
|
description: nls.localize('notebook.consolidatedOutputButton.description', "Control whether outputs action should be rendered in the output toolbar."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[ShowFoldingControls]: {
|
[NotebookSetting.showFoldingControls]: {
|
||||||
description: nls.localize('notebook.showFoldingControls.description', "Controls when the Markdown header folding arrow is shown."),
|
description: nls.localize('notebook.showFoldingControls.description', "Controls when the Markdown header folding arrow is shown."),
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: ['always', 'mouseover'],
|
enum: ['always', 'mouseover'],
|
||||||
|
@ -756,30 +740,36 @@ configurationRegistry.registerConfiguration({
|
||||||
default: 'mouseover',
|
default: 'mouseover',
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[DragAndDropEnabled]: {
|
[NotebookSetting.dragAndDropEnabled]: {
|
||||||
description: nls.localize('notebook.dragAndDrop.description', "Control whether the notebook editor should allow moving cells through drag and drop."),
|
description: nls.localize('notebook.dragAndDrop.description', "Control whether the notebook editor should allow moving cells through drag and drop."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[ConsolidatedRunButton]: {
|
[NotebookSetting.consolidatedRunButton]: {
|
||||||
description: nls.localize('notebook.consolidatedRunButton.description', "Control whether extra actions are shown in a dropdown next to the run button."),
|
description: nls.localize('notebook.consolidatedRunButton.description', "Control whether extra actions are shown in a dropdown next to the run button."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[GlobalToolbarShowLabel]: {
|
[NotebookSetting.globalToolbarShowLabel]: {
|
||||||
description: nls.localize('notebook.globalToolbarShowLabel', "Control whether the actions on the notebook toolbar should render label or not."),
|
description: nls.localize('notebook.globalToolbarShowLabel', "Control whether the actions on the notebook toolbar should render label or not."),
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[TextOutputLineLimit]: {
|
[NotebookSetting.textOutputLineLimit]: {
|
||||||
description: nls.localize('notebook.textOutputLineLimit', "Control how many lines of text in a text output is rendered."),
|
description: nls.localize('notebook.textOutputLineLimit', "Control how many lines of text in a text output is rendered."),
|
||||||
type: 'number',
|
type: 'number',
|
||||||
default: 30,
|
default: 30,
|
||||||
tags: ['notebookLayout']
|
tags: ['notebookLayout']
|
||||||
},
|
},
|
||||||
[NotebookCellEditorOptionsCustomizations]: editorOptionsCustomizationSchema
|
[NotebookSetting.markupFontSize]: {
|
||||||
|
markdownDescription: nls.localize('notebook.markup.fontSize', "Controls the font size of rendered markup in notebooks. When set to `0`, 120% of `#editor.fontSize#` is used."),
|
||||||
|
type: 'number',
|
||||||
|
default: 0,
|
||||||
|
tags: ['notebookLayout']
|
||||||
|
},
|
||||||
|
[NotebookSetting.cellEditorOptionsCustomizations]: editorOptionsCustomizationSchema
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,17 +13,15 @@ import { INotebookCellStatusBarItemList, INotebookCellStatusBarItemProvider } fr
|
||||||
|
|
||||||
export class NotebookCellStatusBarService extends Disposable implements INotebookCellStatusBarService {
|
export class NotebookCellStatusBarService extends Disposable implements INotebookCellStatusBarService {
|
||||||
|
|
||||||
private _onDidChangeProviders = this._register(new Emitter<void>());
|
readonly _serviceBrand: undefined;
|
||||||
|
|
||||||
|
private readonly _onDidChangeProviders = this._register(new Emitter<void>());
|
||||||
readonly onDidChangeProviders: Event<void> = this._onDidChangeProviders.event;
|
readonly onDidChangeProviders: Event<void> = this._onDidChangeProviders.event;
|
||||||
|
|
||||||
private _onDidChangeItems = this._register(new Emitter<void>());
|
private readonly _onDidChangeItems = this._register(new Emitter<void>());
|
||||||
readonly onDidChangeItems: Event<void> = this._onDidChangeItems.event;
|
readonly onDidChangeItems: Event<void> = this._onDidChangeItems.event;
|
||||||
|
|
||||||
private _providers: INotebookCellStatusBarItemProvider[] = [];
|
private readonly _providers: INotebookCellStatusBarItemProvider[] = [];
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
registerCellStatusBarItemProvider(provider: INotebookCellStatusBarItemProvider): IDisposable {
|
registerCellStatusBarItemProvider(provider: INotebookCellStatusBarItemProvider): IDisposable {
|
||||||
this._providers.push(provider);
|
this._providers.push(provider);
|
||||||
|
@ -52,6 +50,4 @@ export class NotebookCellStatusBarService extends Disposable implements INoteboo
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly _serviceBrand: undefined;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,7 +412,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
||||||
this._updateForNotebookConfiguration();
|
this._updateForNotebookConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.compactView || e.focusIndicator || e.insertToolbarPosition || e.cellToolbarLocation || e.dragAndDropEnabled || e.fontSize || e.insertToolbarAlignment) {
|
if (e.compactView || e.focusIndicator || e.insertToolbarPosition || e.cellToolbarLocation || e.dragAndDropEnabled || e.fontSize || e.markupFontSize || e.insertToolbarAlignment) {
|
||||||
this._styleElement?.remove();
|
this._styleElement?.remove();
|
||||||
this._createLayoutStyles();
|
this._createLayoutStyles();
|
||||||
this._webview?.updateOptions(this.notebookOptions.computeWebviewOptions());
|
this._webview?.updateOptions(this.notebookOptions.computeWebviewOptions());
|
||||||
|
|
|
@ -30,7 +30,7 @@ import { INotebookEditorOptions } from 'vs/workbench/contrib/notebook/browser/no
|
||||||
import { NotebookDiffEditorInput } from 'vs/workbench/contrib/notebook/browser/notebookDiffEditorInput';
|
import { NotebookDiffEditorInput } from 'vs/workbench/contrib/notebook/browser/notebookDiffEditorInput';
|
||||||
import { NotebookCellTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
|
import { NotebookCellTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
|
||||||
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
|
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
|
||||||
import { ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER, BUILTIN_RENDERER_ID, CellUri, DisplayOrderKey, INotebookContributionData, INotebookExclusiveDocumentFilter, INotebookRendererInfo, INotebookTextModel, IOrderedMimeType, IOutputDto, MimeTypeDisplayOrder, mimeTypeIsAlwaysSecure, mimeTypeSupportedByCore, NotebookData, NotebookEditorPriority, NotebookRendererMatch, NotebookTextDiffEditorPreview, NOTEBOOK_DISPLAY_ORDER, RENDERER_EQUIVALENT_EXTENSIONS, RENDERER_NOT_AVAILABLE, TransientOptions } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER, BUILTIN_RENDERER_ID, CellUri, NotebookSetting, INotebookContributionData, INotebookExclusiveDocumentFilter, INotebookRendererInfo, INotebookTextModel, IOrderedMimeType, IOutputDto, MimeTypeDisplayOrder, mimeTypeIsAlwaysSecure, mimeTypeSupportedByCore, NotebookData, NotebookEditorPriority, NotebookRendererMatch, NOTEBOOK_DISPLAY_ORDER, RENDERER_EQUIVALENT_EXTENSIONS, RENDERER_NOT_AVAILABLE, TransientOptions } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput';
|
||||||
import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
|
import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
|
||||||
import { updateEditorTopPadding } from 'vs/workbench/contrib/notebook/common/notebookOptions';
|
import { updateEditorTopPadding } from 'vs/workbench/contrib/notebook/common/notebookOptions';
|
||||||
|
@ -161,7 +161,7 @@ export class NotebookProviderInfoStore extends Disposable {
|
||||||
priority: notebookProviderInfo.exclusive ? RegisteredEditorPriority.exclusive : notebookProviderInfo.priority,
|
priority: notebookProviderInfo.exclusive ? RegisteredEditorPriority.exclusive : notebookProviderInfo.priority,
|
||||||
};
|
};
|
||||||
const notebookEditorOptions = {
|
const notebookEditorOptions = {
|
||||||
canHandleDiff: () => !!this._configurationService.getValue(NotebookTextDiffEditorPreview) && !this._accessibilityService.isScreenReaderOptimized(),
|
canHandleDiff: () => !!this._configurationService.getValue(NotebookSetting.textDiffEditorPreview) && !this._accessibilityService.isScreenReaderOptimized(),
|
||||||
canSupportResource: (resource: URI) => resource.scheme === Schemas.untitled || resource.scheme === Schemas.vscodeNotebookCell || this._fileService.hasProvider(resource)
|
canSupportResource: (resource: URI) => resource.scheme === Schemas.untitled || resource.scheme === Schemas.vscodeNotebookCell || this._fileService.hasProvider(resource)
|
||||||
};
|
};
|
||||||
const notebookEditorInputFactory: EditorInputFactoryFunction = ({ resource, options }) => {
|
const notebookEditorInputFactory: EditorInputFactoryFunction = ({ resource, options }) => {
|
||||||
|
@ -458,7 +458,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||||
|
|
||||||
const updateOrder = () => {
|
const updateOrder = () => {
|
||||||
this._displayOrder = new MimeTypeDisplayOrder(
|
this._displayOrder = new MimeTypeDisplayOrder(
|
||||||
this._configurationService.getValue<string[]>(DisplayOrderKey) || [],
|
this._configurationService.getValue<string[]>(NotebookSetting.displayOrder) || [],
|
||||||
this._accessibilityService.isScreenReaderOptimized()
|
this._accessibilityService.isScreenReaderOptimized()
|
||||||
? ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER
|
? ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER
|
||||||
: NOTEBOOK_DISPLAY_ORDER,
|
: NOTEBOOK_DISPLAY_ORDER,
|
||||||
|
@ -468,7 +468,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||||
updateOrder();
|
updateOrder();
|
||||||
|
|
||||||
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
||||||
if (e.affectedKeys.indexOf(DisplayOrderKey) >= 0) {
|
if (e.affectedKeys.indexOf(NotebookSetting.displayOrder) >= 0) {
|
||||||
updateOrder();
|
updateOrder();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -626,7 +626,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||||
}
|
}
|
||||||
|
|
||||||
saveMimeDisplayOrder(target: ConfigurationTarget) {
|
saveMimeDisplayOrder(target: ConfigurationTarget) {
|
||||||
this._configurationService.updateValue(DisplayOrderKey, this._displayOrder.toArray(), target);
|
this._configurationService.updateValue(NotebookSetting.displayOrder, this._displayOrder.toArray(), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRenderers(): INotebookRendererInfo[] {
|
getRenderers(): INotebookRendererInfo[] {
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
import * as DOM from 'vs/base/browser/dom';
|
import * as DOM from 'vs/base/browser/dom';
|
||||||
import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { Mimes } from 'vs/base/common/mime';
|
import { Mimes } from 'vs/base/common/mime';
|
||||||
import { dirname } from 'vs/base/common/resources';
|
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
import { MarkdownRenderer } from 'vs/editor/browser/core/markdownRenderer';
|
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
|
@ -17,10 +15,10 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||||
import { handleANSIOutput } from 'vs/workbench/contrib/debug/browser/debugANSIHandling';
|
import { handleANSIOutput } from 'vs/workbench/contrib/debug/browser/debugANSIHandling';
|
||||||
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
|
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
|
||||||
import { ICellOutputViewModel, IRenderOutput, RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
import { ICellOutputViewModel, IRenderOutput, RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||||
|
import { INotebookDelegateForOutput, IOutputTransformContribution as IOutputRendererContribution } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
|
||||||
import { OutputRendererRegistry } from 'vs/workbench/contrib/notebook/browser/view/output/rendererRegistry';
|
import { OutputRendererRegistry } from 'vs/workbench/contrib/notebook/browser/view/output/rendererRegistry';
|
||||||
import { truncatedArrayOfString } from 'vs/workbench/contrib/notebook/browser/view/output/transforms/textHelper';
|
import { truncatedArrayOfString } from 'vs/workbench/contrib/notebook/browser/view/output/transforms/textHelper';
|
||||||
import { IOutputItemDto, TextOutputLineLimit } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { IOutputItemDto, NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { INotebookDelegateForOutput, IOutputTransformContribution as IOutputRendererContribution } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
|
|
||||||
|
|
||||||
|
|
||||||
class JavaScriptRendererContrib extends Disposable implements IOutputRendererContribution {
|
class JavaScriptRendererContrib extends Disposable implements IOutputRendererContribution {
|
||||||
|
@ -76,7 +74,7 @@ class StreamRendererContrib extends Disposable implements IOutputRendererContrib
|
||||||
|
|
||||||
const text = getStringValue(item);
|
const text = getStringValue(item);
|
||||||
const contentNode = DOM.$('span.output-stream');
|
const contentNode = DOM.$('span.output-stream');
|
||||||
const lineLimit = this.configurationService.getValue<number>(TextOutputLineLimit) ?? 30;
|
const lineLimit = this.configurationService.getValue<number>(NotebookSetting.textOutputLineLimit) ?? 30;
|
||||||
truncatedArrayOfString(notebookUri, output.cellViewModel, Math.max(lineLimit, 6), contentNode, [text], disposables, linkDetector, this.openerService, this.themeService);
|
truncatedArrayOfString(notebookUri, output.cellViewModel, Math.max(lineLimit, 6), contentNode, [text], disposables, linkDetector, this.openerService, this.themeService);
|
||||||
container.appendChild(contentNode);
|
container.appendChild(contentNode);
|
||||||
|
|
||||||
|
@ -180,7 +178,7 @@ class PlainTextRendererContrib extends Disposable implements IOutputRendererCont
|
||||||
|
|
||||||
const str = getStringValue(item);
|
const str = getStringValue(item);
|
||||||
const contentNode = DOM.$('.output-plaintext');
|
const contentNode = DOM.$('.output-plaintext');
|
||||||
const lineLimit = this.configurationService.getValue<number>(TextOutputLineLimit) ?? 30;
|
const lineLimit = this.configurationService.getValue<number>(NotebookSetting.textOutputLineLimit) ?? 30;
|
||||||
truncatedArrayOfString(notebookUri, output.cellViewModel, Math.max(lineLimit, 6), contentNode, [str], disposables, linkDetector, this.openerService, this.themeService);
|
truncatedArrayOfString(notebookUri, output.cellViewModel, Math.max(lineLimit, 6), contentNode, [str], disposables, linkDetector, this.openerService, this.themeService);
|
||||||
container.appendChild(contentNode);
|
container.appendChild(contentNode);
|
||||||
|
|
||||||
|
@ -213,34 +211,6 @@ class HTMLRendererContrib extends Disposable implements IOutputRendererContribut
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MdRendererContrib extends Disposable implements IOutputRendererContribution {
|
|
||||||
getType() {
|
|
||||||
return RenderOutputType.Mainframe;
|
|
||||||
}
|
|
||||||
|
|
||||||
getMimetypes() {
|
|
||||||
return [Mimes.markdown, Mimes.latex];
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
public notebookEditor: INotebookDelegateForOutput,
|
|
||||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
|
||||||
) {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
render(output: ICellOutputViewModel, item: IOutputItemDto, container: HTMLElement, notebookUri: URI): IRenderOutput {
|
|
||||||
const disposable = new DisposableStore();
|
|
||||||
const str = getStringValue(item);
|
|
||||||
const mdOutput = document.createElement('div');
|
|
||||||
const mdRenderer = this.instantiationService.createInstance(MarkdownRenderer, { baseUrl: dirname(notebookUri) });
|
|
||||||
mdOutput.appendChild(mdRenderer.render({ value: str, isTrusted: true, supportThemeIcons: true }, undefined, { gfm: true }).element);
|
|
||||||
container.appendChild(mdOutput);
|
|
||||||
disposable.add(mdRenderer);
|
|
||||||
return { type: RenderOutputType.Mainframe, disposable };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ImgRendererContrib extends Disposable implements IOutputRendererContribution {
|
class ImgRendererContrib extends Disposable implements IOutputRendererContribution {
|
||||||
getType() {
|
getType() {
|
||||||
return RenderOutputType.Mainframe;
|
return RenderOutputType.Mainframe;
|
||||||
|
@ -276,7 +246,6 @@ class ImgRendererContrib extends Disposable implements IOutputRendererContributi
|
||||||
|
|
||||||
OutputRendererRegistry.registerOutputTransform(JavaScriptRendererContrib);
|
OutputRendererRegistry.registerOutputTransform(JavaScriptRendererContrib);
|
||||||
OutputRendererRegistry.registerOutputTransform(HTMLRendererContrib);
|
OutputRendererRegistry.registerOutputTransform(HTMLRendererContrib);
|
||||||
OutputRendererRegistry.registerOutputTransform(MdRendererContrib);
|
|
||||||
OutputRendererRegistry.registerOutputTransform(ImgRendererContrib);
|
OutputRendererRegistry.registerOutputTransform(ImgRendererContrib);
|
||||||
OutputRendererRegistry.registerOutputTransform(PlainTextRendererContrib);
|
OutputRendererRegistry.registerOutputTransform(PlainTextRendererContrib);
|
||||||
OutputRendererRegistry.registerOutputTransform(JSErrorRendererContrib);
|
OutputRendererRegistry.registerOutputTransform(JSErrorRendererContrib);
|
||||||
|
|
|
@ -51,14 +51,6 @@ export interface ICachedInset<K extends ICommonCellInfo> {
|
||||||
cachedCreation: ICreationRequestMessage;
|
cachedCreation: ICreationRequestMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
function html(strings: TemplateStringsArray, ...values: any[]): string {
|
|
||||||
let str = '';
|
|
||||||
strings.forEach((string, i) => {
|
|
||||||
str += string + (values[i] || '');
|
|
||||||
});
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface INotebookWebviewMessage {
|
export interface INotebookWebviewMessage {
|
||||||
message: unknown;
|
message: unknown;
|
||||||
}
|
}
|
||||||
|
@ -89,6 +81,19 @@ export interface INotebookDelegateForWebview {
|
||||||
triggerScroll(event: IMouseWheelEvent): void;
|
triggerScroll(event: IMouseWheelEvent): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface BacklayerWebviewOptions {
|
||||||
|
readonly outputNodePadding: number;
|
||||||
|
readonly outputNodeLeftPadding: number;
|
||||||
|
readonly previewNodePadding: number;
|
||||||
|
readonly markdownLeftMargin: number;
|
||||||
|
readonly leftMargin: number;
|
||||||
|
readonly rightMargin: number;
|
||||||
|
readonly runGutter: number;
|
||||||
|
readonly dragAndDropEnabled: boolean;
|
||||||
|
readonly fontSize: number;
|
||||||
|
readonly markupFontSize: number;
|
||||||
|
}
|
||||||
|
|
||||||
export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
element: HTMLElement;
|
element: HTMLElement;
|
||||||
webview: IWebviewElement | undefined = undefined;
|
webview: IWebviewElement | undefined = undefined;
|
||||||
|
@ -100,7 +105,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
private readonly _onMessage = this._register(new Emitter<INotebookWebviewMessage>());
|
private readonly _onMessage = this._register(new Emitter<INotebookWebviewMessage>());
|
||||||
private readonly _preloadsCache = new Set<string>();
|
private readonly _preloadsCache = new Set<string>();
|
||||||
public readonly onMessage: Event<INotebookWebviewMessage> = this._onMessage.event;
|
public readonly onMessage: Event<INotebookWebviewMessage> = this._onMessage.event;
|
||||||
private _initalized?: Promise<void>;
|
private _initialized?: Promise<void>;
|
||||||
private _disposed = false;
|
private _disposed = false;
|
||||||
private _currentKernel?: INotebookKernel;
|
private _currentKernel?: INotebookKernel;
|
||||||
|
|
||||||
|
@ -110,17 +115,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
public readonly notebookEditor: INotebookDelegateForWebview,
|
public readonly notebookEditor: INotebookDelegateForWebview,
|
||||||
public readonly id: string,
|
public readonly id: string,
|
||||||
public readonly documentUri: URI,
|
public readonly documentUri: URI,
|
||||||
private options: {
|
private options: BacklayerWebviewOptions,
|
||||||
outputNodePadding: number,
|
|
||||||
outputNodeLeftPadding: number,
|
|
||||||
previewNodePadding: number,
|
|
||||||
markdownLeftMargin: number,
|
|
||||||
leftMargin: number,
|
|
||||||
rightMargin: number,
|
|
||||||
runGutter: number,
|
|
||||||
dragAndDropEnabled: boolean,
|
|
||||||
fontSize: number
|
|
||||||
},
|
|
||||||
private readonly rendererMessaging: IScopedRendererMessaging | undefined,
|
private readonly rendererMessaging: IScopedRendererMessaging | undefined,
|
||||||
@IWebviewService readonly webviewService: IWebviewService,
|
@IWebviewService readonly webviewService: IWebviewService,
|
||||||
@IOpenerService readonly openerService: IOpenerService,
|
@IOpenerService readonly openerService: IOpenerService,
|
||||||
|
@ -177,17 +172,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateOptions(options: {
|
updateOptions(options: BacklayerWebviewOptions) {
|
||||||
outputNodePadding: number,
|
|
||||||
outputNodeLeftPadding: number,
|
|
||||||
previewNodePadding: number,
|
|
||||||
markdownLeftMargin: number,
|
|
||||||
leftMargin: number,
|
|
||||||
rightMargin: number,
|
|
||||||
runGutter: number,
|
|
||||||
dragAndDropEnabled: boolean,
|
|
||||||
fontSize: number
|
|
||||||
}) {
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this._updateStyles();
|
this._updateStyles();
|
||||||
this._updateOptions();
|
this._updateOptions();
|
||||||
|
@ -215,10 +200,11 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
'notebook-output-width': `calc(100% - ${this.options.leftMargin + this.options.rightMargin + this.options.runGutter}px)`,
|
'notebook-output-width': `calc(100% - ${this.options.leftMargin + this.options.rightMargin + this.options.runGutter}px)`,
|
||||||
'notebook-output-node-padding': `${this.options.outputNodePadding}px`,
|
'notebook-output-node-padding': `${this.options.outputNodePadding}px`,
|
||||||
'notebook-run-gutter': `${this.options.runGutter}px`,
|
'notebook-run-gutter': `${this.options.runGutter}px`,
|
||||||
'notebook-preivew-node-padding': `${this.options.previewNodePadding}px`,
|
'notebook-preview-node-padding': `${this.options.previewNodePadding}px`,
|
||||||
'notebook-markdown-left-margin': `${this.options.markdownLeftMargin}px`,
|
'notebook-markdown-left-margin': `${this.options.markdownLeftMargin}px`,
|
||||||
'notebook-output-node-left-padding': `${this.options.outputNodeLeftPadding}px`,
|
'notebook-output-node-left-padding': `${this.options.outputNodeLeftPadding}px`,
|
||||||
'notebook-markdown-min-height': `${this.options.previewNodePadding * 2}px`,
|
'notebook-markdown-min-height': `${this.options.previewNodePadding * 2}px`,
|
||||||
|
'notebook-markup-font-size': typeof this.options.markupFontSize === 'number' && this.options.markupFontSize > 0 ? `${this.options.markupFontSize}px` : `calc(${this.options.fontSize}px * 1.2)`,
|
||||||
'notebook-cell-output-font-size': `${this.options.fontSize}px`,
|
'notebook-cell-output-font-size': `${this.options.fontSize}px`,
|
||||||
'notebook-cell-markup-empty-content': nls.localize('notebook.emptyMarkdownPlaceholder', "Empty markdown cell, double click or press enter to edit."),
|
'notebook-cell-markup-empty-content': nls.localize('notebook.emptyMarkdownPlaceholder', "Empty markdown cell, double click or press enter to edit."),
|
||||||
'notebook-cell-renderer-not-found-error': nls.localize({
|
'notebook-cell-renderer-not-found-error': nls.localize({
|
||||||
|
@ -238,7 +224,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
this.nonce);
|
this.nonce);
|
||||||
|
|
||||||
const enableCsp = this.configurationService.getValue('notebook.experimental.enableCsp');
|
const enableCsp = this.configurationService.getValue('notebook.experimental.enableCsp');
|
||||||
return html`
|
return /* html */`
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -279,15 +265,17 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
/* markdown */
|
/* markdown */
|
||||||
#container > div.preview {
|
#container > div.preview {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: var(--notebook-preivew-node-padding);
|
padding-right: var(--notebook-preview-node-padding);
|
||||||
padding-left: var(--notebook-markdown-left-margin);
|
padding-left: var(--notebook-markdown-left-margin);
|
||||||
padding-top: var(--notebook-preivew-node-padding);
|
padding-top: var(--notebook-preview-node-padding);
|
||||||
padding-bottom: var(--notebook-preivew-node-padding);
|
padding-bottom: var(--notebook-preview-node-padding);
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: initial;
|
white-space: initial;
|
||||||
|
|
||||||
|
font-size: var(--notebook-markup-font-size);
|
||||||
color: var(--theme-ui-foreground);
|
color: var(--theme-ui-foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +422,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
|
||||||
let coreDependencies = '';
|
let coreDependencies = '';
|
||||||
let resolveFunc: () => void;
|
let resolveFunc: () => void;
|
||||||
|
|
||||||
this._initalized = new Promise<void>((resolve, reject) => {
|
this._initialized = new Promise<void>((resolve) => {
|
||||||
resolveFunc = resolve;
|
resolveFunc = resolve;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -483,7 +471,7 @@ var requirejs = (function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await this._initalized;
|
await this._initialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _initialize(content: string) {
|
private _initialize(content: string) {
|
||||||
|
@ -835,7 +823,7 @@ var requirejs = (function() {
|
||||||
allowScripts: true,
|
allowScripts: true,
|
||||||
localResourceRoots: this.localResourceRootsCache,
|
localResourceRoots: this.localResourceRootsCache,
|
||||||
}, undefined);
|
}, undefined);
|
||||||
// console.log(this.localResourceRootsCache);
|
|
||||||
webview.html = content;
|
webview.html = content;
|
||||||
return webview;
|
return webview;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ interface BaseToWebviewMessage {
|
||||||
readonly __vscode_notebook_message: true;
|
readonly __vscode_notebook_message: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebviewIntialized extends BaseToWebviewMessage {
|
export interface WebviewInitialized extends BaseToWebviewMessage {
|
||||||
readonly type: 'initialized';
|
readonly type: 'initialized';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,22 +162,22 @@ export interface IOutputRequestMetadata {
|
||||||
/**
|
/**
|
||||||
* Additional attributes of a cell metadata.
|
* Additional attributes of a cell metadata.
|
||||||
*/
|
*/
|
||||||
readonly custom?: { [key: string]: unknown; };
|
readonly custom?: { readonly [key: string]: unknown; };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IOutputRequestDto {
|
export interface IOutputRequestDto {
|
||||||
/**
|
/**
|
||||||
* { mime_type: value }
|
* { mime_type: value }
|
||||||
*/
|
*/
|
||||||
readonly data: { [key: string]: unknown; };
|
readonly data: { readonly [key: string]: unknown; };
|
||||||
|
|
||||||
readonly metadata?: IOutputRequestMetadata;
|
readonly metadata?: IOutputRequestMetadata;
|
||||||
readonly outputId: string;
|
readonly outputId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ICreationContent =
|
export type ICreationContent =
|
||||||
| { type: RenderOutputType.Html; htmlContent: string; }
|
| { readonly type: RenderOutputType.Html; readonly htmlContent: string; }
|
||||||
| { type: RenderOutputType.Extension; outputId: string; valueBytes: Uint8Array; metadata: unknown; mimeType: string; };
|
| { readonly type: RenderOutputType.Extension; readonly outputId: string; readonly valueBytes: Uint8Array; readonly metadata: unknown; readonly mimeType: string; };
|
||||||
|
|
||||||
export interface ICreationRequestMessage {
|
export interface ICreationRequestMessage {
|
||||||
readonly type: 'html';
|
readonly type: 'html';
|
||||||
|
@ -187,7 +187,7 @@ export interface ICreationRequestMessage {
|
||||||
cellTop: number;
|
cellTop: number;
|
||||||
outputOffset: number;
|
outputOffset: number;
|
||||||
readonly left: number;
|
readonly left: number;
|
||||||
readonly requiredPreloads: ReadonlyArray<IControllerPreload>;
|
readonly requiredPreloads: readonly IControllerPreload[];
|
||||||
readonly initiallyHidden?: boolean;
|
readonly initiallyHidden?: boolean;
|
||||||
readonly rendererId?: string | undefined;
|
readonly rendererId?: string | undefined;
|
||||||
}
|
}
|
||||||
|
@ -200,10 +200,15 @@ export interface IContentWidgetTopRequest {
|
||||||
readonly forceDisplay: boolean;
|
readonly forceDisplay: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IMarkupCellScrollTops {
|
||||||
|
readonly id: string;
|
||||||
|
readonly top: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IViewScrollTopRequestMessage {
|
export interface IViewScrollTopRequestMessage {
|
||||||
readonly type: 'view-scroll';
|
readonly type: 'view-scroll';
|
||||||
readonly widgets: IContentWidgetTopRequest[];
|
readonly widgets: readonly IContentWidgetTopRequest[];
|
||||||
readonly markupCells: { id: string; top: number; }[];
|
readonly markupCells: readonly IMarkupCellScrollTops[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IScrollRequestMessage {
|
export interface IScrollRequestMessage {
|
||||||
|
@ -259,14 +264,14 @@ export interface IControllerPreload {
|
||||||
|
|
||||||
export interface IUpdateControllerPreloadsMessage {
|
export interface IUpdateControllerPreloadsMessage {
|
||||||
readonly type: 'preload';
|
readonly type: 'preload';
|
||||||
readonly resources: IControllerPreload[];
|
readonly resources: readonly IControllerPreload[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IUpdateDecorationsMessage {
|
export interface IUpdateDecorationsMessage {
|
||||||
readonly type: 'decorations';
|
readonly type: 'decorations';
|
||||||
readonly cellId: string;
|
readonly cellId: string;
|
||||||
readonly addedClassNames: string[];
|
readonly addedClassNames: readonly string[];
|
||||||
readonly removedClassNames: string[];
|
readonly removedClassNames: readonly string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICustomKernelMessage extends BaseToWebviewMessage {
|
export interface ICustomKernelMessage extends BaseToWebviewMessage {
|
||||||
|
@ -324,13 +329,13 @@ export interface IMarkupCellInitialization {
|
||||||
|
|
||||||
export interface IInitializeMarkupCells {
|
export interface IInitializeMarkupCells {
|
||||||
readonly type: 'initializeMarkup';
|
readonly type: 'initializeMarkup';
|
||||||
readonly cells: ReadonlyArray<IMarkupCellInitialization>;
|
readonly cells: readonly IMarkupCellInitialization[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface INotebookStylesMessage {
|
export interface INotebookStylesMessage {
|
||||||
readonly type: 'notebookStyles';
|
readonly type: 'notebookStyles';
|
||||||
readonly styles: {
|
readonly styles: {
|
||||||
[key: string]: string;
|
readonly [key: string]: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +359,7 @@ export interface ITokenizedStylesChangedMessage {
|
||||||
readonly css: string;
|
readonly css: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FromWebviewMessage = WebviewIntialized |
|
export type FromWebviewMessage = WebviewInitialized |
|
||||||
IDimensionMessage |
|
IDimensionMessage |
|
||||||
IMouseEnterMessage |
|
IMouseEnterMessage |
|
||||||
IMouseLeaveMessage |
|
IMouseLeaveMessage |
|
||||||
|
|
|
@ -664,8 +664,8 @@ async function webviewPreloads(ctx: PreloadContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-add new properties
|
// Re-add new properties
|
||||||
for (const variable of Object.keys(event.data.styles)) {
|
for (const [name, value] of Object.entries(event.data.styles)) {
|
||||||
documentStyle.setProperty(`--${variable}`, event.data.styles[variable]);
|
documentStyle.setProperty(`--${name}`, value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'notebookOptions':
|
case 'notebookOptions':
|
||||||
|
@ -1007,7 +1007,7 @@ async function webviewPreloads(ctx: PreloadContext) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateMarkupScrolls(markupCells: { id: string; top: number; }[]) {
|
public updateMarkupScrolls(markupCells: readonly webviewMessages.IMarkupCellScrollTops[]) {
|
||||||
for (const { id, top } of markupCells) {
|
for (const { id, top } of markupCells) {
|
||||||
const cell = this._markupCells.get(id);
|
const cell = this._markupCells.get(id);
|
||||||
if (cell) {
|
if (cell) {
|
||||||
|
|
|
@ -24,11 +24,9 @@ function rangesEqual(a: ICellRange[], b: ICellRange[]) {
|
||||||
// Handle first, then we migrate to ICellRange competely
|
// Handle first, then we migrate to ICellRange competely
|
||||||
// Challenge is List View talks about `element`, which needs extra work to convert to ICellRange as we support Folding and Cell Move
|
// Challenge is List View talks about `element`, which needs extra work to convert to ICellRange as we support Folding and Cell Move
|
||||||
export class NotebookCellSelectionCollection extends Disposable {
|
export class NotebookCellSelectionCollection extends Disposable {
|
||||||
|
|
||||||
private readonly _onDidChangeSelection = this._register(new Emitter<string>());
|
private readonly _onDidChangeSelection = this._register(new Emitter<string>());
|
||||||
get onDidChangeSelection(): Event<string> { return this._onDidChangeSelection.event; }
|
get onDidChangeSelection(): Event<string> { return this._onDidChangeSelection.event; }
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
private _primary: ICellRange | null = null;
|
private _primary: ICellRange | null = null;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { SELECT_KERNEL_ID } from 'vs/workbench/contrib/notebook/browser/controll
|
||||||
import { INotebookEditorDelegate, NOTEBOOK_EDITOR_ID } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
import { INotebookEditorDelegate, NOTEBOOK_EDITOR_ID } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||||
import { NotebooKernelActionViewItem } from 'vs/workbench/contrib/notebook/browser/viewParts/notebookKernelActionViewItem';
|
import { NotebooKernelActionViewItem } from 'vs/workbench/contrib/notebook/browser/viewParts/notebookKernelActionViewItem';
|
||||||
import { ActionViewWithLabel } from 'vs/workbench/contrib/notebook/browser/view/renderers/cellActionView';
|
import { ActionViewWithLabel } from 'vs/workbench/contrib/notebook/browser/view/renderers/cellActionView';
|
||||||
import { GlobalToolbarShowLabel } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { IWorkbenchAssignmentService } from 'vs/workbench/services/assignment/common/assignmentService';
|
import { IWorkbenchAssignmentService } from 'vs/workbench/services/assignment/common/assignmentService';
|
||||||
import { NotebookOptions } from 'vs/workbench/contrib/notebook/common/notebookOptions';
|
import { NotebookOptions } from 'vs/workbench/contrib/notebook/common/notebookOptions';
|
||||||
|
@ -114,7 +114,7 @@ export class NotebookEditorToolbar extends Disposable {
|
||||||
this._register(this._notebookGlobalActionsMenu);
|
this._register(this._notebookGlobalActionsMenu);
|
||||||
|
|
||||||
this._useGlobalToolbar = this.notebookOptions.getLayoutConfiguration().globalToolbar;
|
this._useGlobalToolbar = this.notebookOptions.getLayoutConfiguration().globalToolbar;
|
||||||
this._renderLabel = this.configurationService.getValue<boolean>(GlobalToolbarShowLabel);
|
this._renderLabel = this.configurationService.getValue<boolean>(NotebookSetting.globalToolbarShowLabel);
|
||||||
|
|
||||||
const context = {
|
const context = {
|
||||||
ui: true,
|
ui: true,
|
||||||
|
@ -184,8 +184,8 @@ export class NotebookEditorToolbar extends Disposable {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
||||||
if (e.affectsConfiguration(GlobalToolbarShowLabel)) {
|
if (e.affectsConfiguration(NotebookSetting.globalToolbarShowLabel)) {
|
||||||
this._renderLabel = this.configurationService.getValue<boolean>(GlobalToolbarShowLabel);
|
this._renderLabel = this.configurationService.getValue<boolean>(NotebookSetting.globalToolbarShowLabel);
|
||||||
const oldElement = this._notebookLeftToolbar.getElement();
|
const oldElement = this._notebookLeftToolbar.getElement();
|
||||||
oldElement.parentElement?.removeChild(oldElement);
|
oldElement.parentElement?.removeChild(oldElement);
|
||||||
this._notebookLeftToolbar.dispose();
|
this._notebookLeftToolbar.dispose();
|
||||||
|
|
|
@ -579,7 +579,6 @@ const _mimeTypeInfo = new Map<string, MimeTypeInfo>([
|
||||||
['image/svg+xml', { supportedByCore: true }],
|
['image/svg+xml', { supportedByCore: true }],
|
||||||
['application/json', { alwaysSecure: true, supportedByCore: true }],
|
['application/json', { alwaysSecure: true, supportedByCore: true }],
|
||||||
[Mimes.latex, { alwaysSecure: true, supportedByCore: true }],
|
[Mimes.latex, { alwaysSecure: true, supportedByCore: true }],
|
||||||
[Mimes.markdown, { alwaysSecure: true, supportedByCore: true }],
|
|
||||||
[Mimes.text, { alwaysSecure: true, supportedByCore: true }],
|
[Mimes.text, { alwaysSecure: true, supportedByCore: true }],
|
||||||
['text/html', { supportedByCore: true }],
|
['text/html', { supportedByCore: true }],
|
||||||
['text/x-javascript', { alwaysSecure: true, supportedByCore: true }], // secure because rendered as text, not executed
|
['text/x-javascript', { alwaysSecure: true, supportedByCore: true }], // secure because rendered as text, not executed
|
||||||
|
@ -902,26 +901,30 @@ export interface INotebookCellStatusBarItemList {
|
||||||
dispose?(): void;
|
dispose?(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DisplayOrderKey = 'notebook.displayOrder';
|
|
||||||
export const CellToolbarLocation = 'notebook.cellToolbarLocation';
|
|
||||||
export const CellToolbarVisibility = 'notebook.cellToolbarVisibility';
|
|
||||||
export type ShowCellStatusBarType = 'hidden' | 'visible' | 'visibleAfterExecute';
|
export type ShowCellStatusBarType = 'hidden' | 'visible' | 'visibleAfterExecute';
|
||||||
export const ShowCellStatusBar = 'notebook.showCellStatusBar';
|
|
||||||
export const NotebookTextDiffEditorPreview = 'notebook.diff.enablePreview';
|
export const NotebookSetting = {
|
||||||
export const ExperimentalInsertToolbarAlignment = 'notebook.experimental.insertToolbarAlignment';
|
displayOrder: 'notebook.displayOrder',
|
||||||
export const CompactView = 'notebook.compactView';
|
cellToolbarLocation: 'notebook.cellToolbarLocation',
|
||||||
export const FocusIndicator = 'notebook.cellFocusIndicator';
|
cellToolbarVisibility: 'notebook.cellToolbarVisibility',
|
||||||
export const InsertToolbarLocation = 'notebook.insertToolbarLocation';
|
showCellStatusBar: 'notebook.showCellStatusBar',
|
||||||
export const GlobalToolbar = 'notebook.globalToolbar';
|
textDiffEditorPreview: 'notebook.diff.enablePreview',
|
||||||
export const UndoRedoPerCell = 'notebook.undoRedoPerCell';
|
experimentalInsertToolbarAlignment: 'notebook.experimental.insertToolbarAlignment',
|
||||||
export const ConsolidatedOutputButton = 'notebook.consolidatedOutputButton';
|
compactView: 'notebook.compactView',
|
||||||
export const ShowFoldingControls = 'notebook.showFoldingControls';
|
focusIndicator: 'notebook.cellFocusIndicator',
|
||||||
export const DragAndDropEnabled = 'notebook.dragAndDropEnabled';
|
insertToolbarLocation: 'notebook.insertToolbarLocation',
|
||||||
export const NotebookCellEditorOptionsCustomizations = 'notebook.editorOptionsCustomizations';
|
globalToolbar: 'notebook.globalToolbar',
|
||||||
export const ConsolidatedRunButton = 'notebook.consolidatedRunButton';
|
undoRedoPerCell: 'notebook.undoRedoPerCell',
|
||||||
export const OpenGettingStarted = 'notebook.experimental.openGettingStarted';
|
consolidatedOutputButton: 'notebook.consolidatedOutputButton',
|
||||||
export const TextOutputLineLimit = 'notebook.output.textLineLimit';
|
showFoldingControls: 'notebook.showFoldingControls',
|
||||||
export const GlobalToolbarShowLabel = 'notebook.globalToolbarShowLabel';
|
dragAndDropEnabled: 'notebook.dragAndDropEnabled',
|
||||||
|
cellEditorOptionsCustomizations: 'notebook.editorOptionsCustomizations',
|
||||||
|
consolidatedRunButton: 'notebook.consolidatedRunButton',
|
||||||
|
openGettingStarted: 'notebook.experimental.openGettingStarted',
|
||||||
|
textOutputLineLimit: 'notebook.output.textLineLimit',
|
||||||
|
globalToolbarShowLabel: 'notebook.globalToolbarShowLabel',
|
||||||
|
markupFontSize: 'notebook.markup.fontSize',
|
||||||
|
} as const;
|
||||||
|
|
||||||
export const enum CellStatusbarAlignment {
|
export const enum CellStatusbarAlignment {
|
||||||
Left = 1,
|
Left = 1,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Emitter } from 'vs/base/common/event';
|
import { Emitter } from 'vs/base/common/event';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { CellToolbarLocation, CellToolbarVisibility, CompactView, ConsolidatedOutputButton, ConsolidatedRunButton, DragAndDropEnabled, ExperimentalInsertToolbarAlignment, FocusIndicator, GlobalToolbar, InsertToolbarLocation, NotebookCellEditorOptionsCustomizations, NotebookCellInternalMetadata, ShowCellStatusBar, ShowCellStatusBarType, ShowFoldingControls } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
import { NotebookCellInternalMetadata, NotebookSetting, ShowCellStatusBarType } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||||
|
|
||||||
const SCROLLABLE_ELEMENT_PADDING_TOP = 18;
|
const SCROLLABLE_ELEMENT_PADDING_TOP = 18;
|
||||||
|
|
||||||
|
@ -59,30 +59,32 @@ export interface NotebookLayoutConfiguration {
|
||||||
showFoldingControls: 'always' | 'mouseover';
|
showFoldingControls: 'always' | 'mouseover';
|
||||||
dragAndDropEnabled: boolean;
|
dragAndDropEnabled: boolean;
|
||||||
fontSize: number;
|
fontSize: number;
|
||||||
|
markupFontSize: number;
|
||||||
focusIndicatorLeftMargin: number;
|
focusIndicatorLeftMargin: number;
|
||||||
editorOptionsCustomizations: any | undefined;
|
editorOptionsCustomizations: any | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NotebookOptionsChangeEvent {
|
export interface NotebookOptionsChangeEvent {
|
||||||
cellStatusBarVisibility?: boolean;
|
readonly cellStatusBarVisibility?: boolean;
|
||||||
cellToolbarLocation?: boolean;
|
readonly cellToolbarLocation?: boolean;
|
||||||
cellToolbarInteraction?: boolean;
|
readonly cellToolbarInteraction?: boolean;
|
||||||
editorTopPadding?: boolean;
|
readonly editorTopPadding?: boolean;
|
||||||
compactView?: boolean;
|
readonly compactView?: boolean;
|
||||||
focusIndicator?: boolean;
|
readonly focusIndicator?: boolean;
|
||||||
insertToolbarPosition?: boolean;
|
readonly insertToolbarPosition?: boolean;
|
||||||
insertToolbarAlignment?: boolean;
|
readonly insertToolbarAlignment?: boolean;
|
||||||
globalToolbar?: boolean;
|
readonly globalToolbar?: boolean;
|
||||||
showFoldingControls?: boolean;
|
readonly showFoldingControls?: boolean;
|
||||||
consolidatedOutputButton?: boolean;
|
readonly consolidatedOutputButton?: boolean;
|
||||||
consolidatedRunButton?: boolean;
|
readonly consolidatedRunButton?: boolean;
|
||||||
dragAndDropEnabled?: boolean;
|
readonly dragAndDropEnabled?: boolean;
|
||||||
fontSize?: boolean;
|
readonly fontSize?: boolean;
|
||||||
editorOptionsCustomizations?: boolean;
|
readonly markupFontSize?: boolean;
|
||||||
cellBreakpointMargin?: boolean;
|
readonly editorOptionsCustomizations?: boolean;
|
||||||
|
readonly cellBreakpointMargin?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultConfigConstants = {
|
const defaultConfigConstants = Object.freeze({
|
||||||
codeCellLeftMargin: 28,
|
codeCellLeftMargin: 28,
|
||||||
cellRunGutter: 32,
|
cellRunGutter: 32,
|
||||||
markdownCellTopMargin: 8,
|
markdownCellTopMargin: 8,
|
||||||
|
@ -90,9 +92,9 @@ const defaultConfigConstants = {
|
||||||
markdownCellLeftMargin: 0,
|
markdownCellLeftMargin: 0,
|
||||||
markdownCellGutter: 32,
|
markdownCellGutter: 32,
|
||||||
focusIndicatorLeftMargin: 4
|
focusIndicatorLeftMargin: 4
|
||||||
};
|
});
|
||||||
|
|
||||||
const compactConfigConstants = {
|
const compactConfigConstants = Object.freeze({
|
||||||
codeCellLeftMargin: 8,
|
codeCellLeftMargin: 8,
|
||||||
cellRunGutter: 36,
|
cellRunGutter: 36,
|
||||||
markdownCellTopMargin: 6,
|
markdownCellTopMargin: 6,
|
||||||
|
@ -100,7 +102,7 @@ const compactConfigConstants = {
|
||||||
markdownCellLeftMargin: 8,
|
markdownCellLeftMargin: 8,
|
||||||
markdownCellGutter: 36,
|
markdownCellGutter: 36,
|
||||||
focusIndicatorLeftMargin: 4
|
focusIndicatorLeftMargin: 4
|
||||||
};
|
});
|
||||||
|
|
||||||
export class NotebookOptions extends Disposable {
|
export class NotebookOptions extends Disposable {
|
||||||
private _layoutConfiguration: NotebookLayoutConfiguration;
|
private _layoutConfiguration: NotebookLayoutConfiguration;
|
||||||
|
@ -109,21 +111,22 @@ export class NotebookOptions extends Disposable {
|
||||||
|
|
||||||
constructor(private readonly configurationService: IConfigurationService, private readonly overrides?: { cellToolbarInteraction: string, globalToolbar: boolean }) {
|
constructor(private readonly configurationService: IConfigurationService, private readonly overrides?: { cellToolbarInteraction: string, globalToolbar: boolean }) {
|
||||||
super();
|
super();
|
||||||
const showCellStatusBar = this.configurationService.getValue<ShowCellStatusBarType>(ShowCellStatusBar);
|
const showCellStatusBar = this.configurationService.getValue<ShowCellStatusBarType>(NotebookSetting.showCellStatusBar);
|
||||||
const globalToolbar = overrides?.globalToolbar ?? this.configurationService.getValue<boolean | undefined>(GlobalToolbar) ?? true;
|
const globalToolbar = overrides?.globalToolbar ?? this.configurationService.getValue<boolean | undefined>(NotebookSetting.globalToolbar) ?? true;
|
||||||
const consolidatedOutputButton = this.configurationService.getValue<boolean | undefined>(ConsolidatedOutputButton) ?? true;
|
const consolidatedOutputButton = this.configurationService.getValue<boolean | undefined>(NotebookSetting.consolidatedOutputButton) ?? true;
|
||||||
const consolidatedRunButton = this.configurationService.getValue<boolean | undefined>(ConsolidatedRunButton) ?? false;
|
const consolidatedRunButton = this.configurationService.getValue<boolean | undefined>(NotebookSetting.consolidatedRunButton) ?? false;
|
||||||
const dragAndDropEnabled = this.configurationService.getValue<boolean | undefined>(DragAndDropEnabled) ?? true;
|
const dragAndDropEnabled = this.configurationService.getValue<boolean | undefined>(NotebookSetting.dragAndDropEnabled) ?? true;
|
||||||
const cellToolbarLocation = this.configurationService.getValue<string | { [key: string]: string; }>(CellToolbarLocation) ?? { 'default': 'right' };
|
const cellToolbarLocation = this.configurationService.getValue<string | { [key: string]: string; }>(NotebookSetting.cellToolbarLocation) ?? { 'default': 'right' };
|
||||||
const cellToolbarInteraction = overrides?.cellToolbarInteraction ?? this.configurationService.getValue<string>(CellToolbarVisibility);
|
const cellToolbarInteraction = overrides?.cellToolbarInteraction ?? this.configurationService.getValue<string>(NotebookSetting.cellToolbarVisibility);
|
||||||
const compactView = this.configurationService.getValue<boolean | undefined>(CompactView) ?? true;
|
const compactView = this.configurationService.getValue<boolean | undefined>(NotebookSetting.compactView) ?? true;
|
||||||
const focusIndicator = this._computeFocusIndicatorOption();
|
const focusIndicator = this._computeFocusIndicatorOption();
|
||||||
const insertToolbarPosition = this._computeInsertToolbarPositionOption();
|
const insertToolbarPosition = this._computeInsertToolbarPositionOption();
|
||||||
const insertToolbarAlignment = this._computeInsertToolbarAlignmentOption();
|
const insertToolbarAlignment = this._computeInsertToolbarAlignmentOption();
|
||||||
const showFoldingControls = this._computeShowFoldingControlsOption();
|
const showFoldingControls = this._computeShowFoldingControlsOption();
|
||||||
// const { bottomToolbarGap, bottomToolbarHeight } = this._computeBottomToolbarDimensions(compactView, insertToolbarPosition, insertToolbarAlignment);
|
// const { bottomToolbarGap, bottomToolbarHeight } = this._computeBottomToolbarDimensions(compactView, insertToolbarPosition, insertToolbarAlignment);
|
||||||
const fontSize = this.configurationService.getValue<number>('editor.fontSize');
|
const fontSize = this.configurationService.getValue<number>('editor.fontSize');
|
||||||
const editorOptionsCustomizations = this.configurationService.getValue(NotebookCellEditorOptionsCustomizations);
|
const markupFontSize = this.configurationService.getValue<number>(NotebookSetting.markupFontSize);
|
||||||
|
const editorOptionsCustomizations = this.configurationService.getValue(NotebookSetting.cellEditorOptionsCustomizations);
|
||||||
|
|
||||||
this._layoutConfiguration = {
|
this._layoutConfiguration = {
|
||||||
...(compactView ? compactConfigConstants : defaultConfigConstants),
|
...(compactView ? compactConfigConstants : defaultConfigConstants),
|
||||||
|
@ -153,6 +156,7 @@ export class NotebookOptions extends Disposable {
|
||||||
insertToolbarAlignment,
|
insertToolbarAlignment,
|
||||||
showFoldingControls,
|
showFoldingControls,
|
||||||
fontSize,
|
fontSize,
|
||||||
|
markupFontSize,
|
||||||
editorOptionsCustomizations,
|
editorOptionsCustomizations,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -169,20 +173,21 @@ export class NotebookOptions extends Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private _updateConfiguration(e: IConfigurationChangeEvent) {
|
private _updateConfiguration(e: IConfigurationChangeEvent) {
|
||||||
const cellStatusBarVisibility = e.affectsConfiguration(ShowCellStatusBar);
|
const cellStatusBarVisibility = e.affectsConfiguration(NotebookSetting.showCellStatusBar);
|
||||||
const cellToolbarLocation = e.affectsConfiguration(CellToolbarLocation);
|
const cellToolbarLocation = e.affectsConfiguration(NotebookSetting.cellToolbarLocation);
|
||||||
const cellToolbarInteraction = e.affectsConfiguration(CellToolbarVisibility);
|
const cellToolbarInteraction = e.affectsConfiguration(NotebookSetting.cellToolbarVisibility);
|
||||||
const compactView = e.affectsConfiguration(CompactView);
|
const compactView = e.affectsConfiguration(NotebookSetting.compactView);
|
||||||
const focusIndicator = e.affectsConfiguration(FocusIndicator);
|
const focusIndicator = e.affectsConfiguration(NotebookSetting.focusIndicator);
|
||||||
const insertToolbarPosition = e.affectsConfiguration(InsertToolbarLocation);
|
const insertToolbarPosition = e.affectsConfiguration(NotebookSetting.insertToolbarLocation);
|
||||||
const insertToolbarAlignment = e.affectsConfiguration(ExperimentalInsertToolbarAlignment);
|
const insertToolbarAlignment = e.affectsConfiguration(NotebookSetting.experimentalInsertToolbarAlignment);
|
||||||
const globalToolbar = e.affectsConfiguration(GlobalToolbar);
|
const globalToolbar = e.affectsConfiguration(NotebookSetting.globalToolbar);
|
||||||
const consolidatedOutputButton = e.affectsConfiguration(ConsolidatedOutputButton);
|
const consolidatedOutputButton = e.affectsConfiguration(NotebookSetting.consolidatedOutputButton);
|
||||||
const consolidatedRunButton = e.affectsConfiguration(ConsolidatedRunButton);
|
const consolidatedRunButton = e.affectsConfiguration(NotebookSetting.consolidatedRunButton);
|
||||||
const showFoldingControls = e.affectsConfiguration(ShowFoldingControls);
|
const showFoldingControls = e.affectsConfiguration(NotebookSetting.showFoldingControls);
|
||||||
const dragAndDropEnabled = e.affectsConfiguration(DragAndDropEnabled);
|
const dragAndDropEnabled = e.affectsConfiguration(NotebookSetting.dragAndDropEnabled);
|
||||||
const fontSize = e.affectsConfiguration('editor.fontSize');
|
const fontSize = e.affectsConfiguration('editor.fontSize');
|
||||||
const editorOptionsCustomizations = e.affectsConfiguration(NotebookCellEditorOptionsCustomizations);
|
const markupFontSize = e.affectsConfiguration(NotebookSetting.markupFontSize);
|
||||||
|
const editorOptionsCustomizations = e.affectsConfiguration(NotebookSetting.cellEditorOptionsCustomizations);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!cellStatusBarVisibility
|
!cellStatusBarVisibility
|
||||||
|
@ -198,6 +203,7 @@ export class NotebookOptions extends Disposable {
|
||||||
&& !showFoldingControls
|
&& !showFoldingControls
|
||||||
&& !dragAndDropEnabled
|
&& !dragAndDropEnabled
|
||||||
&& !fontSize
|
&& !fontSize
|
||||||
|
&& !markupFontSize
|
||||||
&& !editorOptionsCustomizations) {
|
&& !editorOptionsCustomizations) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -205,15 +211,15 @@ export class NotebookOptions extends Disposable {
|
||||||
let configuration = Object.assign({}, this._layoutConfiguration);
|
let configuration = Object.assign({}, this._layoutConfiguration);
|
||||||
|
|
||||||
if (cellStatusBarVisibility) {
|
if (cellStatusBarVisibility) {
|
||||||
configuration.showCellStatusBar = this.configurationService.getValue<ShowCellStatusBarType>(ShowCellStatusBar);
|
configuration.showCellStatusBar = this.configurationService.getValue<ShowCellStatusBarType>(NotebookSetting.showCellStatusBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cellToolbarLocation) {
|
if (cellToolbarLocation) {
|
||||||
configuration.cellToolbarLocation = this.configurationService.getValue<string | { [key: string]: string; }>(CellToolbarLocation) ?? { 'default': 'right' };
|
configuration.cellToolbarLocation = this.configurationService.getValue<string | { [key: string]: string; }>(NotebookSetting.cellToolbarLocation) ?? { 'default': 'right' };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cellToolbarInteraction && !this.overrides?.cellToolbarInteraction) {
|
if (cellToolbarInteraction && !this.overrides?.cellToolbarInteraction) {
|
||||||
configuration.cellToolbarInteraction = this.configurationService.getValue<string>(CellToolbarVisibility);
|
configuration.cellToolbarInteraction = this.configurationService.getValue<string>(NotebookSetting.cellToolbarVisibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (focusIndicator) {
|
if (focusIndicator) {
|
||||||
|
@ -221,7 +227,7 @@ export class NotebookOptions extends Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compactView) {
|
if (compactView) {
|
||||||
const compactViewValue = this.configurationService.getValue<boolean | undefined>(CompactView) ?? true;
|
const compactViewValue = this.configurationService.getValue<boolean | undefined>(NotebookSetting.compactView) ?? true;
|
||||||
configuration = Object.assign(configuration, {
|
configuration = Object.assign(configuration, {
|
||||||
...(compactViewValue ? compactConfigConstants : defaultConfigConstants),
|
...(compactViewValue ? compactConfigConstants : defaultConfigConstants),
|
||||||
});
|
});
|
||||||
|
@ -237,15 +243,15 @@ export class NotebookOptions extends Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (globalToolbar && this.overrides?.globalToolbar === undefined) {
|
if (globalToolbar && this.overrides?.globalToolbar === undefined) {
|
||||||
configuration.globalToolbar = this.configurationService.getValue<boolean>(GlobalToolbar) ?? true;
|
configuration.globalToolbar = this.configurationService.getValue<boolean>(NotebookSetting.globalToolbar) ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (consolidatedOutputButton) {
|
if (consolidatedOutputButton) {
|
||||||
configuration.consolidatedOutputButton = this.configurationService.getValue<boolean>(ConsolidatedOutputButton) ?? true;
|
configuration.consolidatedOutputButton = this.configurationService.getValue<boolean>(NotebookSetting.consolidatedOutputButton) ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (consolidatedRunButton) {
|
if (consolidatedRunButton) {
|
||||||
configuration.consolidatedRunButton = this.configurationService.getValue<boolean>(ConsolidatedRunButton) ?? true;
|
configuration.consolidatedRunButton = this.configurationService.getValue<boolean>(NotebookSetting.consolidatedRunButton) ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showFoldingControls) {
|
if (showFoldingControls) {
|
||||||
|
@ -253,15 +259,19 @@ export class NotebookOptions extends Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dragAndDropEnabled) {
|
if (dragAndDropEnabled) {
|
||||||
configuration.dragAndDropEnabled = this.configurationService.getValue<boolean>(DragAndDropEnabled) ?? true;
|
configuration.dragAndDropEnabled = this.configurationService.getValue<boolean>(NotebookSetting.dragAndDropEnabled) ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fontSize) {
|
if (fontSize) {
|
||||||
configuration.fontSize = this.configurationService.getValue<number>('editor.fontSize');
|
configuration.fontSize = this.configurationService.getValue<number>('editor.fontSize');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (markupFontSize) {
|
||||||
|
configuration.markupFontSize = this.configurationService.getValue<number>(NotebookSetting.markupFontSize);
|
||||||
|
}
|
||||||
|
|
||||||
if (editorOptionsCustomizations) {
|
if (editorOptionsCustomizations) {
|
||||||
configuration.editorOptionsCustomizations = this.configurationService.getValue(NotebookCellEditorOptionsCustomizations);
|
configuration.editorOptionsCustomizations = this.configurationService.getValue(NotebookSetting.cellEditorOptionsCustomizations);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._layoutConfiguration = Object.freeze(configuration);
|
this._layoutConfiguration = Object.freeze(configuration);
|
||||||
|
@ -281,24 +291,25 @@ export class NotebookOptions extends Disposable {
|
||||||
consolidatedRunButton,
|
consolidatedRunButton,
|
||||||
dragAndDropEnabled,
|
dragAndDropEnabled,
|
||||||
fontSize,
|
fontSize,
|
||||||
|
markupFontSize,
|
||||||
editorOptionsCustomizations
|
editorOptionsCustomizations
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeInsertToolbarPositionOption() {
|
private _computeInsertToolbarPositionOption() {
|
||||||
return this.configurationService.getValue<'betweenCells' | 'notebookToolbar' | 'both' | 'hidden'>(InsertToolbarLocation) ?? 'both';
|
return this.configurationService.getValue<'betweenCells' | 'notebookToolbar' | 'both' | 'hidden'>(NotebookSetting.insertToolbarLocation) ?? 'both';
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeInsertToolbarAlignmentOption() {
|
private _computeInsertToolbarAlignmentOption() {
|
||||||
return this.configurationService.getValue<'left' | 'center'>(ExperimentalInsertToolbarAlignment) ?? 'center';
|
return this.configurationService.getValue<'left' | 'center'>(NotebookSetting.experimentalInsertToolbarAlignment) ?? 'center';
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeShowFoldingControlsOption() {
|
private _computeShowFoldingControlsOption() {
|
||||||
return this.configurationService.getValue<'always' | 'mouseover'>(ShowFoldingControls) ?? 'mouseover';
|
return this.configurationService.getValue<'always' | 'mouseover'>(NotebookSetting.showFoldingControls) ?? 'mouseover';
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeFocusIndicatorOption() {
|
private _computeFocusIndicatorOption() {
|
||||||
return this.configurationService.getValue<'border' | 'gutter'>(FocusIndicator) ?? 'gutter';
|
return this.configurationService.getValue<'border' | 'gutter'>(NotebookSetting.focusIndicator) ?? 'gutter';
|
||||||
}
|
}
|
||||||
|
|
||||||
getLayoutConfiguration(): NotebookLayoutConfiguration {
|
getLayoutConfiguration(): NotebookLayoutConfiguration {
|
||||||
|
@ -456,7 +467,8 @@ export class NotebookOptions extends Disposable {
|
||||||
rightMargin: this._layoutConfiguration.cellRightMargin,
|
rightMargin: this._layoutConfiguration.cellRightMargin,
|
||||||
runGutter: this._layoutConfiguration.cellRunGutter,
|
runGutter: this._layoutConfiguration.cellRunGutter,
|
||||||
dragAndDropEnabled: this._layoutConfiguration.dragAndDropEnabled,
|
dragAndDropEnabled: this._layoutConfiguration.dragAndDropEnabled,
|
||||||
fontSize: this._layoutConfiguration.fontSize
|
fontSize: this._layoutConfiguration.fontSize,
|
||||||
|
markupFontSize: this._layoutConfiguration.markupFontSize,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,7 +482,8 @@ export class NotebookOptions extends Disposable {
|
||||||
rightMargin: 0,
|
rightMargin: 0,
|
||||||
runGutter: 0,
|
runGutter: 0,
|
||||||
dragAndDropEnabled: false,
|
dragAndDropEnabled: false,
|
||||||
fontSize: this._layoutConfiguration.fontSize
|
fontSize: this._layoutConfiguration.fontSize,
|
||||||
|
markupFontSize: this._layoutConfiguration.markupFontSize,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -374,7 +374,7 @@ suite('NotebookCommon', () => {
|
||||||
assert.strictEqual(diffViewModels.viewModels[0].type, 'unchanged');
|
assert.strictEqual(diffViewModels.viewModels[0].type, 'unchanged');
|
||||||
assert.strictEqual(diffViewModels.viewModels[0].checkIfOutputsModified(), false);
|
assert.strictEqual(diffViewModels.viewModels[0].checkIfOutputsModified(), false);
|
||||||
assert.strictEqual(diffViewModels.viewModels[1].type, 'modified');
|
assert.strictEqual(diffViewModels.viewModels[1].type, 'modified');
|
||||||
assert.strictEqual(diffViewModels.viewModels[1].checkIfOutputsModified(), true);
|
assert.deepStrictEqual(diffViewModels.viewModels[1].checkIfOutputsModified(), { reason: undefined });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ export class SettingsEditor2 extends EditorPane {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return type === SettingValueType.Enum ||
|
return type === SettingValueType.Enum ||
|
||||||
type === SettingValueType.StringOrEnumArray ||
|
type === SettingValueType.Array ||
|
||||||
type === SettingValueType.BooleanObject ||
|
type === SettingValueType.BooleanObject ||
|
||||||
type === SettingValueType.Object ||
|
type === SettingValueType.Object ||
|
||||||
type === SettingValueType.Complex ||
|
type === SettingValueType.Complex ||
|
||||||
|
|
|
@ -1101,8 +1101,7 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr
|
||||||
common.toDispose.add(
|
common.toDispose.add(
|
||||||
listWidget.onDidChangeList(e => {
|
listWidget.onDidChangeList(e => {
|
||||||
const newList = this.computeNewList(template, e);
|
const newList = this.computeNewList(template, e);
|
||||||
this.onDidChangeList(template, newList);
|
if (template.onChange) {
|
||||||
if (newList !== null && template.onChange) {
|
|
||||||
template.onChange(newList);
|
template.onChange(newList);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1111,8 +1110,8 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
private onDidChangeList(template: ISettingListItemTemplate, newList: string[] | undefined | null): void {
|
private onDidChangeList(template: ISettingListItemTemplate, newList: unknown[] | undefined): void {
|
||||||
if (!template.context || newList === null) {
|
if (!template.context || !newList) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1179,7 +1178,7 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr
|
||||||
super.renderSettingElement(element, index, templateData);
|
super.renderSettingElement(element, index, templateData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingListItemTemplate, onChange: (value: string[] | undefined) => void): void {
|
protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingListItemTemplate, onChange: (value: string[] | number[] | undefined) => void): void {
|
||||||
const value = getListDisplayValue(dataElement);
|
const value = getListDisplayValue(dataElement);
|
||||||
const keySuggester = dataElement.setting.enum ? createArraySuggester(dataElement) : undefined;
|
const keySuggester = dataElement.setting.enum ? createArraySuggester(dataElement) : undefined;
|
||||||
template.listWidget.setValue(value, {
|
template.listWidget.setValue(value, {
|
||||||
|
@ -1193,8 +1192,17 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr
|
||||||
}));
|
}));
|
||||||
|
|
||||||
template.onChange = (v) => {
|
template.onChange = (v) => {
|
||||||
onChange(v);
|
if (!renderArrayValidations(dataElement, template, v, false)) {
|
||||||
renderArrayValidations(dataElement, template, v, false);
|
let arrToSave;
|
||||||
|
const itemType = dataElement.setting.arrayItemType;
|
||||||
|
if (v && (itemType === 'number' || itemType === 'integer')) {
|
||||||
|
arrToSave = v.map(a => +a);
|
||||||
|
} else {
|
||||||
|
arrToSave = v;
|
||||||
|
}
|
||||||
|
this.onDidChangeList(template, arrToSave);
|
||||||
|
onChange(arrToSave);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
renderArrayValidations(dataElement, template, value.map(v => v.value.data.toString()), true);
|
renderArrayValidations(dataElement, template, value.map(v => v.value.data.toString()), true);
|
||||||
|
@ -2000,12 +2008,15 @@ function renderValidations(dataElement: SettingsTreeSettingElement, template: IS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate and render any error message for arrays. Returns true if the value is invalid.
|
||||||
|
*/
|
||||||
function renderArrayValidations(
|
function renderArrayValidations(
|
||||||
dataElement: SettingsTreeSettingElement,
|
dataElement: SettingsTreeSettingElement,
|
||||||
template: ISettingListItemTemplate | ISettingObjectItemTemplate,
|
template: ISettingListItemTemplate | ISettingObjectItemTemplate,
|
||||||
value: string[] | Record<string, unknown> | undefined,
|
value: string[] | Record<string, unknown> | undefined,
|
||||||
calledOnStartup: boolean
|
calledOnStartup: boolean
|
||||||
) {
|
): boolean {
|
||||||
template.containerElement.classList.add('invalid-input');
|
template.containerElement.classList.add('invalid-input');
|
||||||
if (dataElement.setting.validator) {
|
if (dataElement.setting.validator) {
|
||||||
const errMsg = dataElement.setting.validator(value);
|
const errMsg = dataElement.setting.validator(value);
|
||||||
|
@ -2015,12 +2026,13 @@ function renderArrayValidations(
|
||||||
const validationError = localize('validationError', "Validation Error.");
|
const validationError = localize('validationError', "Validation Error.");
|
||||||
template.containerElement.setAttribute('aria-label', [dataElement.setting.key, validationError, errMsg].join(' '));
|
template.containerElement.setAttribute('aria-label', [dataElement.setting.key, validationError, errMsg].join(' '));
|
||||||
if (!calledOnStartup) { ariaAlert(validationError + ' ' + errMsg); }
|
if (!calledOnStartup) { ariaAlert(validationError + ' ' + errMsg); }
|
||||||
return;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
template.containerElement.setAttribute('aria-label', dataElement.setting.key);
|
template.containerElement.setAttribute('aria-label', dataElement.setting.key);
|
||||||
template.containerElement.classList.remove('invalid-input');
|
template.containerElement.classList.remove('invalid-input');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanRenderedMarkdown(element: Node): void {
|
function cleanRenderedMarkdown(element: Node): void {
|
||||||
|
@ -2154,7 +2166,7 @@ class SettingsTreeDelegate extends CachedListVirtualDelegate<SettingsTreeGroupCh
|
||||||
return SETTINGS_ENUM_TEMPLATE_ID;
|
return SETTINGS_ENUM_TEMPLATE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.valueType === SettingValueType.StringOrEnumArray) {
|
if (element.valueType === SettingValueType.Array) {
|
||||||
return SETTINGS_ARRAY_TEMPLATE_ID;
|
return SETTINGS_ARRAY_TEMPLATE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,8 +241,9 @@ export class SettingsTreeSettingElement extends SettingsTreeElement {
|
||||||
this.valueType = SettingValueType.Number;
|
this.valueType = SettingValueType.Number;
|
||||||
} else if (this.setting.type === 'boolean') {
|
} else if (this.setting.type === 'boolean') {
|
||||||
this.valueType = SettingValueType.Boolean;
|
this.valueType = SettingValueType.Boolean;
|
||||||
} else if (this.setting.type === 'array' && (this.setting.arrayItemType === 'string' || this.setting.arrayItemType === 'enum')) {
|
} else if (this.setting.type === 'array' && this.setting.arrayItemType &&
|
||||||
this.valueType = SettingValueType.StringOrEnumArray;
|
['string', 'enum', 'number', 'integer'].includes(this.setting.arrayItemType)) {
|
||||||
|
this.valueType = SettingValueType.Array;
|
||||||
} else if (isArray(this.setting.type) && this.setting.type.includes(SettingValueType.Null) && this.setting.type.length === 2) {
|
} else if (isArray(this.setting.type) && this.setting.type.includes(SettingValueType.Null) && this.setting.type.length === 2) {
|
||||||
if (this.setting.type.includes(SettingValueType.Integer)) {
|
if (this.setting.type.includes(SettingValueType.Integer)) {
|
||||||
this.valueType = SettingValueType.NullableInteger;
|
this.valueType = SettingValueType.NullableInteger;
|
||||||
|
|
|
@ -824,7 +824,7 @@ export class ListSettingWidget extends AbstractListSettingWidget<IListDataItem>
|
||||||
deleteActionTooltip: localize('removeItem', "Remove Item"),
|
deleteActionTooltip: localize('removeItem', "Remove Item"),
|
||||||
editActionTooltip: localize('editItem', "Edit Item"),
|
editActionTooltip: localize('editItem', "Edit Item"),
|
||||||
addButtonLabel: localize('addItem', "Add Item"),
|
addButtonLabel: localize('addItem', "Add Item"),
|
||||||
inputPlaceholder: localize('itemInputPlaceholder', "String Item..."),
|
inputPlaceholder: localize('itemInputPlaceholder', "Item..."),
|
||||||
siblingInputPlaceholder: localize('listSiblingInputPlaceholder', "Sibling..."),
|
siblingInputPlaceholder: localize('listSiblingInputPlaceholder', "Sibling..."),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||||
import { SCMMenus } from 'vs/workbench/contrib/scm/browser/menus';
|
import { SCMMenus } from 'vs/workbench/contrib/scm/browser/menus';
|
||||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||||
import { debounce } from 'vs/base/common/decorators';
|
import { debounce } from 'vs/base/common/decorators';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
|
||||||
|
|
||||||
function getProviderStorageKey(provider: ISCMProvider): string {
|
function getProviderStorageKey(provider: ISCMProvider): string {
|
||||||
return `${provider.contextValue}:${provider.label}${provider.rootUri ? `:${provider.rootUri.toString()}` : ''}`;
|
return `${provider.contextValue}:${provider.label}${provider.rootUri ? `:${provider.rootUri.toString()}` : ''}`;
|
||||||
|
@ -100,8 +99,7 @@ export class SCMViewService implements ISCMViewService {
|
||||||
constructor(
|
constructor(
|
||||||
@ISCMService private readonly scmService: ISCMService,
|
@ISCMService private readonly scmService: ISCMService,
|
||||||
@IInstantiationService instantiationService: IInstantiationService,
|
@IInstantiationService instantiationService: IInstantiationService,
|
||||||
@IStorageService private readonly storageService: IStorageService,
|
@IStorageService private readonly storageService: IStorageService
|
||||||
@ILogService private readonly logService: ILogService
|
|
||||||
) {
|
) {
|
||||||
this.menus = instantiationService.createInstance(SCMMenus);
|
this.menus = instantiationService.createInstance(SCMMenus);
|
||||||
|
|
||||||
|
@ -123,8 +121,6 @@ export class SCMViewService implements ISCMViewService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private onDidAddRepository(repository: ISCMRepository): void {
|
private onDidAddRepository(repository: ISCMRepository): void {
|
||||||
this.logService.trace('SCMViewService#onDidAddRepository', getProviderStorageKey(repository.provider));
|
|
||||||
|
|
||||||
if (!this.didFinishLoading) {
|
if (!this.didFinishLoading) {
|
||||||
this.eventuallyFinishLoading();
|
this.eventuallyFinishLoading();
|
||||||
}
|
}
|
||||||
|
@ -135,8 +131,6 @@ export class SCMViewService implements ISCMViewService {
|
||||||
const index = this.previousState.all.indexOf(getProviderStorageKey(repository.provider));
|
const index = this.previousState.all.indexOf(getProviderStorageKey(repository.provider));
|
||||||
|
|
||||||
if (index === -1) { // saw a repo we did not expect
|
if (index === -1) { // saw a repo we did not expect
|
||||||
this.logService.trace('SCMViewService#onDidAddRepository', 'This is a new repository, so we stop the heuristics');
|
|
||||||
|
|
||||||
const added: ISCMRepository[] = [];
|
const added: ISCMRepository[] = [];
|
||||||
for (const repo of this.scmService.repositories) { // all should be visible
|
for (const repo of this.scmService.repositories) { // all should be visible
|
||||||
if (!this._visibleRepositoriesSet.has(repo)) {
|
if (!this._visibleRepositoriesSet.has(repo)) {
|
||||||
|
@ -179,8 +173,6 @@ export class SCMViewService implements ISCMViewService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private onDidRemoveRepository(repository: ISCMRepository): void {
|
private onDidRemoveRepository(repository: ISCMRepository): void {
|
||||||
this.logService.trace('SCMViewService#onDidRemoveRepository', getProviderStorageKey(repository.provider));
|
|
||||||
|
|
||||||
if (!this.didFinishLoading) {
|
if (!this.didFinishLoading) {
|
||||||
this.eventuallyFinishLoading();
|
this.eventuallyFinishLoading();
|
||||||
}
|
}
|
||||||
|
@ -257,7 +249,6 @@ export class SCMViewService implements ISCMViewService {
|
||||||
|
|
||||||
@debounce(2000)
|
@debounce(2000)
|
||||||
private eventuallyFinishLoading(): void {
|
private eventuallyFinishLoading(): void {
|
||||||
this.logService.trace('SCMViewService#eventuallyFinishLoading');
|
|
||||||
this.finishLoading();
|
this.finishLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +257,6 @@ export class SCMViewService implements ISCMViewService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logService.trace('SCMViewService#finishLoading');
|
|
||||||
this.didFinishLoading = true;
|
this.didFinishLoading = true;
|
||||||
this.previousState = undefined;
|
this.previousState = undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,24 +40,57 @@
|
||||||
.monaco-workbench .editor-instance .terminal-wrapper,
|
.monaco-workbench .editor-instance .terminal-wrapper,
|
||||||
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper {
|
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper {
|
||||||
display: none;
|
display: none;
|
||||||
margin: 0 10px;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-bottom: 2px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.monaco-workbench .editor-instance .xterm,
|
||||||
|
.monaco-workbench .pane-body.integrated-terminal .xterm {
|
||||||
|
/* All terminals have at least 10px left/right edge padding and 2 padding on the bottom (so underscores on last line are visible */
|
||||||
|
padding: 0 10px 2px;
|
||||||
|
/* Bottom align the terminal withing the split pane */
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-workbench .editor-instance .terminal-wrapper.fixed-dims .xterm,
|
||||||
|
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper.fixed-dims .xterm {
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-workbench .editor-instance .xterm-viewport,
|
||||||
|
.monaco-workbench .pane-body.integrated-terminal .xterm-viewport {
|
||||||
|
z-index: 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-workbench .editor-instance .xterm-screen,
|
||||||
|
.monaco-workbench .pane-body.integrated-terminal .xterm-screen {
|
||||||
|
z-index: 31;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xterm .xterm-screen {
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Apply cursor styles to xterm-screen as well due to how .xterm-viewport/.xterm are positioned */
|
||||||
|
.xterm.enable-mouse-events .xterm-screen { cursor: default; }
|
||||||
|
.xterm.xterm-cursor-pointer .xterm-screen { cursor: pointer; }
|
||||||
|
.xterm.column-select.focus .xterm-screen { cursor: crosshair; }
|
||||||
|
|
||||||
.monaco-workbench .editor-instance .terminal-wrapper.active,
|
.monaco-workbench .editor-instance .terminal-wrapper.active,
|
||||||
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper.active {
|
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper.active {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .terminal-wrapper,
|
.monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .xterm,
|
||||||
.monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .terminal-wrapper {
|
.monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .xterm {
|
||||||
margin-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
.monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .terminal-wrapper,
|
.monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .xterm,
|
||||||
.monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .terminal-wrapper {
|
.monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .xterm {
|
||||||
margin-right: 20px;
|
padding-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .editor-instance .xterm a:not(.xterm-invalid-link),
|
.monaco-workbench .editor-instance .xterm a:not(.xterm-invalid-link),
|
||||||
|
@ -69,22 +102,24 @@
|
||||||
.monaco-workbench .editor-instance .terminal-wrapper > div,
|
.monaco-workbench .editor-instance .terminal-wrapper > div,
|
||||||
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper > div {
|
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper > div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
/* Align the viewport and canvases to the bottom of the panel */
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .editor-instance .xterm-viewport,
|
.monaco-workbench .editor-instance .xterm-viewport,
|
||||||
.monaco-workbench .pane-body.integrated-terminal .xterm-viewport {
|
.monaco-workbench .pane-body.integrated-terminal .xterm-viewport {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-right: -10px;
|
}
|
||||||
|
|
||||||
|
.monaco-workbench .editor-instance .terminal-wrapper.fixed-dims,
|
||||||
|
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper.fixed-dims {
|
||||||
|
/* The viewport should be positioned against this so it does't conflict with a fixed dimensions terminal horizontal scroll bar*/
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-workbench .editor-instance .terminal-wrapper:not(.fixed-dims) .xterm-viewport,
|
||||||
|
.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(.fixed-dims) .xterm-viewport {
|
||||||
/* Override xterm.js' width as we want to size the viewport to fill the panel so the scrollbar is on the right edge */
|
/* Override xterm.js' width as we want to size the viewport to fill the panel so the scrollbar is on the right edge */
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
}
|
}
|
||||||
.monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .xterm-viewport,
|
|
||||||
.monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .xterm-viewport {
|
|
||||||
margin-right: -20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-workbench .pane-body.integrated-terminal {
|
.monaco-workbench .pane-body.integrated-terminal {
|
||||||
font-variant-ligatures: none;
|
font-variant-ligatures: none;
|
||||||
|
|
|
@ -26,12 +26,12 @@
|
||||||
|
|
||||||
.monaco-workbench .terminal-env-var-info {
|
.monaco-workbench .terminal-env-var-info {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 2px;
|
right: 10px; /* room for scroll bar */
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 28px;
|
width: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index: 10;
|
z-index: 32;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,11 +40,6 @@
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .pane-body.integrated-terminal .monaco-split-view2.horizontal .split-view-view:last-child .terminal-env-var-info {
|
|
||||||
/* Adjust for reduced margin in splits */
|
|
||||||
right: -8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monaco-workbench .terminal-env-var-info.codicon {
|
.monaco-workbench .terminal-env-var-info.codicon {
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,9 +40,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.xterm {
|
.xterm {
|
||||||
font-feature-settings: "liga" 0;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ class RemoteTerminalBackend extends Disposable implements ITerminalBackend {
|
||||||
return this._remoteTerminalChannel?.getWslPath(original) || original;
|
return this._remoteTerminalChannel?.getWslPath(original) || original;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTerminalLayoutInfo(layout: ITerminalsLayoutInfoById): Promise<void> {
|
async setTerminalLayoutInfo(layout?: ITerminalsLayoutInfoById): Promise<void> {
|
||||||
if (!this._remoteTerminalChannel) {
|
if (!this._remoteTerminalChannel) {
|
||||||
throw new Error(`Cannot call setActiveInstanceId when there is no remote`);
|
throw new Error(`Cannot call setActiveInstanceId when there is no remote`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
|
||||||
import { FindReplaceState } from 'vs/editor/contrib/find/findState';
|
import { FindReplaceState } from 'vs/editor/contrib/find/findState';
|
||||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IShellLaunchConfig, ITerminalDimensions, ITerminalLaunchError, ITerminalProfile, ITerminalTabLayoutInfoById, TerminalIcon, TitleEventSource, TerminalShellType, IExtensionTerminalProfile, TerminalLocation, ProcessPropertyType, ProcessCapability, IProcessPropertyMap } from 'vs/platform/terminal/common/terminal';
|
import { IShellLaunchConfig, ITerminalDimensions, ITerminalLaunchError, ITerminalProfile, ITerminalTabLayoutInfoById, TerminalIcon, TitleEventSource, TerminalShellType, IExtensionTerminalProfile, TerminalLocation, ProcessPropertyType, ProcessCapability, IProcessPropertyMap } from 'vs/platform/terminal/common/terminal';
|
||||||
import { ICommandTracker, INavigationMode, IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalFont, ITerminalBackend, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal';
|
import { ICommandTracker, INavigationMode, IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalFont, ITerminalBackend, ITerminalProcessExtHostProxy, IRegisterContributedProfileArgs } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||||
import type { Terminal as XTermTerminal } from 'xterm';
|
import type { Terminal as XTermTerminal } from 'xterm';
|
||||||
import type { SearchAddon as XTermSearchAddon } from 'xterm-addon-search';
|
import type { SearchAddon as XTermSearchAddon } from 'xterm-addon-search';
|
||||||
import type { Unicode11Addon as XTermUnicode11Addon } from 'xterm-addon-unicode11';
|
import type { Unicode11Addon as XTermUnicode11Addon } from 'xterm-addon-unicode11';
|
||||||
|
@ -19,6 +19,7 @@ import { IEditableData } from 'vs/workbench/common/views';
|
||||||
import { DeserializedTerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorSerializer';
|
import { DeserializedTerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorSerializer';
|
||||||
import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput';
|
import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput';
|
||||||
import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn';
|
import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn';
|
||||||
|
import { IKeyMods } from 'vs/platform/quickinput/common/quickInput';
|
||||||
|
|
||||||
export const ITerminalService = createDecorator<ITerminalService>('terminalService');
|
export const ITerminalService = createDecorator<ITerminalService>('terminalService');
|
||||||
export const ITerminalEditorService = createDecorator<ITerminalEditorService>('terminalEditorService');
|
export const ITerminalEditorService = createDecorator<ITerminalEditorService>('terminalEditorService');
|
||||||
|
@ -73,6 +74,11 @@ export const enum Direction {
|
||||||
Down = 3
|
Down = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IQuickPickTerminalObject {
|
||||||
|
config: IRegisterContributedProfileArgs | ITerminalProfile | { profile: IExtensionTerminalProfile, options: { icon?: string, color?: string } } | undefined,
|
||||||
|
keyMods: IKeyMods | undefined
|
||||||
|
}
|
||||||
|
|
||||||
export interface ITerminalGroup {
|
export interface ITerminalGroup {
|
||||||
activeInstance: ITerminalInstance | undefined;
|
activeInstance: ITerminalInstance | undefined;
|
||||||
terminalInstances: ITerminalInstance[];
|
terminalInstances: ITerminalInstance[];
|
||||||
|
@ -387,6 +393,8 @@ export interface ITerminalInstance {
|
||||||
readonly rows: number;
|
readonly rows: number;
|
||||||
readonly maxCols: number;
|
readonly maxCols: number;
|
||||||
readonly maxRows: number;
|
readonly maxRows: number;
|
||||||
|
readonly fixedCols?: number;
|
||||||
|
readonly fixedRows?: number;
|
||||||
readonly icon?: TerminalIcon;
|
readonly icon?: TerminalIcon;
|
||||||
readonly color?: string;
|
readonly color?: string;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import { TerminalLinkManager } from 'vs/workbench/contrib/terminal/browser/links
|
||||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||||
import { ITerminalInstanceService, ITerminalInstance, ITerminalExternalLinkProvider, IRequestAddInstanceToGroupEvent } from 'vs/workbench/contrib/terminal/browser/terminal';
|
import { ITerminalInstanceService, ITerminalInstance, ITerminalExternalLinkProvider, IRequestAddInstanceToGroupEvent } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||||
import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager';
|
import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager';
|
||||||
import type { Terminal as XTermTerminal, IBuffer, ITerminalAddon } from 'xterm';
|
import type { Terminal as XTermTerminal, ITerminalAddon } from 'xterm';
|
||||||
import { NavigationModeAddon } from 'vs/workbench/contrib/terminal/browser/xterm/navigationModeAddon';
|
import { NavigationModeAddon } from 'vs/workbench/contrib/terminal/browser/xterm/navigationModeAddon';
|
||||||
import { IViewsService, IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views';
|
import { IViewsService, IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||||
import { EnvironmentVariableInfoWidget } from 'vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget';
|
import { EnvironmentVariableInfoWidget } from 'vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget';
|
||||||
|
@ -128,6 +128,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
private _fixedRows: number | undefined;
|
private _fixedRows: number | undefined;
|
||||||
private _cwd: string | undefined = undefined;
|
private _cwd: string | undefined = undefined;
|
||||||
private _initialCwd: string | undefined = undefined;
|
private _initialCwd: string | undefined = undefined;
|
||||||
|
private _layoutSettingsChanged: boolean = true;
|
||||||
private _dimensionsOverride: ITerminalDimensionsOverride | undefined;
|
private _dimensionsOverride: ITerminalDimensionsOverride | undefined;
|
||||||
private _titleReadyPromise: Promise<string>;
|
private _titleReadyPromise: Promise<string>;
|
||||||
private _titleReadyComplete: ((title: string) => any) | undefined;
|
private _titleReadyComplete: ((title: string) => any) | undefined;
|
||||||
|
@ -364,6 +365,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
if (this._fixedCols) {
|
if (this._fixedCols) {
|
||||||
await this._addScrollbar();
|
await this._addScrollbar();
|
||||||
}
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
// Ignore exceptions if the terminal is already disposed
|
||||||
|
if (!this._isDisposed) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addDisposable(this._configurationService.onDidChangeConfiguration(async e => {
|
this.addDisposable(this._configurationService.onDidChangeConfiguration(async e => {
|
||||||
|
@ -381,6 +387,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
'editor.fontFamily'
|
'editor.fontFamily'
|
||||||
];
|
];
|
||||||
if (layoutSettings.some(id => e.affectsConfiguration(id))) {
|
if (layoutSettings.some(id => e.affectsConfiguration(id))) {
|
||||||
|
this._layoutSettingsChanged = true;
|
||||||
await this._resize();
|
await this._resize();
|
||||||
}
|
}
|
||||||
if (e.affectsConfiguration(TerminalSettingId.UnicodeVersion)) {
|
if (e.affectsConfiguration(TerminalSettingId.UnicodeVersion)) {
|
||||||
|
@ -441,9 +448,10 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const computedStyle = window.getComputedStyle(this._wrapperElement!);
|
const computedStyle = window.getComputedStyle(this._container);
|
||||||
const width = parseInt(computedStyle.getPropertyValue('width').replace('px', ''), 10);
|
const width = parseInt(computedStyle.width);
|
||||||
const height = parseInt(computedStyle.getPropertyValue('height').replace('px', ''), 10);
|
const height = parseInt(computedStyle.height);
|
||||||
|
|
||||||
this._evaluateColsAndRows(width, height);
|
this._evaluateColsAndRows(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,10 +522,15 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._wrapperElement) {
|
if (!this._wrapperElement || !this.xterm?.raw.element) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
TerminalInstance._lastKnownCanvasDimensions = new dom.Dimension(Math.min(Constants.MaxCanvasWidth, width), height + (this._hasScrollBar && !this._horizontalScrollbar ? -scrollbarHeight - 2 : 0)/* bottom padding */);
|
const computedStyle = window.getComputedStyle(this.xterm.raw.element);
|
||||||
|
const horizontalPadding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight);
|
||||||
|
const verticalPadding = parseInt(computedStyle.paddingTop) + parseInt(computedStyle.paddingBottom);
|
||||||
|
TerminalInstance._lastKnownCanvasDimensions = new dom.Dimension(
|
||||||
|
Math.min(Constants.MaxCanvasWidth, width - horizontalPadding),
|
||||||
|
height + (this._hasScrollBar && !this._horizontalScrollbar ? -scrollbarHeight : 0) - 2/* bottom padding */ - verticalPadding);
|
||||||
return TerminalInstance._lastKnownCanvasDimensions;
|
return TerminalInstance._lastKnownCanvasDimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,8 +556,10 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
*/
|
*/
|
||||||
protected async _createXterm(): Promise<XtermTerminal> {
|
protected async _createXterm(): Promise<XtermTerminal> {
|
||||||
const Terminal = await this._getXtermConstructor();
|
const Terminal = await this._getXtermConstructor();
|
||||||
|
if (this._isDisposed) {
|
||||||
|
throw new Error('Terminal disposed of during xterm.js creation');
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Move cols/rows over to XtermTerminal
|
|
||||||
const xterm = this._instantiationService.createInstance(XtermTerminal, Terminal, this._configHelper, this._cols, this._rows);
|
const xterm = this._instantiationService.createInstance(XtermTerminal, Terminal, this._configHelper, this._cols, this._rows);
|
||||||
this.xterm = xterm;
|
this.xterm = xterm;
|
||||||
const lineDataEventAddon = new LineDataEventAddon();
|
const lineDataEventAddon = new LineDataEventAddon();
|
||||||
|
@ -600,7 +615,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
lineDataEventAddon.setOperatingSystem(this._processManager.os);
|
lineDataEventAddon.setOperatingSystem(this._processManager.os);
|
||||||
}
|
}
|
||||||
if (this._processManager.os === OperatingSystem.Windows) {
|
if (this._processManager.os === OperatingSystem.Windows) {
|
||||||
xterm.raw.setOption('windowsMode', processTraits.requiresWindowsMode || false);
|
xterm.raw.options.windowsMode = processTraits.requiresWindowsMode || false;
|
||||||
}
|
}
|
||||||
this._linkManager = this._instantiationService.createInstance(TerminalLinkManager, xterm.raw, this._processManager!);
|
this._linkManager = this._instantiationService.createInstance(TerminalLinkManager, xterm.raw, this._processManager!);
|
||||||
this._areLinksReady = true;
|
this._areLinksReady = true;
|
||||||
|
@ -763,13 +778,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
xterm.raw.focus();
|
xterm.raw.focus();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._register(dom.addDisposableListener(xterm.raw.element, 'wheel', (e) => {
|
|
||||||
if (this._hasScrollBar && e.shiftKey) {
|
|
||||||
e.stopImmediatePropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
// xterm.js currently drops selection on keyup as we need to handle this case.
|
// xterm.js currently drops selection on keyup as we need to handle this case.
|
||||||
this._register(dom.addDisposableListener(xterm.raw.element, 'keyup', () => {
|
this._register(dom.addDisposableListener(xterm.raw.element, 'keyup', () => {
|
||||||
// Wait until keyup has propagated through the DOM before evaluating
|
// Wait until keyup has propagated through the DOM before evaluating
|
||||||
|
@ -1080,7 +1088,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
});
|
});
|
||||||
this._processManager.onEnvironmentVariableInfoChanged(e => this._onEnvironmentVariableInfoChanged(e));
|
this._processManager.onEnvironmentVariableInfoChanged(e => this._onEnvironmentVariableInfoChanged(e));
|
||||||
this._processManager.onPtyDisconnect(() => {
|
this._processManager.onPtyDisconnect(() => {
|
||||||
this._safeSetOption('disableStdin', true);
|
if (this.xterm) {
|
||||||
|
this.xterm.raw.options.disableStdin = true;
|
||||||
|
}
|
||||||
this.statusList.add({
|
this.statusList.add({
|
||||||
id: TerminalStatus.Disconnected,
|
id: TerminalStatus.Disconnected,
|
||||||
severity: Severity.Error,
|
severity: Severity.Error,
|
||||||
|
@ -1089,7 +1099,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this._processManager.onPtyReconnect(() => {
|
this._processManager.onPtyReconnect(() => {
|
||||||
this._safeSetOption('disableStdin', false);
|
if (this.xterm) {
|
||||||
|
this.xterm.raw.options.disableStdin = false;
|
||||||
|
}
|
||||||
this.statusList.remove(TerminalStatus.Disconnected);
|
this.statusList.remove(TerminalStatus.Disconnected);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1223,7 +1235,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
xterm.raw.write(formatMessageForTerminal(this._shellLaunchConfig.waitOnExit));
|
xterm.raw.write(formatMessageForTerminal(this._shellLaunchConfig.waitOnExit));
|
||||||
}
|
}
|
||||||
// Disable all input if the terminal is exiting and listen for next keypress
|
// Disable all input if the terminal is exiting and listen for next keypress
|
||||||
xterm.raw.setOption('disableStdin', true);
|
xterm.raw.options.disableStdin = true;
|
||||||
if (xterm.raw.textarea) {
|
if (xterm.raw.textarea) {
|
||||||
this._attachPressAnyKeyToCloseListener(xterm.raw);
|
this._attachPressAnyKeyToCloseListener(xterm.raw);
|
||||||
}
|
}
|
||||||
|
@ -1305,7 +1317,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
|
|
||||||
// Clean up waitOnExit state
|
// Clean up waitOnExit state
|
||||||
if (this._isExiting && this._shellLaunchConfig.waitOnExit) {
|
if (this._isExiting && this._shellLaunchConfig.waitOnExit) {
|
||||||
this.xterm.raw.setOption('disableStdin', false);
|
this.xterm.raw.options.disableStdin = false;
|
||||||
this._isExiting = false;
|
this._isExiting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1389,7 +1401,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
this._navigationModeAddon?.dispose();
|
this._navigationModeAddon?.dispose();
|
||||||
this._navigationModeAddon = undefined;
|
this._navigationModeAddon = undefined;
|
||||||
}
|
}
|
||||||
this.xterm!.raw.setOption('screenReaderMode', isEnabled);
|
this.xterm!.raw.options.screenReaderMode = isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _setCommandsToSkipShell(commands: string[]): void {
|
private _setCommandsToSkipShell(commands: string[]): void {
|
||||||
|
@ -1399,16 +1411,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
}).concat(commands);
|
}).concat(commands);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _safeSetOption(key: string, value: any): void {
|
|
||||||
if (!this.xterm) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.xterm.raw.getOption(key) !== value) {
|
|
||||||
this.xterm.raw.setOption(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
layout(dimension: dom.Dimension): void {
|
layout(dimension: dom.Dimension): void {
|
||||||
this._lastLayoutDimensions = dimension;
|
this._lastLayoutDimensions = dimension;
|
||||||
if (this.disableLayout) {
|
if (this.disableLayout) {
|
||||||
|
@ -1421,6 +1423,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Evaluate columns and rows, exclude the wrapper element's margin
|
||||||
const terminalWidth = this._evaluateColsAndRows(dimension.width, dimension.height);
|
const terminalWidth = this._evaluateColsAndRows(dimension.width, dimension.height);
|
||||||
if (!terminalWidth) {
|
if (!terminalWidth) {
|
||||||
return;
|
return;
|
||||||
|
@ -1444,21 +1447,23 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
if (this.xterm) {
|
if (this.xterm) {
|
||||||
// Only apply these settings when the terminal is visible so that
|
// Only apply these settings when the terminal is visible so that
|
||||||
// the characters are measured correctly.
|
// the characters are measured correctly.
|
||||||
if (this._isVisible) {
|
if (this._isVisible && this._layoutSettingsChanged) {
|
||||||
const font = this.xterm ? this.xterm.getFont() : this._configHelper.getFont();
|
const font = this.xterm.getFont();
|
||||||
const config = this._configHelper.config;
|
const config = this._configHelper.config;
|
||||||
this._safeSetOption('letterSpacing', font.letterSpacing);
|
this.xterm.raw.options.letterSpacing = font.letterSpacing;
|
||||||
this._safeSetOption('lineHeight', font.lineHeight);
|
this.xterm.raw.options.lineHeight = font.lineHeight;
|
||||||
this._safeSetOption('fontSize', font.fontSize);
|
this.xterm.raw.options.fontSize = font.fontSize;
|
||||||
this._safeSetOption('fontFamily', font.fontFamily);
|
this.xterm.raw.options.fontFamily = font.fontFamily;
|
||||||
this._safeSetOption('fontWeight', config.fontWeight);
|
this.xterm.raw.options.fontWeight = config.fontWeight;
|
||||||
this._safeSetOption('fontWeightBold', config.fontWeightBold);
|
this.xterm.raw.options.fontWeightBold = config.fontWeightBold;
|
||||||
|
|
||||||
// Any of the above setting changes could have changed the dimensions of the
|
// Any of the above setting changes could have changed the dimensions of the
|
||||||
// terminal, re-evaluate now.
|
// terminal, re-evaluate now.
|
||||||
this._initDimensions();
|
this._initDimensions();
|
||||||
cols = this.cols;
|
cols = this.cols;
|
||||||
rows = this.rows;
|
rows = this.rows;
|
||||||
|
|
||||||
|
this._layoutSettingsChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(cols) || isNaN(rows)) {
|
if (isNaN(cols) || isNaN(rows)) {
|
||||||
|
@ -1599,6 +1604,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._fixedCols = this._parseFixedDimension(cols);
|
this._fixedCols = this._parseFixedDimension(cols);
|
||||||
|
this._labelComputer?.refreshLabel();
|
||||||
this._terminalHasFixedWidth.set(!!this._fixedCols);
|
this._terminalHasFixedWidth.set(!!this._fixedCols);
|
||||||
const rows = await this._quickInputService.input({
|
const rows = await this._quickInputService.input({
|
||||||
title: nls.localize('setTerminalDimensionsRow', "Set Fixed Dimensions: Row"),
|
title: nls.localize('setTerminalDimensionsRow', "Set Fixed Dimensions: Row"),
|
||||||
|
@ -1609,7 +1615,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._fixedRows = this._parseFixedDimension(rows);
|
this._fixedRows = this._parseFixedDimension(rows);
|
||||||
this._addScrollbar();
|
this._labelComputer?.refreshLabel();
|
||||||
|
await this._refreshScrollbar();
|
||||||
this._resize();
|
this._resize();
|
||||||
this.focus();
|
this.focus();
|
||||||
}
|
}
|
||||||
|
@ -1636,37 +1643,37 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
this._hasScrollBar = false;
|
this._hasScrollBar = false;
|
||||||
this._initDimensions();
|
this._initDimensions();
|
||||||
await this._resize();
|
await this._resize();
|
||||||
this._horizontalScrollbar?.setScrollDimensions({ scrollWidth: 0 });
|
|
||||||
} else {
|
} else {
|
||||||
let maxCols = 0;
|
// Fixed columns should be at least xterm.js' regular column count
|
||||||
if (!this.xterm.raw.buffer.active.getLine(0)) {
|
const proposedCols = Math.max(this.maxCols, Math.min(this.xterm.getLongestViewportWrappedLineLength(), Constants.MaxSupportedCols));
|
||||||
return;
|
// Don't switch to fixed dimensions if the content already fits as it makes the scroll
|
||||||
|
// bar look bad being off the edge
|
||||||
|
if (proposedCols > this.xterm.raw.cols) {
|
||||||
|
this._fixedCols = proposedCols;
|
||||||
}
|
}
|
||||||
const lineWidth = this.xterm.raw.buffer.active.getLine(0)!.length;
|
|
||||||
for (let i = this.xterm.raw.buffer.active.length - 1; i >= this.xterm.raw.buffer.active.viewportY; i--) {
|
|
||||||
const lineInfo = this._getWrappedLineCount(i, this.xterm.raw.buffer.active);
|
|
||||||
maxCols = Math.max(maxCols, ((lineInfo.lineCount * lineWidth) - lineInfo.endSpaces) || 0);
|
|
||||||
i = lineInfo.currentIndex;
|
|
||||||
}
|
|
||||||
maxCols = Math.min(maxCols, Constants.MaxSupportedCols);
|
|
||||||
this._fixedCols = maxCols;
|
|
||||||
await this._addScrollbar();
|
|
||||||
}
|
}
|
||||||
|
await this._refreshScrollbar();
|
||||||
|
this._labelComputer?.refreshLabel();
|
||||||
this.focus();
|
this.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _refreshScrollbar(): Promise<void> {
|
||||||
|
if (this._fixedCols || this._fixedRows) {
|
||||||
|
return this._addScrollbar();
|
||||||
|
}
|
||||||
|
return this._removeScrollbar();
|
||||||
|
}
|
||||||
|
|
||||||
private async _addScrollbar(): Promise<void> {
|
private async _addScrollbar(): Promise<void> {
|
||||||
const charWidth = (this.xterm ? this.xterm.getFont() : this._configHelper.getFont()).charWidth;
|
const charWidth = (this.xterm ? this.xterm.getFont() : this._configHelper.getFont()).charWidth;
|
||||||
if (!this.xterm?.raw.element || !this._wrapperElement || !this._container || !charWidth || !this._fixedCols) {
|
if (!this.xterm?.raw.element || !this._wrapperElement || !this._container || !charWidth || !this._fixedCols) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._fixedCols < this.xterm.raw.buffer.active.getLine(0)!.length) {
|
this._wrapperElement.classList.add('fixed-dims');
|
||||||
// no scrollbar needed
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._hasScrollBar = true;
|
this._hasScrollBar = true;
|
||||||
this._initDimensions();
|
this._initDimensions();
|
||||||
this._fixedRows = this.rows;
|
// Always remove a row to make room for the scroll bar
|
||||||
|
this._fixedRows = this._rows - 1;
|
||||||
await this._resize();
|
await this._resize();
|
||||||
this._terminalHasFixedWidth.set(true);
|
this._terminalHasFixedWidth.set(true);
|
||||||
if (!this._horizontalScrollbar) {
|
if (!this._horizontalScrollbar) {
|
||||||
|
@ -1679,39 +1686,31 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
}));
|
}));
|
||||||
this._container.appendChild(this._horizontalScrollbar.getDomNode());
|
this._container.appendChild(this._horizontalScrollbar.getDomNode());
|
||||||
}
|
}
|
||||||
this._horizontalScrollbar.setScrollDimensions(
|
this._horizontalScrollbar.setScrollDimensions({
|
||||||
{
|
width: this.xterm.raw.element.clientWidth,
|
||||||
width: this.xterm.raw.element.clientWidth,
|
scrollWidth: this._fixedCols * charWidth + 40 // Padding + scroll bar
|
||||||
scrollWidth: this._fixedCols * charWidth
|
});
|
||||||
});
|
this._horizontalScrollbar.getDomNode().style.paddingBottom = '16px';
|
||||||
this._horizontalScrollbar!.getDomNode().style.paddingBottom = '16px';
|
|
||||||
|
|
||||||
// work around for https://github.com/xtermjs/xterm.js/issues/3482
|
// work around for https://github.com/xtermjs/xterm.js/issues/3482
|
||||||
for (let i = this.xterm.raw.buffer.active.viewportY; i < this.xterm.raw.buffer.active.length; i++) {
|
if (isWindows) {
|
||||||
let line = this.xterm.raw.buffer.active.getLine(i);
|
for (let i = this.xterm.raw.buffer.active.viewportY; i < this.xterm.raw.buffer.active.length; i++) {
|
||||||
(line as any)._line.isWrapped = false;
|
let line = this.xterm.raw.buffer.active.getLine(i);
|
||||||
|
(line as any)._line.isWrapped = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getWrappedLineCount(index: number, buffer: IBuffer): { lineCount: number, currentIndex: number, endSpaces: number } {
|
private async _removeScrollbar(): Promise<void> {
|
||||||
let line = buffer.getLine(index);
|
if (!this._container || !this._wrapperElement || !this._horizontalScrollbar) {
|
||||||
if (!line) {
|
return;
|
||||||
throw new Error('Could not get line');
|
|
||||||
}
|
}
|
||||||
let currentIndex = index;
|
this._horizontalScrollbar.getDomNode().remove();
|
||||||
let endSpaces = -1;
|
this._horizontalScrollbar.dispose();
|
||||||
for (let i = line?.length || 0; i > 0; i--) {
|
this._horizontalScrollbar = undefined;
|
||||||
if (line && !line?.getCell(i)?.getChars()) {
|
this._wrapperElement.remove();
|
||||||
endSpaces++;
|
this._wrapperElement.classList.remove('fixed-dims');
|
||||||
} else {
|
this._container.appendChild(this._wrapperElement);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (line?.isWrapped && currentIndex > 0) {
|
|
||||||
currentIndex--;
|
|
||||||
line = buffer.getLine(currentIndex);
|
|
||||||
}
|
|
||||||
return { lineCount: index - currentIndex + 1, currentIndex, endSpaces };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _setResolvedShellLaunchConfig(shellLaunchConfig: IShellLaunchConfig): void {
|
private _setResolvedShellLaunchConfig(shellLaunchConfig: IShellLaunchConfig): void {
|
||||||
|
@ -1782,8 +1781,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
||||||
|
|
||||||
async toggleEscapeSequenceLogging(): Promise<void> {
|
async toggleEscapeSequenceLogging(): Promise<void> {
|
||||||
const xterm = await this._xtermReadyPromise;
|
const xterm = await this._xtermReadyPromise;
|
||||||
const isDebug = xterm.raw.getOption('logLevel') === 'debug';
|
xterm.raw.options.logLevel = xterm.raw.options.logLevel === 'debug' ? 'info' : 'debug';
|
||||||
xterm.raw.setOption('logLevel', isDebug ? 'info' : 'debug');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getInitialCwd(): Promise<string> {
|
async getInitialCwd(): Promise<string> {
|
||||||
|
@ -2065,6 +2063,7 @@ export interface ITerminalLabelTemplateProperties {
|
||||||
process?: string | null | undefined;
|
process?: string | null | undefined;
|
||||||
sequence?: string | null | undefined;
|
sequence?: string | null | undefined;
|
||||||
task?: string | null | undefined;
|
task?: string | null | undefined;
|
||||||
|
fixedDimensions?: string | null | undefined;
|
||||||
separator?: string | ISeparator | null | undefined;
|
separator?: string | ISeparator | null | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2083,11 +2082,12 @@ export class TerminalLabelComputer extends Disposable {
|
||||||
readonly onDidChangeLabel = this._onDidChangeLabel.event;
|
readonly onDidChangeLabel = this._onDidChangeLabel.event;
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _configHelper: TerminalConfigHelper,
|
private readonly _configHelper: TerminalConfigHelper,
|
||||||
private readonly _instance: Pick<ITerminalInstance, 'shellLaunchConfig' | 'cwd' | 'initialCwd' | 'processName' | 'sequence' | 'userHome' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description'>,
|
private readonly _instance: Pick<ITerminalInstance, 'shellLaunchConfig' | 'cwd' | 'fixedCols' | 'fixedRows' | 'initialCwd' | 'processName' | 'sequence' | 'userHome' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description'>,
|
||||||
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService
|
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshLabel(): void {
|
refreshLabel(): void {
|
||||||
this._title = this.computeLabel(this._configHelper.config.tabs.title, TerminalLabelType.Title);
|
this._title = this.computeLabel(this._configHelper.config.tabs.title, TerminalLabelType.Title);
|
||||||
this._description = this.computeLabel(this._configHelper.config.tabs.description, TerminalLabelType.Description);
|
this._description = this.computeLabel(this._configHelper.config.tabs.description, TerminalLabelType.Description);
|
||||||
|
@ -2108,6 +2108,9 @@ export class TerminalLabelComputer extends Disposable {
|
||||||
process: this._instance.processName,
|
process: this._instance.processName,
|
||||||
sequence: this._instance.sequence,
|
sequence: this._instance.sequence,
|
||||||
task: this._instance.shellLaunchConfig.description === 'Task' ? 'Task' : undefined,
|
task: this._instance.shellLaunchConfig.description === 'Task' ? 'Task' : undefined,
|
||||||
|
fixedDimensions: this._instance.fixedCols
|
||||||
|
? (this._instance.fixedRows ? `\u2194${this._instance.fixedCols} \u2195${this._instance.fixedRows}` : `\u2194${this._instance.fixedCols}`)
|
||||||
|
: (this._instance.fixedRows ? `\u2195${this._instance.fixedRows}` : ''),
|
||||||
separator: { label: this._configHelper.config.tabs.separator }
|
separator: { label: this._configHelper.config.tabs.separator }
|
||||||
};
|
};
|
||||||
labelTemplate = labelTemplate.trim();
|
labelTemplate = labelTemplate.trim();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue