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

This commit is contained in:
Daniel Imms
2023-11-12 06:32:35 -08:00
511 changed files with 18384 additions and 9443 deletions
@@ -0,0 +1,30 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as eslint from 'eslint';
export = new class NoGlobalDocumentListener implements eslint.Rule.RuleModule {
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
return {
CallExpression(node: any) {
if (
(
node.callee.name === 'addDisposableListener' ||
node.callee.property?.name === 'addDisposableListener'
) &&
node.arguments.length > 0 &&
node.arguments[0].type === 'Identifier' &&
node.arguments[0].name === 'document'
) {
context.report({
node,
message: 'Use <targetWindow>.document to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.',
});
}
},
}
}
};
+303 -19
View File
@@ -48,25 +48,6 @@
"orientation",
"context"
], // non-complete list of globals that are easy to access unintentionally
"no-restricted-syntax": [
"warn",
{
"selector": "BinaryExpression[operator='instanceof'][right.name='MouseEvent']",
"message": "Use DOM.isMouseEvent() to support multi-window scenarios."
},
{
"selector": "BinaryExpression[operator='instanceof'][right.name='KeyboardEvent']",
"message": "Use DOM.isKeyboardEvent() to support multi-window scenarios."
},
{
"selector": "BinaryExpression[operator='instanceof'][right.name='PointerEvent']",
"message": "Use DOM.isPointerEvent() to support multi-window scenarios."
},
{
"selector": "BinaryExpression[operator='instanceof'][right.name='DragEvent']",
"message": "Use DOM.isDragEvent() to support multi-window scenarios."
}
],
"no-var": "warn",
"jsdoc/no-types": "warn",
"semi": "off",
@@ -275,6 +256,309 @@
"local/code-amd-node-module": "warn"
}
},
{
"files": [
"src/**/{browser,electron-sandbox}/*.ts"
],
"rules": {
"local/code-no-global-document-listener": "warn",
"no-restricted-syntax": [
"warn",
{
"selector": "BinaryExpression[operator='instanceof'][right.name='MouseEvent']",
"message": "Use DOM.isMouseEvent() to support multi-window scenarios."
},
{
"selector": "BinaryExpression[operator='instanceof'][right.name='KeyboardEvent']",
"message": "Use DOM.isKeyboardEvent() to support multi-window scenarios."
},
{
"selector": "BinaryExpression[operator='instanceof'][right.name='PointerEvent']",
"message": "Use DOM.isPointerEvent() to support multi-window scenarios."
},
{
"selector": "BinaryExpression[operator='instanceof'][right.name='DragEvent']",
"message": "Use DOM.isDragEvent() to support multi-window scenarios."
},
{
"selector": "MemberExpression[object.name='document'][property.name='activeElement']",
"message": "Use <targetWindow>.document.activeElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='contains']",
"message": "Use <targetWindow>.document.contains to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='styleSheets']",
"message": "Use <targetWindow>.document.styleSheets to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='fullscreenElement']",
"message": "Use <targetWindow>.document.fullscreenElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='body']",
"message": "Use <targetWindow>.document.body to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='addEventListener']",
"message": "Use <targetWindow>.document.addEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='removeEventListener']",
"message": "Use <targetWindow>.document.removeEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='hasFocus']",
"message": "Use <targetWindow>.document.hasFocus to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='head']",
"message": "Use <targetWindow>.document.head to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='exitFullscreen']",
"message": "Use <targetWindow>.document.exitFullscreen to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='getElementById']",
"message": "Use <targetWindow>.document.getElementById to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='getElementsByClassName']",
"message": "Use <targetWindow>.document.getElementsByClassName to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='getElementsByName']",
"message": "Use <targetWindow>.document.getElementsByName to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='getElementsByTagName']",
"message": "Use <targetWindow>.document.getElementsByTagName to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='getElementsByTagNameNS']",
"message": "Use <targetWindow>.document.getElementsByTagNameNS to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='getSelection']",
"message": "Use <targetWindow>.document.getSelection to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='open']",
"message": "Use <targetWindow>.document.open to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='close']",
"message": "Use <targetWindow>.document.close to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='documentElement']",
"message": "Use <targetWindow>.document.documentElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='visibilityState']",
"message": "Use <targetWindow>.document.visibilityState to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='querySelector']",
"message": "Use <targetWindow>.document.querySelector to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='querySelectorAll']",
"message": "Use <targetWindow>.document.querySelectorAll to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='elementFromPoint']",
"message": "Use <targetWindow>.document.elementFromPoint to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='elementsFromPoint']",
"message": "Use <targetWindow>.document.elementsFromPoint to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='onkeydown']",
"message": "Use <targetWindow>.document.onkeydown to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='onkeyup']",
"message": "Use <targetWindow>.document.onkeyup to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='onmousedown']",
"message": "Use <targetWindow>.document.onmousedown to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='onmouseup']",
"message": "Use <targetWindow>.document.onmouseup to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"selector": "MemberExpression[object.name='document'][property.name='execCommand']",
"message": "Use <targetWindow>.document.execCommand to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
}
],
"no-restricted-globals": [
"warn",
"name",
"length",
"event",
"closed",
"external",
"status",
"origin",
"orientation",
"context",
{
"name": "setInterval",
"message": "Use <targetWindow>.setInterval to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "clearInterval",
"message": "Use <targetWindow>.clearInterval to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "requestAnimationFrame",
"message": "Use <targetWindow>.requestAnimationFrame to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "cancelAnimationFrame",
"message": "Use <targetWindow>.cancelAnimationFrame to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "requestIdleCallback",
"message": "Use <targetWindow>.requestIdleCallback to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "cancelIdleCallback",
"message": "Use <targetWindow>.cancelIdleCallback to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "window",
"message": "Use <targetWindow> to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "addEventListener",
"message": "Use <targetWindow>.addEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "removeEventListener",
"message": "Use <targetWindow>.removeEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "getComputedStyle",
"message": "Use <targetWindow>.getComputedStyle to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "focus",
"message": "Use <targetWindow>.focus to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "blur",
"message": "Use <targetWindow>.blur to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "close",
"message": "Use <targetWindow>.close to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "dispatchEvent",
"message": "Use <targetWindow>.dispatchEvent to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "getSelection",
"message": "Use <targetWindow>.getSelection to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "matchMedia",
"message": "Use <targetWindow>.matchMedia to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "open",
"message": "Use <targetWindow>.open to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "parent",
"message": "Use <targetWindow>.parent to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "postMessage",
"message": "Use <targetWindow>.postMessage to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "devicePixelRatio",
"message": "Use <targetWindow>.devicePixelRatio to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "frames",
"message": "Use <targetWindow>.frames to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "frameElement",
"message": "Use <targetWindow>.frameElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "innerHeight",
"message": "Use <targetWindow>.innerHeight to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "innerWidth",
"message": "Use <targetWindow>.innerWidth to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "outerHeight",
"message": "Use <targetWindow>.outerHeight to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "outerWidth",
"message": "Use <targetWindow>.outerWidth to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "opener",
"message": "Use <targetWindow>.opener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "origin",
"message": "Use <targetWindow>.origin to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "screen",
"message": "Use <targetWindow>.screen to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "screenLeft",
"message": "Use <targetWindow>.screenLeft to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "screenTop",
"message": "Use <targetWindow>.screenTop to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "screenX",
"message": "Use <targetWindow>.screenX to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "screenY",
"message": "Use <targetWindow>.screenY to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "scrollX",
"message": "Use <targetWindow>.scrollX to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "scrollY",
"message": "Use <targetWindow>.scrollY to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "top",
"message": "Use <targetWindow>.top to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
},
{
"name": "visualViewport",
"message": "Use <targetWindow>.visualViewport to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant."
}
]
}
},
{
"files": [
"src/**/*.ts"
+7
View File
@@ -58,6 +58,13 @@
"reason": "not_planned",
"comment": "We closed this issue because we [don't plan to address it](https://aka.ms/vscode-out-of-scope) in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.\n\nIf you wonder what we are up to, please see our [roadmap](https://aka.ms/vscoderoadmap) and [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nThanks for your understanding, and happy coding!"
},
{
"type": "label",
"name": "wont-fix",
"action": "close",
"reason": "not_planned",
"comment": "We closed this issue because we [don't plan to address it](https://github.com/microsoft/vscode/wiki/Issue-Grooming#wont-fix-bugs).\n\nThanks for your understanding, and happy coding!"
},
{
"type": "comment",
"name": "causedByExtension",
+3 -1
View File
@@ -47,7 +47,9 @@ jobs:
restore-keys: ${{ runner.os }}-yarnCacheDir-
- name: Install libkrb5-dev
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: sudo apt install -y libkrb5-dev
run: |
sudo apt update
sudo apt install -y libkrb5-dev
- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
+10 -1
View File
@@ -164,5 +164,14 @@
"vscode-notebook-renderer",
"src/vs/workbench/workbench.web.main.ts",
"src/vs/workbench/api/common/extHostTypes.ts"
]
],
// Temporarily enabled for self-hosting
"terminal.integrated.enableStickyScroll": true,
// Temporarily enabled for self-hosting
"scm.experimental.showSyncInformation": {
"incoming": true,
"outgoing": true
}
}
@@ -151,6 +151,10 @@ steps:
- script: yarn gulp compile-extension:markdown-language-features compile-extension-media compile-extension:vscode-test-resolver
displayName: Build extensions for smoke tests
- script: yarn gulp node
displayName: Download node.js for remote smoke tests
retryCountOnTaskFailure: 3
- script: yarn smoketest-no-compile --tracing
timeoutInMinutes: 20
displayName: Run smoke tests (Electron)
+4
View File
@@ -74,6 +74,10 @@
"name": "vs/workbench/contrib/dialogs",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/multiDiffEditor",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/emmet",
"project": "vscode-workbench"
File diff suppressed because one or more lines are too long
+28
View File
@@ -102,6 +102,23 @@ const RULES: IRule[] = [
]
},
// Common: vs/base/common/async.ts
{
target: '**/vs/base/common/async.ts',
allowedTypes: [
...CORE_TYPES,
// Safe access to requestIdleCallback & cancelIdleCallback
'requestIdleCallback',
'cancelIdleCallback'
],
disallowedTypes: NATIVE_TYPES,
disallowedDefinitions: [
'lib.dom.d.ts', // no DOM
'@types/node' // no node.js
]
},
// Common: vs/platform/environment/common/*
{
target: '**/vs/platform/environment/common/*.ts',
@@ -135,6 +152,17 @@ const RULES: IRule[] = [
]
},
// Common: vs/platform/native/common/nativeHostService.ts
{
target: '**/vs/platform/native/common/nativeHostService.ts',
allowedTypes: CORE_TYPES,
disallowedTypes: [/* Ignore native types that are defined from here */],
disallowedDefinitions: [
'lib.dom.d.ts', // no DOM
'@types/node' // no node.js
]
},
// Common: vs/workbench/api/common/extHostExtensionService.ts
{
target: '**/vs/workbench/api/common/extHostExtensionService.ts',
@@ -109,6 +109,7 @@
"--vscode-diffEditor-unchangedCodeBackground",
"--vscode-diffEditor-unchangedRegionBackground",
"--vscode-diffEditor-unchangedRegionForeground",
"--vscode-diffEditor-unchangedRegionShadow",
"--vscode-diffEditorGutter-insertedLineBackground",
"--vscode-diffEditorGutter-removedLineBackground",
"--vscode-diffEditorOverview-insertedForeground",
@@ -179,6 +180,7 @@
"--vscode-editorCodeLens-foreground",
"--vscode-editorCommentsWidget-rangeActiveBackground",
"--vscode-editorCommentsWidget-rangeBackground",
"--vscode-editorCommentsWidget-replyButtonBackground",
"--vscode-editorCommentsWidget-resolvedBorder",
"--vscode-editorCommentsWidget-unresolvedBorder",
"--vscode-editorCursor-background",
@@ -417,6 +419,7 @@
"--vscode-minimapSlider-activeBackground",
"--vscode-minimapSlider-background",
"--vscode-minimapSlider-hoverBackground",
"--vscode-multiDiffEditor-headerBackground",
"--vscode-notebook-cellBorderColor",
"--vscode-notebook-cellEditorBackground",
"--vscode-notebook-cellHoverBackground",
@@ -665,6 +668,8 @@
"--vscode-terminalCursor-foreground",
"--vscode-terminalOverviewRuler-cursorForeground",
"--vscode-terminalOverviewRuler-findMatchForeground",
"--vscode-terminalStickyScroll-background",
"--vscode-terminalStickyScrollHover-background",
"--vscode-testing-iconErrored",
"--vscode-testing-iconFailed",
"--vscode-testing-iconPassed",
@@ -784,4 +789,4 @@
"--z-index-notebook-sticky-scroll",
"--zoom-factor"
]
}
}
+26 -3
View File
@@ -32,6 +32,7 @@ use opentelemetry::KeyValue;
use std::collections::HashMap;
use std::path::PathBuf;
use std::process::Stdio;
use tokio::net::TcpStream;
use tokio::pin;
use tokio::process::{ChildStderr, ChildStdin};
use tokio_util::codec::Decoder;
@@ -55,9 +56,9 @@ use super::protocol::{
ChallengeIssueResponse, ChallengeVerifyParams, ClientRequestMethod, EmptyObject, ForwardParams,
ForwardResult, FsReadDirEntry, FsReadDirResponse, FsRenameRequest, FsSinglePathRequest,
FsStatResponse, GetEnvResponse, GetHostnameResponse, HttpBodyParams, HttpHeadersParams,
ServeParams, ServerLog, ServerMessageParams, SpawnParams, SpawnResult, SysKillRequest,
SysKillResponse, ToClientRequest, UnforwardParams, UpdateParams, UpdateResult, VersionResponse,
METHOD_CHALLENGE_VERIFY,
NetConnectRequest, ServeParams, ServerLog, ServerMessageParams, SpawnParams, SpawnResult,
SysKillRequest, SysKillResponse, ToClientRequest, UnforwardParams, UpdateParams, UpdateResult,
VersionResponse, METHOD_CHALLENGE_VERIFY,
};
use super::server_bridge::ServerBridge;
use super::server_multiplexer::ServerMultiplexer;
@@ -341,6 +342,14 @@ fn make_socket_rpc(
handle_fs_connect(streams.remove(0), p.path).await
},
);
rpc.register_duplex(
"net_connect",
1,
move |mut streams, n: NetConnectRequest, c| async move {
ensure_auth(&c.auth_state)?;
handle_net_connect(streams.remove(0), n).await
},
);
rpc.register_async("fs_rm", move |p: FsSinglePathRequest, c| async move {
ensure_auth(&c.auth_state)?;
handle_fs_remove(p.path).await
@@ -896,6 +905,20 @@ async fn handle_fs_write(mut input: DuplexStream, path: String) -> Result<EmptyO
Ok(EmptyObject {})
}
async fn handle_net_connect(
mut stream: DuplexStream,
req: NetConnectRequest,
) -> Result<EmptyObject, AnyError> {
let mut s = TcpStream::connect((req.host, req.port))
.await
.map_err(|e| wrap(e, "could not connect to address"))?;
tokio::io::copy_bidirectional(&mut stream, &mut s)
.await
.map_err(|e| wrap(e, "error copying stream data"))?;
Ok(EmptyObject {})
}
async fn handle_fs_connect(
mut stream: DuplexStream,
path: String,
+7
View File
@@ -209,6 +209,13 @@ pub struct FsRenameRequest {
pub to_path: String,
}
/// Method: `net_connect`. Connects to a port.
#[derive(Deserialize)]
pub struct NetConnectRequest {
pub port: u16,
pub host: String,
}
#[derive(Deserialize, Debug)]
pub struct CallServerHttpParams {
pub path: String,
@@ -10,11 +10,11 @@
"properties": {
"extensions": {
"type": "array",
"description": "An array of extensions that should be installed into the container.",
"description": "An array of extensions that should be installed into the container. A minus '-' in front of the extension id removes it from the list of extensions to be installed.",
"items": {
"type": "string",
"pattern": "^([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)((@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)|@prerelease)?$",
"errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
"pattern": "^-?([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)((@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)|@prerelease)?$",
"errorMessage": "Expected format: '${publisher}.${name}', '-${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
}
},
"settings": {
@@ -31,11 +31,11 @@
},
"extensions": {
"type": "array",
"description": "An array of extensions that should be installed into the container.",
"description": "An array of extensions that should be installed into the container. A minus '-' in front of the extension id removes it from the list of extensions to be installed.",
"items": {
"type": "string",
"pattern": "^([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)((@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)|@prerelease)?$",
"errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
"pattern": "^-?([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)((@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)|@prerelease)?$",
"errorMessage": "Expected format: '${publisher}.${name}', '-${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
},
"deprecated": true,
"deprecationMessage": "Use 'customizations/vscode/extensions' instead"
@@ -54,6 +54,7 @@ function registerVariableCompletions(pattern: string): vscode.Disposable {
return [
{ label: 'workspaceFolder', detail: vscode.l10n.t("The path of the folder opened in VS Code") },
{ label: 'workspaceFolderBasename', detail: vscode.l10n.t("The name of the folder opened in VS Code without any slashes (/)") },
{ label: 'fileWorkspaceFolderBasename', detail: vscode.l10n.t("The current opened file workspace folder name without any slashes (/)") },
{ label: 'relativeFile', detail: vscode.l10n.t("The current opened file relative to ${workspaceFolder}") },
{ label: 'relativeFileDirname', detail: vscode.l10n.t("The current opened file's dirname relative to ${workspaceFolder}") },
{ label: 'file', detail: vscode.l10n.t("The current opened file") },
+51 -1
View File
@@ -694,6 +694,12 @@
"title": "%command.timelineCompareWithSelected%",
"category": "Git"
},
{
"command": "git.timeline.openCommit",
"title": "%command.timelineOpenCommit%",
"icon": "$(wand)",
"category": "Git"
},
{
"command": "git.rebaseAbort",
"title": "%command.rebaseAbort%",
@@ -753,6 +759,18 @@
"command": "git.openRepositoriesInParentFolders",
"title": "%command.openRepositoriesInParentFolders%",
"category": "Git"
},
{
"command": "git.viewChanges",
"title": "View Changes",
"icon": "$(search)",
"category": "Git"
},
{
"command": "git.viewStagedChanges",
"title": "View Staged Changes",
"icon": "$(search)",
"category": "Git"
}
],
"continueEditSession": [
@@ -1197,6 +1215,10 @@
"command": "git.timeline.compareWithSelected",
"when": "false"
},
{
"command": "git.timeline.openCommit",
"when": "false"
},
{
"command": "git.closeAllDiffEditors",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
@@ -1224,6 +1246,14 @@
{
"command": "git.openRepositoriesInParentFolders",
"when": "config.git.enabled && !git.missing && git.parentRepositoryCount != 0"
},
{
"command": "git.viewChanges",
"when": "false"
},
{
"command": "git.viewStagedChanges",
"when": "false"
}
],
"scm/title": [
@@ -1390,6 +1420,16 @@
"command": "git.stageAllUntracked",
"when": "scmProvider == git && scmResourceGroup == untracked",
"group": "inline@2"
},
{
"command": "git.viewStagedChanges",
"when": "scmProvider == git && scmResourceGroup == index",
"group": "inline@1"
},
{
"command": "git.viewChanges",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline@1"
}
],
"scm/resourceFolder/context": [
@@ -1767,11 +1807,21 @@
}
],
"timeline/item/context": [
{
"command": "git.timeline.openCommit",
"group": "inline",
"when": "config.git.enabled && !git.missing && timelineItem =~ /git:file:commit\\b/ && !listMultiSelection"
},
{
"command": "git.timeline.openDiff",
"group": "1_actions",
"group": "1_actions@1",
"when": "config.git.enabled && !git.missing && timelineItem =~ /git:file\\b/ && !listMultiSelection"
},
{
"command": "git.timeline.openCommit",
"group": "1_actions@2",
"when": "config.git.enabled && !git.missing && timelineItem =~ /git:file:commit\\b/ && !listMultiSelection"
},
{
"command": "git.timeline.compareWithSelected",
"group": "3_compare@1",
+1
View File
@@ -104,6 +104,7 @@
"command.stashDrop": "Drop Stash...",
"command.stashDropAll": "Drop All Stashes...",
"command.timelineOpenDiff": "Open Changes",
"command.timelineOpenCommit": "Open Commit",
"command.timelineCopyCommitId": "Copy Commit ID",
"command.timelineCopyCommitMessage": "Copy Commit Message",
"command.timelineSelectForCompare": "Select for Compare",
+68
View File
@@ -3426,6 +3426,54 @@ export class CommandCenter {
};
}
@command('git.timeline.openCommit', { repository: false })
async timelineOpenCommit(item: TimelineItem, uri: Uri | undefined, _source: string) {
console.log('timelineOpenCommit', item);
if (!GitTimelineItem.is(item)) {
return;
}
const cmd = await this._resolveTimelineOpenCommitCommand(
item, uri,
{
preserveFocus: true,
preview: true,
viewColumn: ViewColumn.Active
},
);
if (cmd === undefined) {
return undefined;
}
return commands.executeCommand(cmd.command, ...(cmd.arguments ?? []));
}
private async _resolveTimelineOpenCommitCommand(item: TimelineItem, uri: Uri | undefined, options?: TextDocumentShowOptions): Promise<Command | undefined> {
if (uri === undefined || uri === null || !GitTimelineItem.is(item)) {
return undefined;
}
const repository = await this.model.getRepository(uri.fsPath);
if (!repository) {
return undefined;
}
const commit = await repository.getCommit(item.ref);
const commitFiles = await repository.getCommitFiles(item.ref);
const args: [Uri, Uri | undefined, Uri | undefined][] = [];
for (const commitFile of commitFiles) {
const commitFileUri = Uri.file(path.join(repository.root, commitFile));
args.push([commitFileUri, toGitUri(commitFileUri, item.previousRef), toGitUri(commitFileUri, item.ref)]);
}
return {
command: 'vscode.changes',
title: l10n.t('Open Commit'),
arguments: [`${item.shortRef} - ${commit.message}`, args, options]
};
}
@command('git.timeline.copyCommitId', { repository: false })
async timelineCopyCommitId(item: TimelineItem, _uri: Uri | undefined, _source: string) {
if (!GitTimelineItem.is(item)) {
@@ -3603,6 +3651,26 @@ export class CommandCenter {
repository.generateCommitMessageCancel();
}
@command('git.viewChanges', { repository: true })
viewChanges(repository: Repository): void {
this._viewChanges('Changes', repository.workingTreeGroup.resourceStates);
}
@command('git.viewStagedChanges', { repository: true })
viewStagedChanges(repository: Repository): void {
this._viewChanges('Staged Changes', repository.indexGroup.resourceStates);
}
private _viewChanges(title: string, resources: Resource[]): void {
const args: [Uri, Uri | undefined, Uri | undefined][] = [];
for (const resource of resources) {
args.push([resource.resourceUri, resource.leftUri, resource.rightUri]);
}
commands.executeCommand('vscode.changes', title, args);
}
private createCommand(id: string, key: string, method: Function, options: ScmCommandOptions): (...args: any[]) => any {
const result = (...args: any[]) => {
let result: Promise<any>;
+16 -3
View File
@@ -1316,15 +1316,23 @@ export class Repository {
return result.stdout.trim();
}
async diffBetweenShortStat(ref1: string, ref2: string): Promise<string> {
async diffBetweenShortStat(ref1: string, ref2: string): Promise<{ files: number; insertions: number; deletions: number }> {
const args = ['diff', '--shortstat', `${ref1}...${ref2}`];
const result = await this.exec(args);
if (result.exitCode) {
return '';
return { files: 0, insertions: 0, deletions: 0 };
}
return result.stdout.trim();
const regex = /(\d+) files? changed(?:, (\d+) insertions\(\+\))?(?:, (\d+) deletions\(-\))?/;
const matches = result.stdout.trim().match(regex);
if (!matches) {
return { files: 0, insertions: 0, deletions: 0 };
}
const [, files, insertions = undefined, deletions = undefined] = matches;
return { files: parseInt(files), insertions: parseInt(insertions ?? '0'), deletions: parseInt(deletions ?? '0') };
}
private async diffFiles(cached: boolean, ref?: string): Promise<Change[]> {
@@ -2552,6 +2560,11 @@ export class Repository {
return commits[0];
}
async getCommitFiles(ref: string): Promise<string[]> {
const result = await this.exec(['diff-tree', '--no-commit-id', '--name-only', '-r', ref]);
return result.stdout.split('\n').filter(l => !!l);
}
async getCommitCount(range: string): Promise<{ ahead: number; behind: number }> {
const result = await this.exec(['rev-list', '--count', '--left-right', range]);
const [ahead, behind] = result.stdout.trim().split('\t');
+7 -4
View File
@@ -10,6 +10,7 @@ import { IDisposable } from './util';
import { toGitUri } from './uri';
import { SyncActionButton } from './actionButton';
import { RefType, Status } from './api/git';
import { emojify, ensureEmojis } from './emoji';
export class GitHistoryProvider implements SourceControlHistoryProvider, FileDecorationProvider, IDisposable {
@@ -83,6 +84,8 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
this.getSummaryHistoryItem(optionsRef, historyItemGroupIdRef)
]);
await ensureEmojis();
const historyItems = commits.length === 0 ? [] : [summary];
historyItems.push(...commits.map(commit => {
const newLineIndex = commit.message.indexOf('\n');
@@ -91,9 +94,9 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
return {
id: commit.hash,
parentIds: commit.parents,
label: subject,
label: emojify(subject),
description: commit.authorName,
icon: new ThemeIcon('account'),
icon: new ThemeIcon('git-commit'),
timestamp: commit.authorDate?.getTime()
};
}));
@@ -192,8 +195,8 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
}
private async getSummaryHistoryItem(ref1: string, ref2: string): Promise<SourceControlHistoryItem> {
const diffShortStat = await this.repository.diffBetweenShortStat(ref1, ref2);
return { id: `${ref1}..${ref2}`, parentIds: [], icon: new ThemeIcon('files'), label: l10n.t('All Changes'), description: diffShortStat };
const statistics = await this.repository.diffBetweenShortStat(ref1, ref2);
return { id: `${ref1}..${ref2}`, parentIds: [], icon: new ThemeIcon('files'), label: l10n.t('All Changes'), statistics };
}
dispose(): void {
+1 -1
View File
@@ -137,7 +137,7 @@ export const Operation = {
CheckoutTracking: (refLabel: string) => ({ kind: OperationKind.CheckoutTracking, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true, refLabel } as CheckoutTrackingOperation),
Clean: (showProgress: boolean) => ({ kind: OperationKind.Clean, blocking: false, readOnly: false, remote: false, retry: false, showProgress } as CleanOperation),
Commit: { kind: OperationKind.Commit, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true } as CommitOperation,
Config: { kind: OperationKind.Config, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as ConfigOperation,
Config: (readOnly: boolean) => ({ kind: OperationKind.Config, blocking: false, readOnly, remote: false, retry: false, showProgress: true } as ConfigOperation),
DeleteBranch: { kind: OperationKind.DeleteBranch, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as DeleteBranchOperation,
DeleteRef: { kind: OperationKind.DeleteRef, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as DeleteRefOperation,
DeleteRemoteTag: { kind: OperationKind.DeleteRemoteTag, blocking: false, readOnly: false, remote: true, retry: false, showProgress: true } as DeleteRemoteTagOperation,
+9 -5
View File
@@ -1113,19 +1113,19 @@ export class Repository implements Disposable {
}
getConfigs(): Promise<{ key: string; value: string }[]> {
return this.run(Operation.Config, () => this.repository.getConfigs('local'));
return this.run(Operation.Config(true), () => this.repository.getConfigs('local'));
}
getConfig(key: string): Promise<string> {
return this.run(Operation.Config, () => this.repository.config('local', key));
return this.run(Operation.Config(true), () => this.repository.config('local', key));
}
getGlobalConfig(key: string): Promise<string> {
return this.run(Operation.Config, () => this.repository.config('global', key));
return this.run(Operation.Config(true), () => this.repository.config('global', key));
}
setConfig(key: string, value: string): Promise<string> {
return this.run(Operation.Config, () => this.repository.config('local', key, value));
return this.run(Operation.Config(false), () => this.repository.config('local', key, value));
}
log(options?: LogOptions): Promise<Commit[]> {
@@ -1185,7 +1185,7 @@ export class Repository implements Disposable {
return this.run(Operation.Diff, () => this.repository.diffBetween(ref1, ref2, path));
}
diffBetweenShortStat(ref1: string, ref2: string): Promise<string> {
diffBetweenShortStat(ref1: string, ref2: string): Promise<{ files: number; insertions: number; deletions: number }> {
return this.run(Operation.Diff, () => this.repository.diffBetweenShortStat(ref1, ref2));
}
@@ -1658,6 +1658,10 @@ export class Repository implements Disposable {
return await this.repository.getCommit(ref);
}
async getCommitFiles(ref: string): Promise<string[]> {
return await this.repository.getCommitFiles(ref);
}
async getCommitCount(range: string): Promise<{ ahead: number; behind: number }> {
return await this.run(Operation.RevList, () => this.repository.getCommitCount(range));
}
+2
View File
@@ -139,6 +139,8 @@ function convertJupyterOutputToBuffer(mime: string, value: unknown): NotebookCel
}
} else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
return NotebookCellOutputItem.text(JSON.stringify(value), mime);
} else if (mime === 'application/json') {
return NotebookCellOutputItem.json(value, mime);
} else {
// For everything else, treat the data as strings (or multi-line strings).
value = Array.isArray(value) ? concatMultilineString(value) : value;
+19
View File
@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
var updateGrammar = require('vscode-grammar-updater');
function adaptLess(grammar) {
grammar.name = 'Less';
grammar.scopeName = 'source.css.less';
}
async function updateGrammars() {
await updateGrammar.update('radium-v/Better-Less', 'Syntaxes/Better%20Less.tmLanguage', './syntaxes/less.tmLanguage.json', adaptLess, 'master');
}
updateGrammars();
+3 -3
View File
@@ -5,12 +5,12 @@
"type": "git",
"git": {
"name": "language-less",
"repositoryUrl": "https://github.com/atom/language-less",
"commitHash": "87d4d59e8de6796b506b81a16e1dc1fafc99d30f"
"repositoryUrl": "https://github.com/radium-v/Better-Less",
"commitHash": "05de79f600227201e35f07a49f07acce80e49dbf"
}
},
"license": "MIT",
"version": "0.34.2"
"version": "0.6.1"
}
],
"version": 1
+1 -1
View File
@@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-less grammars/less.cson ./syntaxes/less.tmLanguage.json"
"update-grammar": "node ./build/update-grammar.js"
},
"contributes": {
"languages": [
File diff suppressed because one or more lines are too long
@@ -31,7 +31,7 @@ export function formatStackTrace(stack: string) {
const formatSequence = /\u001b\[.+?m/g;
const fileRegex = /File\s+(?:\u001b\[.+?m)?(.+):(\d+)/;
const lineNumberRegex = /((?:\u001b\[.+?m)?[ ->]*?)(\d+)(.*)/;
const lineNumberRegex = /^((?:\u001b\[.+?m)?[ \->]+?)(\d+)(?:\u001b\[0m)?( .*)/;
const cellRegex = /(?<prefix>Cell\s+(?:\u001b\[.+?m)?In\s*\[(?<executionCount>\d+)\],\s*)(?<lineLabel>line (?<lineNumber>\d+)).*/;
// older versions of IPython ~8.3.0
const inputRegex = /(?<prefix>Input\s+?(?:\u001b\[.+?m)(?<cellLabel>In\s*\[(?<executionCount>\d+)\]))(?<postfix>.*)/;
@@ -41,7 +41,7 @@ function isIpythonStackTrace(stack: string) {
}
function stripFormatting(text: string) {
return text.replace(formatSequence, '');
return text.replace(formatSequence, '').trim();
}
type cellLocation = { kind: 'cell'; path: string };
@@ -43,8 +43,6 @@ suite('StackTraceHelper', () => {
assert.ok(formatted.indexOf('<a href=\'C:\\venvs\\myLib.py:2\'>2</a>') > 0, 'Missing frame link in ' + formatted);
});
test('IPython stack line numbers are linkified for IPython 8.3', () => {
// stack frames within functions do not list the line number, i.e.
// 'Input In [1], in myfunc()' vs
@@ -88,4 +86,20 @@ suite('StackTraceHelper', () => {
assert.ok(!/<a href=.*>\d<\/a>/.test(formatted), formatted);
});
test('IPython stack without line numbers are not linkified', () => {
const stack =
'\u001b[1;36m Cell \u001b[1;32mIn[6], line 1\u001b[1;36m\u001b[0m\n' +
'\u001b[1;33m print(\u001b[0m\n' +
'\u001b[1;37m ^\u001b[0m\n' +
'\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m incomplete input\n' +
// contrived examples to check for more false positives
'1 print(\n' +
'a 1 print(\n' +
' 1a print(\n';
const formattedLines = formatStackTrace(stack).split('\n');
assert.ok(/<a href='vscode-notebook-cell.*>/.test(formattedLines[0]), 'line should contain a link: ' + formattedLines[0]);
formattedLines.slice(1).forEach(line => assert.ok(!/<a href=.*>/.test(line), 'line should not contain a link: ' + line));
});
});
+1 -1
View File
@@ -4,7 +4,7 @@
"license": "MIT",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "^5.2.2"
"typescript": "^5.3.1-rc"
},
"scripts": {
"postinstall": "node ./postinstall.mjs"
+10 -6
View File
@@ -6,8 +6,8 @@
"editor.background": "#1E1E1E",
"editor.foreground": "#D4D4D4",
"editor.inactiveSelectionBackground": "#3A3D41",
"editorIndentGuide.background": "#404040",
"editorIndentGuide.activeBackground": "#707070",
"editorIndentGuide.background1": "#404040",
"editorIndentGuide.activeBackground1": "#707070",
"editor.selectionHighlightBackground": "#ADD6FF26",
"list.dropBackground": "#383B3D",
"activityBarBadge.background": "#007ACC",
@@ -94,7 +94,10 @@
}
},
{
"scope": "entity.name.tag.css",
"scope": [
"entity.name.tag.css",
"entity.name.tag.less"
],
"settings": {
"foreground": "#d7ba7d"
}
@@ -108,10 +111,11 @@
{
"scope": [
"entity.other.attribute-name.class.css",
"entity.other.attribute-name.class.mixin.css",
"source.css entity.other.attribute-name.class",
"entity.other.attribute-name.id.css",
"entity.other.attribute-name.parent-selector.css",
"entity.other.attribute-name.pseudo-class.css",
"entity.other.attribute-name.parent.less",
"source.css entity.other.attribute-name.pseudo-class",
"entity.other.attribute-name.pseudo-element.css",
"source.css.less entity.other.attribute-name.id",
"entity.other.attribute-name.scss"
@@ -308,7 +312,7 @@
"support.type.property-name",
"variable.css",
"variable.scss",
"variable.other.less",
"source.css.less variable.other",
"source.coffee.embedded"
],
"settings": {
+10 -6
View File
@@ -4,8 +4,8 @@
"colors": {
"editor.background": "#000000",
"editor.foreground": "#FFFFFF",
"editorIndentGuide.background": "#FFFFFF",
"editorIndentGuide.activeBackground": "#FFFFFF",
"editorIndentGuide.background1": "#FFFFFF",
"editorIndentGuide.activeBackground1": "#FFFFFF",
"sideBarTitle.foreground": "#FFFFFF",
"selection.background": "#008000",
"editor.selectionBackground": "#FFFFFF",
@@ -86,7 +86,10 @@
}
},
{
"scope": "entity.name.tag.css",
"scope": [
"entity.name.tag.css",
"entity.name.tag.less"
],
"settings": {
"foreground": "#d7ba7d"
}
@@ -100,10 +103,11 @@
{
"scope": [
"entity.other.attribute-name.class.css",
"entity.other.attribute-name.class.mixin.css",
"source.css entity.other.attribute-name.class",
"entity.other.attribute-name.id.css",
"entity.other.attribute-name.parent-selector.css",
"entity.other.attribute-name.pseudo-class.css",
"entity.other.attribute-name.parent.less",
"source.css entity.other.attribute-name.pseudo-class",
"entity.other.attribute-name.pseudo-element.css",
"source.css.less entity.other.attribute-name.id",
"entity.other.attribute-name.scss"
@@ -268,7 +272,7 @@
"support.type.property-name",
"variable.css",
"variable.scss",
"variable.other.less",
"source.css.less variable.other",
"source.coffee.embedded"
],
"settings": {
@@ -80,10 +80,11 @@
{
"scope": [
"entity.other.attribute-name.class.css",
"entity.other.attribute-name.class.mixin.css",
"source.css entity.other.attribute-name.class",
"entity.other.attribute-name.id.css",
"entity.other.attribute-name.parent-selector.css",
"entity.other.attribute-name.pseudo-class.css",
"entity.other.attribute-name.parent.less",
"source.css entity.other.attribute-name.pseudo-class",
"entity.other.attribute-name.pseudo-element.css",
"source.css.less entity.other.attribute-name.id",
"entity.other.attribute-name.scss"
@@ -281,7 +282,7 @@
"support.type.property-name",
"variable.css",
"variable.scss",
"variable.other.less",
"source.css.less variable.other",
"source.coffee.embedded"
],
"settings": {
@@ -38,7 +38,7 @@
"editorGutter.addedBackground": "#2EA043",
"editorGutter.deletedBackground": "#F85149",
"editorGutter.modifiedBackground": "#005FB8",
"editorIndentGuide.background": "#D3D3D3",
"editorIndentGuide.background1": "#D3D3D3",
"editorLineNumber.activeForeground": "#171184",
"editorLineNumber.foreground": "#6E7681",
"editorOverviewRuler.border": "#E5E5E5",
@@ -6,8 +6,8 @@
"editor.background": "#FFFFFF",
"editor.foreground": "#000000",
"editor.inactiveSelectionBackground": "#E5EBF1",
"editorIndentGuide.background": "#D3D3D3",
"editorIndentGuide.activeBackground": "#939393",
"editorIndentGuide.background1": "#D3D3D3",
"editorIndentGuide.activeBackground1": "#939393",
"editor.selectionHighlightBackground": "#ADD6FF80",
"editorSuggestWidget.background": "#F3F3F3",
"activityBarBadge.background": "#007ACC",
@@ -114,10 +114,11 @@
{
"scope": [
"entity.other.attribute-name.class.css",
"entity.other.attribute-name.class.mixin.css",
"source.css entity.other.attribute-name.class",
"entity.other.attribute-name.id.css",
"entity.other.attribute-name.parent-selector.css",
"entity.other.attribute-name.pseudo-class.css",
"entity.other.attribute-name.parent.less",
"source.css entity.other.attribute-name.pseudo-class",
"entity.other.attribute-name.pseudo-element.css",
"source.css.less entity.other.attribute-name.id",
"entity.other.attribute-name.scss"
@@ -329,7 +330,7 @@
"support.type.property-name",
"variable.css",
"variable.scss",
"variable.other.less",
"source.css.less variable.other",
"source.coffee.embedded"
],
"settings": {
@@ -252,7 +252,8 @@
"meta.selector",
"meta.selector entity",
"meta.selector entity punctuation",
"entity.name.tag.css"
"entity.name.tag.css",
"entity.name.tag.less"
],
"settings": {
"foreground": "#7A3E9D"
@@ -140,7 +140,10 @@
},
{
"name": "Keyword, Storage",
"scope": "keyword, storage, storage.type, entity.name.tag.css",
"scope": [
"keyword, storage, storage.type, entity.name.tag.css",
"entity.name.tag.less"
],
"settings": {
"fontStyle": "",
"foreground": "#EBBBFF"
@@ -13,6 +13,7 @@ import * as typeConverters from '../../typeConverters';
import { ClientCapability, ITypeScriptServiceClient } from '../../typescriptService';
import { conditionalRegistration, requireGlobalConfiguration, requireSomeCapability } from '../util/dependentRegistration';
import { ReferencesCodeLens, TypeScriptBaseCodeLensProvider, getSymbolRange } from './baseCodeLensProvider';
import { ExecutionTarget } from '../../tsServer/server';
export default class TypeScriptImplementationsCodeLensProvider extends TypeScriptBaseCodeLensProvider {
@@ -22,7 +23,11 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
token: vscode.CancellationToken,
): Promise<vscode.CodeLens> {
const args = typeConverters.Position.toFileLocationRequestArgs(codeLens.file, codeLens.range.start);
const response = await this.client.execute('implementation', args, token, { lowPriority: true, cancelOnResourceChange: codeLens.document });
const response = await this.client.execute('implementation', args, token, {
lowPriority: true,
executionTarget: ExecutionTarget.Semantic,
cancelOnResourceChange: codeLens.document,
});
if (response.type !== 'response' || !response.body) {
codeLens.command = response.type === 'cancelled'
? TypeScriptBaseCodeLensProvider.cancelledCommand
@@ -17,9 +17,16 @@ function mapChildren<R>(node: jsonc.Node | undefined, f: (x: jsonc.Node) => R):
}
const openExtendsLinkCommandId = '_typescript.openExtendsLink';
enum TsConfigLinkType {
Extends,
References
}
type OpenExtendsLinkCommandArgs = {
readonly resourceUri: vscode.Uri;
readonly extendsValue: string;
readonly linkType: TsConfigLinkType;
};
@@ -43,7 +50,7 @@ class TsconfigLinkProvider implements vscode.DocumentLinkProvider {
private getExtendsLink(document: vscode.TextDocument, root: jsonc.Node): vscode.DocumentLink | undefined {
const node = jsonc.findNodeAtLocation(root, ['extends']);
return node && this.tryCreateTsConfigLink(document, node);
return node && this.tryCreateTsConfigLink(document, node, TsConfigLinkType.Extends);
}
private getReferencesLinks(document: vscode.TextDocument, root: jsonc.Node) {
@@ -51,18 +58,19 @@ class TsconfigLinkProvider implements vscode.DocumentLinkProvider {
jsonc.findNodeAtLocation(root, ['references']),
child => {
const pathNode = jsonc.findNodeAtLocation(child, ['path']);
return pathNode && this.tryCreateTsConfigLink(document, pathNode);
return pathNode && this.tryCreateTsConfigLink(document, pathNode, TsConfigLinkType.References);
});
}
private tryCreateTsConfigLink(document: vscode.TextDocument, node: jsonc.Node): vscode.DocumentLink | undefined {
private tryCreateTsConfigLink(document: vscode.TextDocument, node: jsonc.Node, linkType: TsConfigLinkType): vscode.DocumentLink | undefined {
if (!this.isPathValue(node)) {
return undefined;
}
const args: OpenExtendsLinkCommandArgs = {
resourceUri: { ...document.uri.toJSON(), $mid: undefined },
extendsValue: node.value
extendsValue: node.value,
linkType
};
const link = new vscode.DocumentLink(
@@ -148,17 +156,18 @@ async function resolveNodeModulesPath(baseDirUri: vscode.Uri, pathCandidates: st
}
}
// Reference: https://github.com/microsoft/TypeScript/blob/febfd442cdba343771f478cf433b0892f213ad2f/src/compiler/commandLineParser.ts#L3005
// Reference Extends:https://github.com/microsoft/TypeScript/blob/febfd442cdba343771f478cf433b0892f213ad2f/src/compiler/commandLineParser.ts#L3005
// Reference Project References: https://github.com/microsoft/TypeScript/blob/7377f5cb9db19d79a6167065b323a45611c812b5/src/compiler/tsbuild.ts#L188C1-L194C2
/**
* @returns Returns undefined in case of lack of result while trying to resolve from node_modules
*/
async function getTsconfigPath(baseDirUri: vscode.Uri, pathValue: string): Promise<vscode.Uri | undefined> {
async function getTsconfigPath(baseDirUri: vscode.Uri, pathValue: string, linkType: TsConfigLinkType): Promise<vscode.Uri | undefined> {
async function resolve(absolutePath: vscode.Uri): Promise<vscode.Uri> {
if (absolutePath.path.endsWith('.json') || await exists(absolutePath)) {
return absolutePath;
}
return absolutePath.with({
path: `${absolutePath.path}.json`
path: `${absolutePath.path}${linkType === TsConfigLinkType.References ? '/tsconfig.json' : '.json'}`
});
}
@@ -194,8 +203,8 @@ export function register() {
.flat();
return vscode.Disposable.from(
vscode.commands.registerCommand(openExtendsLinkCommandId, async ({ resourceUri, extendsValue, }: OpenExtendsLinkCommandArgs) => {
const tsconfigPath = await getTsconfigPath(Utils.dirname(vscode.Uri.from(resourceUri)), extendsValue);
vscode.commands.registerCommand(openExtendsLinkCommandId, async ({ resourceUri, extendsValue, linkType }: OpenExtendsLinkCommandArgs) => {
const tsconfigPath = await getTsconfigPath(Utils.dirname(vscode.Uri.from(resourceUri)), extendsValue, linkType);
if (tsconfigPath === undefined) {
vscode.window.showErrorMessage(vscode.l10n.t("Failed to resolve {0} as module", extendsValue));
return;
+1
View File
@@ -52,6 +52,7 @@
"treeViewReveal",
"workspaceTrust",
"telemetry",
"testingActiveProfile",
"windowActivity",
"interactiveUserActions"
],
@@ -5,7 +5,7 @@
import * as assert from 'assert';
import 'mocha';
import { CancellationToken, chat, ChatAgentRequest, ChatVariableLevel, CompletionItemKind, Disposable, interactive, InteractiveProgress, InteractiveRequest, InteractiveResponseForProgress, InteractiveSession, InteractiveSessionState, Progress, ProviderResult } from 'vscode';
import { CancellationToken, chat, ChatAgentRequest, ChatVariableLevel, Disposable, interactive, InteractiveSession, ProviderResult } from 'vscode';
import { assertNoRpc, closeAllEditors, DeferredPromise, disposeAll } from '../utils';
suite('chat', () => {
@@ -22,24 +22,12 @@ suite('chat', () => {
function getDeferredForRequest(): DeferredPromise<ChatAgentRequest> {
disposables.push(interactive.registerInteractiveSessionProvider('provider', {
prepareSession: (_initialState: InteractiveSessionState | undefined, _token: CancellationToken): ProviderResult<InteractiveSession> => {
prepareSession: (_token: CancellationToken): ProviderResult<InteractiveSession> => {
return {
requester: { name: 'test' },
responder: { name: 'test' },
};
},
provideResponseWithProgress: (_request: InteractiveRequest, _progress: Progress<InteractiveProgress>, _token: CancellationToken): ProviderResult<InteractiveResponseForProgress> => {
return null;
},
provideSlashCommands: (_session, _token) => {
return [{ command: 'hello', title: 'Hello', kind: CompletionItemKind.Text }];
},
removeRequest: (_session: InteractiveSession, _requestId: string): void => {
throw new Error('Function not implemented.');
}
}));
const deferred = new DeferredPromise<ChatAgentRequest>();
@@ -1,62 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import 'mocha';
import { CancellationToken, CompletionItemKind, Disposable, interactive, InteractiveProgress, InteractiveRequest, InteractiveResponseForProgress, InteractiveSession, InteractiveSessionState, Progress, ProviderResult } from 'vscode';
import { assertNoRpc, closeAllEditors, DeferredPromise, disposeAll } from '../utils';
suite('InteractiveSessionProvider', () => {
let disposables: Disposable[] = [];
setup(async () => {
disposables = [];
});
teardown(async function () {
assertNoRpc();
await closeAllEditors();
disposeAll(disposables);
});
function getDeferredForRequest(): DeferredPromise<InteractiveRequest> {
const deferred = new DeferredPromise<InteractiveRequest>();
disposables.push(interactive.registerInteractiveSessionProvider('provider', {
prepareSession: (_initialState: InteractiveSessionState | undefined, _token: CancellationToken): ProviderResult<InteractiveSession> => {
return {
requester: { name: 'test' },
responder: { name: 'test' },
};
},
provideResponseWithProgress: (request: InteractiveRequest, _progress: Progress<InteractiveProgress>, _token: CancellationToken): ProviderResult<InteractiveResponseForProgress> => {
deferred.complete(request);
return null;
},
provideSlashCommands: (_session, _token) => {
return [{ command: 'hello', title: 'Hello', kind: CompletionItemKind.Text }];
},
removeRequest: (_session: InteractiveSession, _requestId: string): void => {
throw new Error('Function not implemented.');
}
}));
return deferred;
}
test('plain text query', async () => {
const deferred = getDeferredForRequest();
interactive.sendInteractiveRequestToProvider('provider', { message: 'hello' });
const lastResult = await deferred.p;
assert.strictEqual(lastResult.message, 'hello');
});
test('slash command', async () => {
const deferred = getDeferredForRequest();
interactive.sendInteractiveRequestToProvider('provider', { message: '/hello' });
const lastResult = await deferred.p;
assert.strictEqual(lastResult.message, '/hello');
});
});
@@ -1,7 +1,7 @@
[
{
"c": "#",
"t": "source.css.less meta.selector.css entity.other.attribute-name.id punctuation.definition.entity.css",
"t": "source.css.less meta.selector.less entity.other.attribute-name.id.less punctuation.definition.entity.less",
"r": {
"dark_plus": "source.css.less entity.other.attribute-name.id: #D7BA7D",
"light_plus": "source.css.less entity.other.attribute-name.id: #800000",
@@ -15,7 +15,7 @@
},
{
"c": "f",
"t": "source.css.less meta.selector.css entity.other.attribute-name.id",
"t": "source.css.less meta.selector.less entity.other.attribute-name.id.less",
"r": {
"dark_plus": "source.css.less entity.other.attribute-name.id: #D7BA7D",
"light_plus": "source.css.less entity.other.attribute-name.id: #800000",
@@ -29,7 +29,7 @@
},
{
"c": "(",
"t": "source.css.less meta.brace.round.css",
"t": "source.css.less meta.selector.less meta.group.less punctuation.definition.group.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -43,35 +43,35 @@
},
{
"c": "@",
"t": "source.css.less variable.other.less punctuation.definition.variable.less",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less variable.other.readwrite.less punctuation.definition.variable.less",
"r": {
"dark_plus": "variable.other.less: #9CDCFE",
"light_plus": "variable.other.less: #E50000",
"dark_vs": "variable.other.less: #9CDCFE",
"light_vs": "variable.other.less: #E50000",
"hc_black": "variable.other.less: #D4D4D4",
"dark_modern": "variable.other.less: #9CDCFE",
"hc_light": "variable.other.less: #264F78",
"light_modern": "variable.other.less: #E50000"
"dark_plus": "source.css.less variable.other: #9CDCFE",
"light_plus": "source.css.less variable.other: #E50000",
"dark_vs": "source.css.less variable.other: #9CDCFE",
"light_vs": "source.css.less variable.other: #E50000",
"hc_black": "source.css.less variable.other: #D4D4D4",
"dark_modern": "source.css.less variable.other: #9CDCFE",
"hc_light": "source.css.less variable.other: #264F78",
"light_modern": "source.css.less variable.other: #E50000"
}
},
{
"c": "hm",
"t": "source.css.less variable.other.less",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less variable.other.readwrite.less support.other.variable.less",
"r": {
"dark_plus": "variable.other.less: #9CDCFE",
"light_plus": "variable.other.less: #E50000",
"dark_vs": "variable.other.less: #9CDCFE",
"light_vs": "variable.other.less: #E50000",
"hc_black": "variable.other.less: #D4D4D4",
"dark_modern": "variable.other.less: #9CDCFE",
"hc_light": "variable.other.less: #264F78",
"light_modern": "variable.other.less: #E50000"
"dark_plus": "source.css.less variable.other: #9CDCFE",
"light_plus": "source.css.less variable.other: #E50000",
"dark_vs": "source.css.less variable.other: #9CDCFE",
"light_vs": "source.css.less variable.other: #E50000",
"hc_black": "source.css.less variable.other: #D4D4D4",
"dark_modern": "source.css.less variable.other: #9CDCFE",
"hc_light": "source.css.less variable.other: #264F78",
"light_modern": "source.css.less variable.other: #E50000"
}
},
{
"c": ":",
"t": "source.css.less punctuation.separator.key-value.css",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less punctuation.separator.key-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -85,7 +85,7 @@
},
{
"c": " ",
"t": "source.css.less",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less meta.property-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -99,7 +99,7 @@
},
{
"c": "\"",
"t": "source.css.less string.quoted.double.css punctuation.definition.string.begin.css",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less string.quoted.double.less punctuation.definition.string.begin.less",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -113,7 +113,7 @@
},
{
"c": "broken highlighting in VS Code",
"t": "source.css.less string.quoted.double.css",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less string.quoted.double.less",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -127,7 +127,7 @@
},
{
"c": "\"",
"t": "source.css.less string.quoted.double.css punctuation.definition.string.end.css",
"t": "source.css.less meta.selector.less meta.group.less meta.property-value.less string.quoted.double.less punctuation.definition.string.end.less",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -141,7 +141,7 @@
},
{
"c": ")",
"t": "source.css.less meta.brace.round.css",
"t": "source.css.less meta.selector.less meta.group.less punctuation.definition.group.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -155,7 +155,7 @@
},
{
"c": " ",
"t": "source.css.less",
"t": "source.css.less meta.selector.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -169,7 +169,7 @@
},
{
"c": "{",
"t": "source.css.less meta.property-list.css punctuation.section.property-list.begin.bracket.curly.css",
"t": "source.css.less meta.property-list.less punctuation.definition.block.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -183,7 +183,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -197,21 +197,21 @@
},
{
"c": "content",
"t": "source.css.less meta.property-list.css entity.name.tag.css",
"t": "source.css.less meta.property-list.less support.type.property-name.less",
"r": {
"dark_plus": "entity.name.tag.css: #D7BA7D",
"light_plus": "entity.name.tag: #800000",
"dark_vs": "entity.name.tag.css: #D7BA7D",
"light_vs": "entity.name.tag: #800000",
"hc_black": "entity.name.tag.css: #D7BA7D",
"dark_modern": "entity.name.tag.css: #D7BA7D",
"hc_light": "entity.name.tag: #0F4A85",
"light_modern": "entity.name.tag: #800000"
"dark_plus": "support.type.property-name: #9CDCFE",
"light_plus": "support.type.property-name: #E50000",
"dark_vs": "support.type.property-name: #9CDCFE",
"light_vs": "support.type.property-name: #E50000",
"hc_black": "support.type.property-name: #D4D4D4",
"dark_modern": "support.type.property-name: #9CDCFE",
"hc_light": "support.type.property-name: #264F78",
"light_modern": "support.type.property-name: #E50000"
}
},
{
"c": ":",
"t": "source.css.less meta.property-list.css punctuation.separator.key-value.css",
"t": "source.css.less meta.property-list.less punctuation.separator.key-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -225,7 +225,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less meta.property-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -239,7 +239,7 @@
},
{
"c": "\"",
"t": "source.css.less meta.property-list.css meta.property-value.css string.quoted.double.css punctuation.definition.string.begin.css",
"t": "source.css.less meta.property-list.less meta.property-value.less string.quoted.double.less punctuation.definition.string.begin.less",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -253,7 +253,7 @@
},
{
"c": "\"",
"t": "source.css.less meta.property-list.css meta.property-value.css string.quoted.double.css punctuation.definition.string.end.css",
"t": "source.css.less meta.property-list.less meta.property-value.less string.quoted.double.less punctuation.definition.string.end.less",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -267,7 +267,7 @@
},
{
"c": ";",
"t": "source.css.less meta.property-list.css punctuation.terminator.rule.css",
"t": "source.css.less meta.property-list.less punctuation.terminator.rule.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -281,7 +281,7 @@
},
{
"c": "}",
"t": "source.css.less meta.property-list.css punctuation.section.property-list.end.bracket.curly.css",
"t": "source.css.less punctuation.definition.block.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1,35 +1,35 @@
[
{
"c": ":",
"t": "source.css.less entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"t": "source.css.less meta.selector.less meta.function-call.less punctuation.definition.entity.less",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF",
"dark_modern": "default: #CCCCCC",
"hc_light": "default: #292929",
"light_modern": "default: #3B3B3B"
}
},
{
"c": "root",
"t": "source.css.less entity.other.attribute-name.pseudo-class.css",
"t": "source.css.less meta.selector.less meta.function-call.less entity.other.attribute-name.pseudo-class.less",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": " ",
"t": "source.css.less",
"t": "source.css.less meta.selector.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -43,7 +43,7 @@
},
{
"c": "{",
"t": "source.css.less meta.property-list.css punctuation.section.property-list.begin.bracket.curly.css",
"t": "source.css.less meta.property-list.less punctuation.definition.block.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -57,7 +57,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -71,35 +71,35 @@
},
{
"c": "--",
"t": "source.css.less meta.property-list.css variable.other.less punctuation.definition.variable.less",
"t": "source.css.less meta.property-list.less support.type.custom-property.less punctuation.definition.custom-property.less",
"r": {
"dark_plus": "variable.other.less: #9CDCFE",
"light_plus": "variable.other.less: #E50000",
"dark_vs": "variable.other.less: #9CDCFE",
"light_vs": "variable.other.less: #E50000",
"hc_black": "variable.other.less: #D4D4D4",
"dark_modern": "variable.other.less: #9CDCFE",
"hc_light": "variable.other.less: #264F78",
"light_modern": "variable.other.less: #E50000"
"dark_plus": "support.type: #4EC9B0",
"light_plus": "support.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "support.type: #4EC9B0",
"dark_modern": "support.type: #4EC9B0",
"hc_light": "support.type: #185E73",
"light_modern": "support.type: #267F99"
}
},
{
"c": "spacing-unit",
"t": "source.css.less meta.property-list.css variable.other.less",
"t": "source.css.less meta.property-list.less support.type.custom-property.less support.type.custom-property.name.less",
"r": {
"dark_plus": "variable.other.less: #9CDCFE",
"light_plus": "variable.other.less: #E50000",
"dark_vs": "variable.other.less: #9CDCFE",
"light_vs": "variable.other.less: #E50000",
"hc_black": "variable.other.less: #D4D4D4",
"dark_modern": "variable.other.less: #9CDCFE",
"hc_light": "variable.other.less: #264F78",
"light_modern": "variable.other.less: #E50000"
"dark_plus": "support.type: #4EC9B0",
"light_plus": "support.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "support.type: #4EC9B0",
"dark_modern": "support.type: #4EC9B0",
"hc_light": "support.type: #185E73",
"light_modern": "support.type: #267F99"
}
},
{
"c": ":",
"t": "source.css.less meta.property-list.css punctuation.separator.key-value.css",
"t": "source.css.less meta.property-list.less punctuation.separator.key-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -113,7 +113,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less meta.property-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -127,7 +127,7 @@
},
{
"c": "6",
"t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css",
"t": "source.css.less meta.property-list.less meta.property-value.less constant.numeric.less",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
@@ -141,7 +141,7 @@
},
{
"c": "px",
"t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css",
"t": "source.css.less meta.property-list.less meta.property-value.less constant.numeric.less keyword.other.unit.less",
"r": {
"dark_plus": "keyword.other.unit: #B5CEA8",
"light_plus": "keyword.other.unit: #098658",
@@ -155,7 +155,7 @@
},
{
"c": ";",
"t": "source.css.less meta.property-list.css punctuation.terminator.rule.css",
"t": "source.css.less meta.property-list.less punctuation.terminator.rule.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -169,7 +169,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -183,35 +183,35 @@
},
{
"c": "--",
"t": "source.css.less meta.property-list.css variable.other.less punctuation.definition.variable.less",
"t": "source.css.less meta.property-list.less support.type.custom-property.less punctuation.definition.custom-property.less",
"r": {
"dark_plus": "variable.other.less: #9CDCFE",
"light_plus": "variable.other.less: #E50000",
"dark_vs": "variable.other.less: #9CDCFE",
"light_vs": "variable.other.less: #E50000",
"hc_black": "variable.other.less: #D4D4D4",
"dark_modern": "variable.other.less: #9CDCFE",
"hc_light": "variable.other.less: #264F78",
"light_modern": "variable.other.less: #E50000"
"dark_plus": "support.type: #4EC9B0",
"light_plus": "support.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "support.type: #4EC9B0",
"dark_modern": "support.type: #4EC9B0",
"hc_light": "support.type: #185E73",
"light_modern": "support.type: #267F99"
}
},
{
"c": "cell-padding",
"t": "source.css.less meta.property-list.css variable.other.less",
"t": "source.css.less meta.property-list.less support.type.custom-property.less support.type.custom-property.name.less",
"r": {
"dark_plus": "variable.other.less: #9CDCFE",
"light_plus": "variable.other.less: #E50000",
"dark_vs": "variable.other.less: #9CDCFE",
"light_vs": "variable.other.less: #E50000",
"hc_black": "variable.other.less: #D4D4D4",
"dark_modern": "variable.other.less: #9CDCFE",
"hc_light": "variable.other.less: #264F78",
"light_modern": "variable.other.less: #E50000"
"dark_plus": "support.type: #4EC9B0",
"light_plus": "support.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "support.type: #4EC9B0",
"dark_modern": "support.type: #4EC9B0",
"hc_light": "support.type: #185E73",
"light_modern": "support.type: #267F99"
}
},
{
"c": ":",
"t": "source.css.less meta.property-list.css punctuation.separator.key-value.css",
"t": "source.css.less meta.property-list.less punctuation.separator.key-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -225,7 +225,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less meta.property-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -239,7 +239,7 @@
},
{
"c": "(",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.brace.round.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less punctuation.definition.group.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -253,7 +253,7 @@
},
{
"c": "4",
"t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less constant.numeric.less",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
@@ -267,7 +267,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css meta.property-value.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -281,7 +281,7 @@
},
{
"c": "*",
"t": "source.css.less meta.property-list.css meta.property-value.css keyword.operator.less",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less keyword.operator.arithmetic.less",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -294,8 +294,8 @@
}
},
{
"c": " ",
"t": "source.css.less meta.property-list.css meta.property-value.css",
"c": " var",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -307,23 +307,9 @@
"light_modern": "default: #3B3B3B"
}
},
{
"c": "var",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css support.function.misc.css",
"r": {
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "support.function: #DCDCAA",
"dark_modern": "support.function: #DCDCAA",
"hc_light": "support.function: #5E2CBC",
"light_modern": "support.function: #795E26"
}
},
{
"c": "(",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css punctuation.section.function.begin.bracket.round.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less meta.group.less punctuation.definition.group.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -336,22 +322,50 @@
}
},
{
"c": "--spacing-unit",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css variable.argument.css",
"c": "--",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less meta.group.less keyword.operator.arithmetic.less",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE",
"dark_modern": "variable: #9CDCFE",
"hc_light": "variable: #001080",
"light_modern": "variable: #001080"
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4",
"dark_modern": "keyword.operator: #D4D4D4",
"hc_light": "keyword.operator: #000000",
"light_modern": "keyword.operator: #000000"
}
},
{
"c": ")",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css punctuation.section.function.end.bracket.round.css",
"c": "spacing",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less meta.group.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF",
"dark_modern": "default: #CCCCCC",
"hc_light": "default: #292929",
"light_modern": "default: #3B3B3B"
}
},
{
"c": "-",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less meta.group.less keyword.operator.arithmetic.less",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4",
"dark_modern": "keyword.operator: #D4D4D4",
"hc_light": "keyword.operator: #000000",
"light_modern": "keyword.operator: #000000"
}
},
{
"c": "unit",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less meta.group.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -365,7 +379,21 @@
},
{
"c": ")",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.brace.round.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less meta.group.less punctuation.definition.group.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF",
"dark_modern": "default: #CCCCCC",
"hc_light": "default: #292929",
"light_modern": "default: #3B3B3B"
}
},
{
"c": ")",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.group.less punctuation.definition.group.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -379,7 +407,7 @@
},
{
"c": ";",
"t": "source.css.less meta.property-list.css punctuation.terminator.rule.css",
"t": "source.css.less meta.property-list.less punctuation.terminator.rule.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -393,7 +421,7 @@
},
{
"c": "}",
"t": "source.css.less meta.property-list.css punctuation.section.property-list.end.bracket.curly.css",
"t": "source.css.less punctuation.definition.block.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -407,21 +435,21 @@
},
{
"c": "body",
"t": "source.css.less entity.name.tag.css",
"t": "source.css.less meta.selector.less entity.name.tag.less",
"r": {
"dark_plus": "entity.name.tag.css: #D7BA7D",
"dark_plus": "entity.name.tag.less: #D7BA7D",
"light_plus": "entity.name.tag: #800000",
"dark_vs": "entity.name.tag.css: #D7BA7D",
"dark_vs": "entity.name.tag.less: #D7BA7D",
"light_vs": "entity.name.tag: #800000",
"hc_black": "entity.name.tag.css: #D7BA7D",
"dark_modern": "entity.name.tag.css: #D7BA7D",
"hc_black": "entity.name.tag.less: #D7BA7D",
"dark_modern": "entity.name.tag.less: #D7BA7D",
"hc_light": "entity.name.tag: #0F4A85",
"light_modern": "entity.name.tag: #800000"
}
},
{
"c": " ",
"t": "source.css.less",
"t": "source.css.less meta.selector.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -435,7 +463,7 @@
},
{
"c": "{",
"t": "source.css.less meta.property-list.css punctuation.section.property-list.begin.bracket.curly.css",
"t": "source.css.less meta.property-list.less punctuation.definition.block.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -449,7 +477,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -463,7 +491,7 @@
},
{
"c": "padding-left",
"t": "source.css.less meta.property-list.css support.type.property-name.css",
"t": "source.css.less meta.property-list.less support.type.property-name.less",
"r": {
"dark_plus": "support.type.property-name: #9CDCFE",
"light_plus": "support.type.property-name: #E50000",
@@ -477,7 +505,7 @@
},
{
"c": ":",
"t": "source.css.less meta.property-list.css punctuation.separator.key-value.css",
"t": "source.css.less meta.property-list.less punctuation.separator.key-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -491,7 +519,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css",
"t": "source.css.less meta.property-list.less meta.property-value.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -505,7 +533,7 @@
},
{
"c": "calc",
"t": "source.css.less meta.property-list.css meta.property-value.css support.function.any-method.builtin.less",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less support.function.calc.less",
"r": {
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
@@ -519,7 +547,7 @@
},
{
"c": "(",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.brace.round.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less punctuation.definition.group.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -533,7 +561,7 @@
},
{
"c": "4",
"t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less constant.numeric.less",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
@@ -547,7 +575,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css meta.property-value.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -561,7 +589,7 @@
},
{
"c": "*",
"t": "source.css.less meta.property-list.css meta.property-value.css keyword.operator.less",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less keyword.operator.arithmetic.less",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -575,7 +603,7 @@
},
{
"c": " ",
"t": "source.css.less meta.property-list.css meta.property-value.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -589,7 +617,7 @@
},
{
"c": "var",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css support.function.misc.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less support.function.var.less",
"r": {
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
@@ -603,7 +631,7 @@
},
{
"c": "(",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css punctuation.section.function.begin.bracket.round.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less punctuation.definition.group.begin.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -616,22 +644,36 @@
}
},
{
"c": "--spacing-unit",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css variable.argument.css",
"c": "--",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less support.type.custom-property.less punctuation.definition.custom-property.less",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_plus": "support.type: #4EC9B0",
"light_plus": "support.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE",
"dark_modern": "variable: #9CDCFE",
"hc_light": "variable: #001080",
"light_modern": "variable: #001080"
"hc_black": "support.type: #4EC9B0",
"dark_modern": "support.type: #4EC9B0",
"hc_light": "support.type: #185E73",
"light_modern": "support.type: #267F99"
}
},
{
"c": "spacing-unit",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less support.type.custom-property.less support.type.custom-property.name.less",
"r": {
"dark_plus": "support.type: #4EC9B0",
"light_plus": "support.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "support.type: #4EC9B0",
"dark_modern": "support.type: #4EC9B0",
"hc_light": "support.type: #185E73",
"light_modern": "support.type: #267F99"
}
},
{
"c": ",",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css punctuation.separator.list.comma.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less punctuation.separator.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -644,50 +686,8 @@
}
},
{
"c": " ",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF",
"dark_modern": "default: #CCCCCC",
"hc_light": "default: #292929",
"light_modern": "default: #3B3B3B"
}
},
{
"c": "5",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css constant.numeric.css",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8",
"dark_modern": "constant.numeric: #B5CEA8",
"hc_light": "constant.numeric: #096D48",
"light_modern": "constant.numeric: #098658"
}
},
{
"c": "px",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css constant.numeric.css keyword.other.unit.px.css",
"r": {
"dark_plus": "keyword.other.unit: #B5CEA8",
"light_plus": "keyword.other.unit: #098658",
"dark_vs": "keyword.other.unit: #B5CEA8",
"light_vs": "keyword.other.unit: #098658",
"hc_black": "keyword.other.unit: #B5CEA8",
"dark_modern": "keyword.other.unit: #B5CEA8",
"hc_light": "keyword.other.unit: #096D48",
"light_modern": "keyword.other.unit: #098658"
}
},
{
"c": ")",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css punctuation.section.function.end.bracket.round.css",
"c": " 5px",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -701,7 +701,21 @@
},
{
"c": ")",
"t": "source.css.less meta.property-list.css meta.property-value.css meta.brace.round.css",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less meta.function-call.less punctuation.definition.group.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF",
"dark_modern": "default: #CCCCCC",
"hc_light": "default: #292929",
"light_modern": "default: #3B3B3B"
}
},
{
"c": ")",
"t": "source.css.less meta.property-list.less meta.property-value.less meta.function-call.less punctuation.definition.group.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -715,7 +729,7 @@
},
{
"c": ";",
"t": "source.css.less meta.property-list.css punctuation.terminator.rule.css",
"t": "source.css.less meta.property-list.less punctuation.terminator.rule.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -729,7 +743,7 @@
},
{
"c": "}",
"t": "source.css.less meta.property-list.css punctuation.section.property-list.end.bracket.curly.css",
"t": "source.css.less punctuation.definition.block.end.less",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -3,28 +3,28 @@
"c": ":",
"t": "source.css.scss entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "root",
"t": "source.css.scss entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -3,28 +3,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "root",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -3601,28 +3601,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "link",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -3951,28 +3951,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "visited",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -4385,28 +4385,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "hover",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -4441,28 +4441,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "focus",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -4497,28 +4497,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "active",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -8879,28 +8879,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "link",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -8963,28 +8963,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "visited",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -10447,28 +10447,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "link",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
@@ -10699,28 +10699,28 @@
"c": ":",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "visited",
"t": "source.css meta.selector.css entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
File diff suppressed because it is too large Load Diff
@@ -1333,28 +1333,28 @@
"c": ":",
"t": "source.css.scss meta.property-list.scss meta.property-list.scss entity.other.attribute-name.pseudo-class.css punctuation.definition.entity.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
"c": "hover",
"t": "source.css.scss meta.property-list.scss meta.property-list.scss entity.other.attribute-name.pseudo-class.css",
"r": {
"dark_plus": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_plus": "entity.other.attribute-name.pseudo-class.css: #800000",
"dark_vs": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"light_vs": "entity.other.attribute-name.pseudo-class.css: #800000",
"hc_black": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"dark_modern": "entity.other.attribute-name.pseudo-class.css: #D7BA7D",
"hc_light": "entity.other.attribute-name.pseudo-class.css: #0F4A85",
"light_modern": "entity.other.attribute-name.pseudo-class.css: #800000"
"dark_plus": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_plus": "source.css entity.other.attribute-name.pseudo-class: #800000",
"dark_vs": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"light_vs": "source.css entity.other.attribute-name.pseudo-class: #800000",
"hc_black": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"dark_modern": "source.css entity.other.attribute-name.pseudo-class: #D7BA7D",
"hc_light": "source.css entity.other.attribute-name.pseudo-class: #0F4A85",
"light_modern": "source.css entity.other.attribute-name.pseudo-class: #800000"
}
},
{
+4 -4
View File
@@ -228,10 +228,10 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
typescript@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
typescript@^5.3.1-rc:
version "5.3.1-rc"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.1-rc.tgz#c307d4b69ea0c1c2cd17d4dd7700d30f7197f829"
integrity sha512-NVq/AufFc6KVjmVPcuVwdCkhTQlTcMEyRYJPvaGhPvj+X80MYUF+90qf0//uvINPb2ULg9m91/gbdIOhN2cZqA==
vscode-grammar-updater@^1.1.0:
version "1.1.0"
+9 -9
View File
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.85.0",
"distro": "781fcac8037888d06551bccd6dd63728021d0e65",
"distro": "cbc81496e34eafbc771b8f008e6a742d755968c9",
"author": {
"name": "Microsoft Corporation"
},
@@ -80,14 +80,14 @@
"@vscode/windows-mutex": "^0.4.4",
"@vscode/windows-process-tree": "^0.5.0",
"@vscode/windows-registry": "^1.1.0",
"@xterm/addon-canvas": "0.6.0-beta.9",
"@xterm/addon-image": "0.7.0-beta.7",
"@xterm/addon-search": "0.14.0-beta.9",
"@xterm/addon-serialize": "0.12.0-beta.9",
"@xterm/addon-unicode11": "0.7.0-beta.9",
"@xterm/addon-webgl": "0.17.0-beta.9",
"@xterm/headless": "5.4.0-beta.9",
"@xterm/xterm": "5.4.0-beta.9",
"@xterm/addon-canvas": "0.6.0-beta.14",
"@xterm/addon-image": "0.7.0-beta.12",
"@xterm/addon-search": "0.14.0-beta.14",
"@xterm/addon-serialize": "0.12.0-beta.14",
"@xterm/addon-unicode11": "0.7.0-beta.14",
"@xterm/addon-webgl": "0.17.0-beta.14",
"@xterm/headless": "5.4.0-beta.14",
"@xterm/xterm": "5.4.0-beta.14",
"graceful-fs": "4.2.11",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
+8 -8
View File
@@ -13,14 +13,14 @@
"@vscode/vscode-languagedetection": "1.0.21",
"@vscode/windows-process-tree": "^0.5.0",
"@vscode/windows-registry": "^1.1.0",
"@xterm/addon-canvas": "0.6.0-beta.9",
"@xterm/addon-image": "0.7.0-beta.7",
"@xterm/addon-search": "0.14.0-beta.9",
"@xterm/addon-serialize": "0.12.0-beta.9",
"@xterm/addon-unicode11": "0.7.0-beta.9",
"@xterm/addon-webgl": "0.17.0-beta.9",
"@xterm/headless": "5.4.0-beta.9",
"@xterm/xterm": "5.4.0-beta.9",
"@xterm/addon-canvas": "0.6.0-beta.14",
"@xterm/addon-image": "0.7.0-beta.12",
"@xterm/addon-search": "0.14.0-beta.14",
"@xterm/addon-serialize": "0.12.0-beta.14",
"@xterm/addon-unicode11": "0.7.0-beta.14",
"@xterm/addon-webgl": "0.17.0-beta.14",
"@xterm/headless": "5.4.0-beta.14",
"@xterm/xterm": "5.4.0-beta.14",
"cookie": "^0.4.0",
"graceful-fs": "4.2.11",
"http-proxy-agent": "^7.0.0",
+7 -6
View File
@@ -7,12 +7,13 @@
"@microsoft/1ds-post-js": "^3.2.13",
"@vscode/iconv-lite-umd": "0.7.0",
"@vscode/vscode-languagedetection": "1.0.21",
"@xterm/addon-canvas": "0.6.0-beta.9",
"@xterm/addon-image": "0.7.0-beta.7",
"@xterm/addon-search": "0.14.0-beta.9",
"@xterm/addon-unicode11": "0.7.0-beta.9",
"@xterm/addon-webgl": "0.17.0-beta.9",
"@xterm/xterm": "5.4.0-beta.9",
"@xterm/addon-canvas": "0.6.0-beta.14",
"@xterm/addon-image": "0.7.0-beta.12",
"@xterm/addon-search": "0.14.0-beta.14",
"@xterm/addon-serialize": "0.12.0-beta.14",
"@xterm/addon-unicode11": "0.7.0-beta.14",
"@xterm/addon-webgl": "0.17.0-beta.14",
"@xterm/xterm": "5.4.0-beta.14",
"jschardet": "3.0.0",
"tas-client-umd": "0.1.8",
"vscode-oniguruma": "1.7.0",
+29 -24
View File
@@ -48,35 +48,40 @@
resolved "https://registry.yarnpkg.com/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz#89b48f293f6aa3341bb888c1118d16ff13b032d3"
integrity sha512-zSUH9HYCw5qsCtd7b31yqkpaCU6jhtkKLkvOOA8yTrIRfBSOFb8PPhgmMicD7B/m+t4PwOJXzU1XDtrM9Fd3/g==
"@xterm/addon-canvas@0.6.0-beta.9":
version "0.6.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-canvas/-/addon-canvas-0.6.0-beta.9.tgz#36d9368c2a428bd2a1577ba336a6d12dee4ed374"
integrity sha512-WYoDnAjzuZbo66s2pN+rq6tOcezOkCwWJGsDI3G3Yddra9iT928fmXb9YJ54B9vbcjn3EVxINwHIy6CANryMuQ==
"@xterm/addon-canvas@0.6.0-beta.14":
version "0.6.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-canvas/-/addon-canvas-0.6.0-beta.14.tgz#5a4022edf80e4b62348c11e56a0c7247b38ac946"
integrity sha512-J2+XfgTV+1ee48awyajh4maJDfzSbtF0FkOoxIUUDaw2fAPOBqeUqTDHxOyvzoYwAHlaJ98AA5HaYjrTkXqXlg==
"@xterm/addon-image@0.7.0-beta.7":
version "0.7.0-beta.7"
resolved "https://registry.yarnpkg.com/@xterm/addon-image/-/addon-image-0.7.0-beta.7.tgz#8c8bba429d15cbb85d59dd8ec7447e998734bc2b"
integrity sha512-ulfa6BcIZTK+FUWRVtrVLNEcyIqg/y1Tu3o9eihNHxhlwqfPmtCYIGiMbu+/2WbHTedeJBLH4yaikYBCWCnw0w==
"@xterm/addon-image@0.7.0-beta.12":
version "0.7.0-beta.12"
resolved "https://registry.yarnpkg.com/@xterm/addon-image/-/addon-image-0.7.0-beta.12.tgz#b1ed300492429a1394c94385fb0c61ed36ad2041"
integrity sha512-MseIv99qlQ0u113a4PFAfSv4vQi+16HC6S9oAcS/CSAHeSySYqPPLdZXAMqLZo0n/vIESmSFXlX4bm2k3YIhoQ==
"@xterm/addon-search@0.14.0-beta.9":
version "0.14.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-search/-/addon-search-0.14.0-beta.9.tgz#ba2627eef452bff4aa70b403a711d5dd2e103d33"
integrity sha512-lRIji5o4hb/1u9Iiy0T2g19tjsKZMuuqwfKNfa2/o/LmV3qadcjUKiR+2RKbbCRYszPnclrzNpdBBv+Kz8BhgA==
"@xterm/addon-search@0.14.0-beta.14":
version "0.14.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-search/-/addon-search-0.14.0-beta.14.tgz#09da64dfea88315e1e07f95e5d8ec371fe986edb"
integrity sha512-SOIUqIakxLCT2jyn0GEidmd1KJRqGbuOITWXx8loBeiBb/Omo01nqhtHFU0HTdCRwFbOhMRMDTKKr2nQxaoPEQ==
"@xterm/addon-unicode11@0.7.0-beta.9":
version "0.7.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-unicode11/-/addon-unicode11-0.7.0-beta.9.tgz#7cbe6dc0838b480e57a93f22b8217b3ab123a61a"
integrity sha512-77OrmilFxNTgXair6d9NDZgN5uVUat6u7q0OrnTaUEacuyyw39RAacqg+Zaf/hv8SzeRD+dHICDKP1K4d2km8w==
"@xterm/addon-serialize@0.12.0-beta.14":
version "0.12.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-serialize/-/addon-serialize-0.12.0-beta.14.tgz#a02553b318f2f9863cadb072e3e671ba34985e3b"
integrity sha512-zHNc6gKxHG8D+oZRWopHRCZXGt/eTBGUbVKc3Jk0h5zuWrNATZCztljQ7Zy/VOwhxQRpFrV6MXE4vb2cBLdmvw==
"@xterm/addon-webgl@0.17.0-beta.9":
version "0.17.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.17.0-beta.9.tgz#a8f11d73aecebc408ca0d772afa7c477d20581ed"
integrity sha512-/IlZOYdbUhL188GTRRq+b4bDipePYSlw2d8HhUusaRHJVyFAN/xZHcoIJ3M6cRI5puyxK2Rkq12XDDJ1Qrdyrg==
"@xterm/addon-unicode11@0.7.0-beta.14":
version "0.7.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-unicode11/-/addon-unicode11-0.7.0-beta.14.tgz#37f672945b59c62676a76f9afa292973bff13763"
integrity sha512-L1Maeye7mPYgllIOaD8b3J70B73SoC0deNrlhiMkry/8ue2Q48JzQnOGVWKIOZC+owB1aQRWZbQZbQaAiLKz4A==
"@xterm/xterm@5.4.0-beta.9":
version "5.4.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.4.0-beta.9.tgz#2c557f7d3175526389bd180831dbf4a263f888f7"
integrity sha512-hTtiqDCQ2C52E5bCTq4q03aSQUGxDmBQo8CqS/StUPzSq21Um0V6yf4xYweW3xnGHUtACjUacFjLJ6Fzn9H75A==
"@xterm/addon-webgl@0.17.0-beta.14":
version "0.17.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.17.0-beta.14.tgz#767057842d72258656be990b85718f01cf53ab55"
integrity sha512-FZoC0gk/H0hpQFrPEp2LM4qllj4a1MR/6sIg0TY6L83KS++8gxQLonTxDQoAmb9Ld5816s7ynLZJSTJUyDWRpg==
"@xterm/xterm@5.4.0-beta.14":
version "5.4.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.4.0-beta.14.tgz#fa0902f457fe799c65dec6ff784538a087f611d9"
integrity sha512-69E++VxeLPxBRhR3EGpkDe3R+EhpEZILo0m6TcN+atC4Zm5+WgcqXBCrBhkvpnBA2AhZp51w+hLC/OCwaHE0rg==
jschardet@3.0.0:
version "3.0.0"
+32 -32
View File
@@ -113,45 +113,45 @@
resolved "https://registry.yarnpkg.com/@vscode/windows-registry/-/windows-registry-1.1.0.tgz#03dace7c29c46f658588b9885b9580e453ad21f9"
integrity sha512-5AZzuWJpGscyiMOed0IuyEwt6iKmV5Us7zuwCDCFYMIq7tsvooO9BUiciywsvuthGz6UG4LSpeDeCxvgMVhnIw==
"@xterm/addon-canvas@0.6.0-beta.9":
version "0.6.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-canvas/-/addon-canvas-0.6.0-beta.9.tgz#36d9368c2a428bd2a1577ba336a6d12dee4ed374"
integrity sha512-WYoDnAjzuZbo66s2pN+rq6tOcezOkCwWJGsDI3G3Yddra9iT928fmXb9YJ54B9vbcjn3EVxINwHIy6CANryMuQ==
"@xterm/addon-canvas@0.6.0-beta.14":
version "0.6.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-canvas/-/addon-canvas-0.6.0-beta.14.tgz#5a4022edf80e4b62348c11e56a0c7247b38ac946"
integrity sha512-J2+XfgTV+1ee48awyajh4maJDfzSbtF0FkOoxIUUDaw2fAPOBqeUqTDHxOyvzoYwAHlaJ98AA5HaYjrTkXqXlg==
"@xterm/addon-image@0.7.0-beta.7":
version "0.7.0-beta.7"
resolved "https://registry.yarnpkg.com/@xterm/addon-image/-/addon-image-0.7.0-beta.7.tgz#8c8bba429d15cbb85d59dd8ec7447e998734bc2b"
integrity sha512-ulfa6BcIZTK+FUWRVtrVLNEcyIqg/y1Tu3o9eihNHxhlwqfPmtCYIGiMbu+/2WbHTedeJBLH4yaikYBCWCnw0w==
"@xterm/addon-image@0.7.0-beta.12":
version "0.7.0-beta.12"
resolved "https://registry.yarnpkg.com/@xterm/addon-image/-/addon-image-0.7.0-beta.12.tgz#b1ed300492429a1394c94385fb0c61ed36ad2041"
integrity sha512-MseIv99qlQ0u113a4PFAfSv4vQi+16HC6S9oAcS/CSAHeSySYqPPLdZXAMqLZo0n/vIESmSFXlX4bm2k3YIhoQ==
"@xterm/addon-search@0.14.0-beta.9":
version "0.14.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-search/-/addon-search-0.14.0-beta.9.tgz#ba2627eef452bff4aa70b403a711d5dd2e103d33"
integrity sha512-lRIji5o4hb/1u9Iiy0T2g19tjsKZMuuqwfKNfa2/o/LmV3qadcjUKiR+2RKbbCRYszPnclrzNpdBBv+Kz8BhgA==
"@xterm/addon-search@0.14.0-beta.14":
version "0.14.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-search/-/addon-search-0.14.0-beta.14.tgz#09da64dfea88315e1e07f95e5d8ec371fe986edb"
integrity sha512-SOIUqIakxLCT2jyn0GEidmd1KJRqGbuOITWXx8loBeiBb/Omo01nqhtHFU0HTdCRwFbOhMRMDTKKr2nQxaoPEQ==
"@xterm/addon-serialize@0.12.0-beta.9":
version "0.12.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-serialize/-/addon-serialize-0.12.0-beta.9.tgz#4453db50c405555dd94791306eeb8358353f6bb2"
integrity sha512-N5BmlAT6fxeHjN+ylldNBbmczEcIF4fyJcE810prxCCYasRdnNy/KjGFWH7r1v4qoOxqY4LEaCUBbdh+SGiaUQ==
"@xterm/addon-serialize@0.12.0-beta.14":
version "0.12.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-serialize/-/addon-serialize-0.12.0-beta.14.tgz#a02553b318f2f9863cadb072e3e671ba34985e3b"
integrity sha512-zHNc6gKxHG8D+oZRWopHRCZXGt/eTBGUbVKc3Jk0h5zuWrNATZCztljQ7Zy/VOwhxQRpFrV6MXE4vb2cBLdmvw==
"@xterm/addon-unicode11@0.7.0-beta.9":
version "0.7.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-unicode11/-/addon-unicode11-0.7.0-beta.9.tgz#7cbe6dc0838b480e57a93f22b8217b3ab123a61a"
integrity sha512-77OrmilFxNTgXair6d9NDZgN5uVUat6u7q0OrnTaUEacuyyw39RAacqg+Zaf/hv8SzeRD+dHICDKP1K4d2km8w==
"@xterm/addon-unicode11@0.7.0-beta.14":
version "0.7.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-unicode11/-/addon-unicode11-0.7.0-beta.14.tgz#37f672945b59c62676a76f9afa292973bff13763"
integrity sha512-L1Maeye7mPYgllIOaD8b3J70B73SoC0deNrlhiMkry/8ue2Q48JzQnOGVWKIOZC+owB1aQRWZbQZbQaAiLKz4A==
"@xterm/addon-webgl@0.17.0-beta.9":
version "0.17.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.17.0-beta.9.tgz#a8f11d73aecebc408ca0d772afa7c477d20581ed"
integrity sha512-/IlZOYdbUhL188GTRRq+b4bDipePYSlw2d8HhUusaRHJVyFAN/xZHcoIJ3M6cRI5puyxK2Rkq12XDDJ1Qrdyrg==
"@xterm/addon-webgl@0.17.0-beta.14":
version "0.17.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.17.0-beta.14.tgz#767057842d72258656be990b85718f01cf53ab55"
integrity sha512-FZoC0gk/H0hpQFrPEp2LM4qllj4a1MR/6sIg0TY6L83KS++8gxQLonTxDQoAmb9Ld5816s7ynLZJSTJUyDWRpg==
"@xterm/headless@5.4.0-beta.9":
version "5.4.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/headless/-/headless-5.4.0-beta.9.tgz#1452b433cf22e6d416f6638dfafcaa78809b2fca"
integrity sha512-MiBbdetKrZ7uh9kobKO6ZD3o5z7Ud/MIIavNEJpUEphvYbkIsO/YUZAnd0Oxr908ESDpjoDevFuzfYagO+KRvg==
"@xterm/headless@5.4.0-beta.14":
version "5.4.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/headless/-/headless-5.4.0-beta.14.tgz#22f56a23bff9434b586a09771ac0c1dc06d72330"
integrity sha512-W1OPpSuKJqaJUXIi6GjOYRYzmmeB1SX6o2YIuYLJTzZx3cQzg6/gecYbGL1VKp7WzouAb8yJSlSkSQRIUMDRYg==
"@xterm/xterm@5.4.0-beta.9":
version "5.4.0-beta.9"
resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.4.0-beta.9.tgz#2c557f7d3175526389bd180831dbf4a263f888f7"
integrity sha512-hTtiqDCQ2C52E5bCTq4q03aSQUGxDmBQo8CqS/StUPzSq21Um0V6yf4xYweW3xnGHUtACjUacFjLJ6Fzn9H75A==
"@xterm/xterm@5.4.0-beta.14":
version "5.4.0-beta.14"
resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.4.0-beta.14.tgz#fa0902f457fe799c65dec6ff784538a087f611d9"
integrity sha512-69E++VxeLPxBRhR3EGpkDe3R+EhpEZILo0m6TcN+atC4Zm5+WgcqXBCrBhkvpnBA2AhZp51w+hLC/OCwaHE0rg==
agent-base@^7.0.1, agent-base@^7.0.2, agent-base@^7.1.0:
version "7.1.0"
+2 -2
View File
@@ -15,8 +15,8 @@ interface IDisposable {
dispose(): void;
}
interface GlobalThisAddition extends globalThis {
$hotReload_applyNewExports?(oldExports: Record<string, unknown>): AcceptNewExportsFn | undefined;
interface GlobalThisAddition {
$hotReload_applyNewExports?(args: { oldExports: Record<string, unknown>; newSrc: string }): AcceptNewExportsFn | undefined;
}
type AcceptNewExportsFn = (newExports: Record<string, unknown>) => boolean;
+6 -2
View File
@@ -85,7 +85,7 @@ module.exports.run = async function (debugSession) {
// A frozen copy of the previous exports
const oldExports = Object.freeze({ ...oldModule.exports });
const reloadFn = g.$hotReload_applyNewExports?.(oldExports);
const reloadFn = g.$hotReload_applyNewExports?.({ oldExports, newSrc });
if (!reloadFn) {
console.log(debugSessionName, 'ignoring js change, as module does not support hot-reload', relativePath);
@@ -94,7 +94,11 @@ module.exports.run = async function (debugSession) {
return;
}
const newScript = new Function('define', newSrc); // CodeQL [SM01632] This code is only executed during development. It is required for the hot-reload functionality.
// Eval maintains source maps
function newScript(/* this parameter is used by newSrc */ define) {
// eslint-disable-next-line no-eval
eval(newSrc); // CodeQL [SM01632] This code is only executed during development. It is required for the hot-reload functionality.
}
newScript(/* define */ function (deps, callback) {
// Evaluating the new code was successful.
+2 -2
View File
@@ -11,13 +11,13 @@ const moduleNames = [
'@xterm/addon-canvas',
'@xterm/addon-image',
'@xterm/addon-search',
'@xterm/addon-serialize',
'@xterm/addon-unicode11',
'@xterm/addon-webgl',
];
const backendOnlyModuleNames = [
'@xterm/headless',
'@xterm/addon-serialize'
'@xterm/headless'
];
const vscodeDir = process.argv.length >= 3 ? process.argv[2] : process.cwd();
+2
View File
@@ -8,6 +8,8 @@
//@ts-check
'use strict';
/* eslint-disable no-restricted-globals */
// Simple module style to support node.js and browser environments
(function (globalThis, factory) {
+20
View File
@@ -0,0 +1,20 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Declare types that we probe for to implement util and/or polyfill functions
declare global {
interface IdleDeadline {
readonly didTimeout: boolean;
timeRemaining(): number;
}
function requestIdleCallback(callback: (args: IdleDeadline) => void, options?: { timeout: number }): number;
function cancelIdleCallback(handle: number): void;
}
export { }
+4 -1
View File
@@ -57,8 +57,10 @@ class AMDModuleImporter {
(<any>globalThis).define.amd = true;
if (this._isRenderer) {
// eslint-disable-next-line no-restricted-globals
this._amdPolicy = window.trustedTypes?.createPolicy('amdLoader', {
createScriptURL(value) {
// eslint-disable-next-line no-restricted-globals
if (value.startsWith(window.location.origin)) {
return value;
}
@@ -121,7 +123,8 @@ class AMDModuleImporter {
scriptSrc = this._amdPolicy.createScriptURL(scriptSrc) as any as string;
}
scriptElement.setAttribute('src', scriptSrc);
document.getElementsByTagName('head')[0].appendChild(scriptElement);
// eslint-disable-next-line no-restricted-globals
window.document.getElementsByTagName('head')[0].appendChild(scriptElement);
});
}
+6 -5
View File
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mainWindow } from 'vs/base/browser/window';
import { getErrorMessage } from 'vs/base/common/errors';
import { Emitter } from 'vs/base/common/event';
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
@@ -18,7 +19,7 @@ export class BroadcastDataChannel<T> extends Disposable {
super();
// Use BroadcastChannel
if ('BroadcastChannel' in window) {
if ('BroadcastChannel' in mainWindow) {
try {
this.broadcastChannel = new BroadcastChannel(channelName);
const listener = (event: MessageEvent) => {
@@ -49,8 +50,8 @@ export class BroadcastDataChannel<T> extends Disposable {
this._onDidReceiveData.fire(JSON.parse(event.newValue));
}
};
window.addEventListener('storage', listener);
this._register(toDisposable(() => window.removeEventListener('storage', listener)));
mainWindow.addEventListener('storage', listener);
this._register(toDisposable(() => mainWindow.removeEventListener('storage', listener)));
}
/**
@@ -62,8 +63,8 @@ export class BroadcastDataChannel<T> extends Disposable {
this.broadcastChannel.postMessage(data);
} else {
// remove previous changes so that event is triggered even if new changes are same as old changes
window.localStorage.removeItem(this.channelName);
window.localStorage.setItem(this.channelName, JSON.stringify(data));
localStorage.removeItem(this.channelName);
localStorage.setItem(this.channelName, JSON.stringify(data));
}
}
}
+7 -6
View File
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { $window } from 'vs/base/browser/window';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, markAsSingleton } from 'vs/base/common/lifecycle';
@@ -73,7 +74,7 @@ class DevicePixelRatioMonitor extends Disposable {
private _handleChange(fireEvent: boolean): void {
this._mediaQueryList?.removeEventListener('change', this._listener);
this._mediaQueryList = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
this._mediaQueryList = $window.matchMedia(`(resolution: ${$window.devicePixelRatio}dppx)`);
this._mediaQueryList.addEventListener('change', this._listener);
if (fireEvent) {
@@ -107,7 +108,7 @@ class PixelRatioImpl extends Disposable {
private _getPixelRatio(): number {
const ctx: any = document.createElement('canvas').getContext('2d');
const dpr = window.devicePixelRatio || 1;
const dpr = $window.devicePixelRatio || 1;
const bsr = ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
@@ -144,7 +145,7 @@ class PixelRatioFacade {
export function addMatchMediaChangeListener(query: string | MediaQueryList, callback: (this: MediaQueryList, ev: MediaQueryListEvent) => any): void {
if (typeof query === 'string') {
query = window.matchMedia(query);
query = $window.matchMedia(query);
}
query.addEventListener('change', callback);
}
@@ -193,9 +194,9 @@ export const isElectron = (userAgent.indexOf('Electron/') >= 0);
export const isAndroid = (userAgent.indexOf('Android') >= 0);
let standalone = false;
if (window.matchMedia) {
const standaloneMatchMedia = window.matchMedia('(display-mode: standalone) or (display-mode: window-controls-overlay)');
const fullScreenMatchMedia = window.matchMedia('(display-mode: fullscreen)');
if ($window.matchMedia) {
const standaloneMatchMedia = $window.matchMedia('(display-mode: standalone) or (display-mode: window-controls-overlay)');
const fullScreenMatchMedia = $window.matchMedia('(display-mode: fullscreen)');
standalone = standaloneMatchMedia.matches;
addMatchMediaChangeListener(standaloneMatchMedia, ({ matches }) => {
// entering fullscreen would change standaloneMatchMedia.matches to false
+3 -2
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as browser from 'vs/base/browser/browser';
import { mainWindow } from 'vs/base/browser/window';
import * as platform from 'vs/base/common/platform';
export const enum KeyboardSupport {
@@ -41,6 +42,6 @@ export const BrowserFeatures = {
// 'ontouchstart' in window always evaluates to true with typescript's modern typings. This causes `window` to be
// `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast
touch: 'ontouchstart' in window || navigator.maxTouchPoints > 0,
pointerEvents: window.PointerEvent && ('ontouchstart' in window || (window as Window).navigator.maxTouchPoints > 0 || navigator.maxTouchPoints > 0)
touch: 'ontouchstart' in mainWindow || navigator.maxTouchPoints > 0,
pointerEvents: mainWindow.PointerEvent && ('ontouchstart' in mainWindow || navigator.maxTouchPoints > 0 || navigator.maxTouchPoints > 0)
};
+139 -74
View File
@@ -7,7 +7,7 @@ import * as browser from 'vs/base/browser/browser';
import { BrowserFeatures } from 'vs/base/browser/canIUse';
import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { TimeoutTimer } from 'vs/base/common/async';
import { AbstractIdleValue, IntervalTimer, TimeoutTimer, _runWhenIdle, IdleDeadline } from 'vs/base/common/async';
import { onUnexpectedError } from 'vs/base/common/errors';
import * as event from 'vs/base/common/event';
import * as dompurify from 'vs/base/browser/dompurify/dompurify';
@@ -17,10 +17,7 @@ import { FileAccess, RemoteAuthorities, Schemas } from 'vs/base/common/network';
import * as platform from 'vs/base/common/platform';
import { URI } from 'vs/base/common/uri';
import { hash } from 'vs/base/common/hash';
export type CodeWindow = Window & typeof globalThis & {
readonly vscodeWindowId: number;
};
import { CodeWindow, mainWindow } from 'vs/base/browser/window';
interface IRegisteredCodeWindow {
readonly window: CodeWindow;
@@ -30,10 +27,9 @@ interface IRegisteredCodeWindow {
export const { registerWindow, getWindows, getWindowsCount, getWindowId, onDidRegisterWindow, onWillUnregisterWindow, onDidUnregisterWindow } = (function () {
const windows = new Map<number, IRegisteredCodeWindow>();
const mainWindow = window as CodeWindow;
if (typeof mainWindow.vscodeWindowId !== 'number') {
Object.defineProperty(window, 'vscodeWindowId', {
get: () => -1
Object.defineProperty(mainWindow, 'vscodeWindowId', {
get: () => 1
});
}
windows.set(mainWindow.vscodeWindowId, { window: mainWindow, disposables: new DisposableStore() });
@@ -137,9 +133,9 @@ export interface IAddStandardDisposableListenerSignature {
(node: HTMLElement, type: 'pointerup', handler: (event: PointerEvent) => void, useCapture?: boolean): IDisposable;
(node: HTMLElement, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;
}
function _wrapAsStandardMouseEvent(handler: (e: IMouseEvent) => void): (e: MouseEvent) => void {
function _wrapAsStandardMouseEvent(targetWindow: Window, handler: (e: IMouseEvent) => void): (e: MouseEvent) => void {
return function (e: MouseEvent) {
return handler(new StandardMouseEvent(e));
return handler(new StandardMouseEvent(targetWindow, e));
};
}
function _wrapAsStandardKeyboardEvent(handler: (e: IKeyboardEvent) => void): (e: KeyboardEvent) => void {
@@ -151,7 +147,7 @@ export const addStandardDisposableListener: IAddStandardDisposableListenerSignat
let wrapHandler = handler;
if (type === 'click' || type === 'mousedown') {
wrapHandler = _wrapAsStandardMouseEvent(handler);
wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler);
} else if (type === 'keydown' || type === 'keypress' || type === 'keyup') {
wrapHandler = _wrapAsStandardKeyboardEvent(handler);
}
@@ -160,13 +156,13 @@ export const addStandardDisposableListener: IAddStandardDisposableListenerSignat
};
export const addStandardDisposableGenericMouseDownListener = function addStandardDisposableListener(node: HTMLElement, handler: (event: any) => void, useCapture?: boolean): IDisposable {
const wrapHandler = _wrapAsStandardMouseEvent(handler);
const wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler);
return addDisposableGenericMouseDownListener(node, wrapHandler, useCapture);
};
export const addStandardDisposableGenericMouseUpListener = function addStandardDisposableListener(node: HTMLElement, handler: (event: any) => void, useCapture?: boolean): IDisposable {
const wrapHandler = _wrapAsStandardMouseEvent(handler);
const wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler);
return addDisposableGenericMouseUpListener(node, wrapHandler, useCapture);
};
@@ -182,20 +178,76 @@ export function addDisposableGenericMouseUpListener(node: EventTarget, handler:
return addDisposableListener(node, platform.isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_UP : EventType.MOUSE_UP, handler, useCapture);
}
/**
* Execute the callback the next time the browser is idle, returning an
* {@link IDisposable} that will cancel the callback when disposed. This wraps
* [requestIdleCallback] so it will fallback to [setTimeout] if the environment
* doesn't support it.
*
* @param targetWindow The window for which to run the idle callback
* @param callback The callback to run when idle, this includes an
* [IdleDeadline] that provides the time alloted for the idle callback by the
* browser. Not respecting this deadline will result in a degraded user
* experience.
* @param timeout A timeout at which point to queue no longer wait for an idle
* callback but queue it on the regular event loop (like setTimeout). Typically
* this should not be used.
*
* [IdleDeadline]: https://developer.mozilla.org/en-US/docs/Web/API/IdleDeadline
* [requestIdleCallback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
* [setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout
*/
export function runWhenWindowIdle(targetWindow: Window | typeof globalThis, callback: (idle: IdleDeadline) => void, timeout?: number): IDisposable {
return _runWhenIdle(targetWindow, callback, timeout);
}
/**
* An implementation of the "idle-until-urgent"-strategy as introduced
* here: https://philipwalton.com/articles/idle-until-urgent/
*/
export class WindowIdleValue<T> extends AbstractIdleValue<T> {
constructor(targetWindow: Window | typeof globalThis, executor: () => T) {
super(targetWindow, executor);
}
}
/**
* Schedule a callback to be run at the next animation frame.
* This allows multiple parties to register callbacks that should run at the next animation frame.
* If currently in an animation frame, `runner` will be executed immediately.
* @return token that can be used to cancel the scheduled runner (only if `runner` was not executed immediately).
*/
export let runAtThisOrScheduleAtNextAnimationFrame: (runner: () => void, targetWindow: Window, priority?: number) => IDisposable;
export let runAtThisOrScheduleAtNextAnimationFrame: (targetWindow: Window, runner: () => void, priority?: number) => IDisposable;
/**
* Schedule a callback to be run at the next animation frame.
* This allows multiple parties to register callbacks that should run at the next animation frame.
* If currently in an animation frame, `runner` will be executed at the next animation frame.
* @return token that can be used to cancel the scheduled runner.
*/
export let scheduleAtNextAnimationFrame: (runner: () => void, targetWindow: Window, priority?: number) => IDisposable;
export let scheduleAtNextAnimationFrame: (targetWindow: Window, runner: () => void, priority?: number) => IDisposable;
export function disposableWindowInterval(targetWindow: Window & typeof globalThis, handler: () => void | boolean /* stop interval */ | Promise<unknown>, interval: number, iterations?: number): IDisposable {
let iteration = 0;
const timer = targetWindow.setInterval(() => {
iteration++;
if ((typeof iterations === 'number' && iteration >= iterations) || handler() === true) {
disposable.dispose();
}
}, interval);
const disposable = toDisposable(() => {
targetWindow.clearInterval(timer);
});
return disposable;
}
export class WindowIntervalTimer extends IntervalTimer {
override cancelAndSet(runner: () => void, interval: number, targetWindow: Window & typeof globalThis): void {
return super.cancelAndSet(runner, interval, targetWindow);
}
}
class AnimationFrameQueueItem implements IDisposable {
@@ -265,7 +317,7 @@ class AnimationFrameQueueItem implements IDisposable {
inAnimationFrameRunner.set(targetWindowId, false);
};
scheduleAtNextAnimationFrame = (runner: () => void, targetWindow: Window, priority: number = 0) => {
scheduleAtNextAnimationFrame = (targetWindow: Window, runner: () => void, priority: number = 0) => {
const targetWindowId = getWindowId(targetWindow);
const item = new AnimationFrameQueueItem(runner, priority);
@@ -284,7 +336,7 @@ class AnimationFrameQueueItem implements IDisposable {
return item;
};
runAtThisOrScheduleAtNextAnimationFrame = (runner: () => void, targetWindow: Window, priority?: number) => {
runAtThisOrScheduleAtNextAnimationFrame = (targetWindow: Window, runner: () => void, priority?: number) => {
const targetWindowId = getWindowId(targetWindow);
if (inAnimationFrameRunner.get(targetWindowId)) {
const item = new AnimationFrameQueueItem(runner, priority);
@@ -296,17 +348,17 @@ class AnimationFrameQueueItem implements IDisposable {
currentQueue.push(item);
return item;
} else {
return scheduleAtNextAnimationFrame(runner, targetWindow, priority);
return scheduleAtNextAnimationFrame(targetWindow, runner, priority);
}
};
})();
export function measure(callback: () => void, targetWindow: Window): IDisposable {
return scheduleAtNextAnimationFrame(callback, targetWindow, 10000 /* must be early */);
export function measure(targetWindow: Window, callback: () => void): IDisposable {
return scheduleAtNextAnimationFrame(targetWindow, callback, 10000 /* must be early */);
}
export function modify(callback: () => void, targetWindow: Window): IDisposable {
return scheduleAtNextAnimationFrame(callback, targetWindow, -10000 /* must be late */);
export function modify(targetWindow: Window, callback: () => void): IDisposable {
return scheduleAtNextAnimationFrame(targetWindow, callback, -10000 /* must be late */);
}
/**
@@ -798,12 +850,12 @@ export function getActiveDocument(): Document {
}
const documents = Array.from(getWindows()).map(({ window }) => window.document);
return documents.find(document => document.hasFocus()) ?? document;
return documents.find(doc => doc.hasFocus()) ?? document;
}
export function getActiveWindow(): CodeWindow {
const document = getActiveDocument();
return (document.defaultView?.window ?? window) as CodeWindow;
return (document.defaultView?.window ?? mainWindow) as CodeWindow;
}
export function getWindow(element: Node | undefined | null): CodeWindow;
@@ -819,7 +871,7 @@ export function getWindow(e: unknown): CodeWindow {
return candidateEvent.view.window as CodeWindow;
}
return window as CodeWindow;
return mainWindow;
}
export function focusWindow(element: Node): void {
@@ -829,7 +881,13 @@ export function focusWindow(element: Node): void {
}
}
export function createStyleSheet(container: HTMLElement = document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement {
const globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>();
export function isGlobalStylesheet(node: Node): boolean {
return globalStylesheets.has(node as HTMLStyleElement);
}
export function createStyleSheet(container: HTMLElement = mainWindow.document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement {
const style = document.createElement('style');
style.type = 'text/css';
style.media = 'screen';
@@ -842,38 +900,34 @@ export function createStyleSheet(container: HTMLElement = document.head, beforeA
// With <head> as container, the stylesheet becomes global and is tracked
// to support auxiliary windows to clone the stylesheet.
if (container === document.head) {
if (container === mainWindow.document.head) {
const globalStylesheetClones = new Set<HTMLStyleElement>();
globalStylesheets.set(style, globalStylesheetClones);
for (const { window: targetWindow, disposables } of getWindows()) {
if (targetWindow === window) {
if (targetWindow === mainWindow) {
continue; // main window is already tracked
}
const cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, targetWindow));
const cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow));
disposableStore?.add(cloneDisposable);
}
}
return style;
}
const globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>();
export function isGlobalStylesheet(node: Node): boolean {
return globalStylesheets.has(node as HTMLStyleElement);
}
export function cloneGlobalStylesheets(targetWindow: Window): IDisposable {
const disposables = new DisposableStore();
for (const [globalStylesheet] of globalStylesheets) {
disposables.add(cloneGlobalStyleSheet(globalStylesheet, targetWindow));
for (const [globalStylesheet, clonedGlobalStylesheets] of globalStylesheets) {
disposables.add(cloneGlobalStyleSheet(globalStylesheet, clonedGlobalStylesheets, targetWindow));
}
return disposables;
}
function cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, targetWindow: Window): IDisposable {
function cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, globalStylesheetClones: Set<HTMLStyleElement>, targetWindow: Window): IDisposable {
const disposables = new DisposableStore();
const clone = globalStylesheet.cloneNode(true) as HTMLStyleElement;
@@ -888,13 +942,8 @@ function cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, targetWindow:
clone.textContent = globalStylesheet.textContent;
}));
let clonedGlobalStylesheets = globalStylesheets.get(globalStylesheet);
if (!clonedGlobalStylesheets) {
clonedGlobalStylesheets = new Set<HTMLStyleElement>();
globalStylesheets.set(globalStylesheet, clonedGlobalStylesheets);
}
clonedGlobalStylesheets.add(clone);
disposables.add(toDisposable(() => clonedGlobalStylesheets?.delete(clone)));
globalStylesheetClones.add(clone);
disposables.add(toDisposable(() => globalStylesheetClones.delete(clone)));
return disposables;
}
@@ -952,7 +1001,7 @@ export const sharedMutationObserver = new class {
}
};
export function createMetaElement(container: HTMLElement = document.head): HTMLMetaElement {
export function createMetaElement(container: HTMLElement = mainWindow.document.head): HTMLMetaElement {
const meta = document.createElement('meta');
container.appendChild(meta);
return meta;
@@ -1183,7 +1232,7 @@ class FocusTracker extends Disposable implements IFocusTracker {
const onBlur = () => {
if (hasFocus) {
loosingFocus = true;
window.setTimeout(() => {
(element instanceof HTMLElement ? getWindow(element) : element).setTimeout(() => {
if (loosingFocus) {
loosingFocus = false;
hasFocus = false;
@@ -1441,7 +1490,7 @@ export function windowOpenNoOpener(url: string): void {
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/open#noopener
// However, this also doesn't allow us to realize if the browser blocked
// the creation of the window.
window.open(url, '_blank', 'noopener');
mainWindow.open(url, '_blank', 'noopener');
}
/**
@@ -1457,9 +1506,9 @@ export function windowOpenNoOpener(url: string): void {
*/
const popupWidth = 780, popupHeight = 640;
export function windowOpenPopup(url: string): void {
const left = Math.floor(window.screenLeft + window.innerWidth / 2 - popupWidth / 2);
const top = Math.floor(window.screenTop + window.innerHeight / 2 - popupHeight / 2);
window.open(
const left = Math.floor(mainWindow.screenLeft + mainWindow.innerWidth / 2 - popupWidth / 2);
const top = Math.floor(mainWindow.screenTop + mainWindow.innerHeight / 2 - popupHeight / 2);
mainWindow.open(
url,
'_blank',
`width=${popupWidth},height=${popupHeight},top=${top},left=${left}`
@@ -1482,7 +1531,7 @@ export function windowOpenPopup(url: string): void {
* @returns boolean indicating if the {@link window.open} call succeeded
*/
export function windowOpenWithSuccess(url: string, noOpener = true): boolean {
const newTab = window.open();
const newTab = mainWindow.open();
if (newTab) {
if (noOpener) {
// see `windowOpenNoOpener` for details on why this is important
@@ -1494,17 +1543,17 @@ export function windowOpenWithSuccess(url: string, noOpener = true): boolean {
return false;
}
export function animate(fn: () => void, targetWindow: Window): IDisposable {
export function animate(targetWindow: Window, fn: () => void): IDisposable {
const step = () => {
fn();
stepDisposable = scheduleAtNextAnimationFrame(step, targetWindow);
stepDisposable = scheduleAtNextAnimationFrame(targetWindow, step);
};
let stepDisposable = scheduleAtNextAnimationFrame(step, targetWindow);
let stepDisposable = scheduleAtNextAnimationFrame(targetWindow, step);
return toDisposable(() => stepDisposable.dispose());
}
RemoteAuthorities.setPreferredWebSchema(/^https:/.test(window.location.href) ? 'https' : 'http');
RemoteAuthorities.setPreferredWebSchema(/^https:/.test(mainWindow.location.href) ? 'https' : 'http');
/**
* returns url('...')
@@ -1554,14 +1603,15 @@ export function triggerDownload(dataOrUri: Uint8Array | URI, name: string): void
// to be creating a <a> element with download attribute that
// points to the file to download.
// See also https://developers.google.com/web/updates/2011/08/Downloading-resources-in-HTML5-a-download
const activeWindow = getActiveWindow();
const anchor = document.createElement('a');
document.body.appendChild(anchor);
activeWindow.document.body.appendChild(anchor);
anchor.download = name;
anchor.href = url;
anchor.click();
// Ensure to remove the element from DOM eventually
setTimeout(() => document.body.removeChild(anchor));
setTimeout(() => activeWindow.document.body.removeChild(anchor));
}
export function triggerUpload(): Promise<FileList | undefined> {
@@ -1570,8 +1620,9 @@ export function triggerUpload(): Promise<FileList | undefined> {
// In order to upload to the browser, create a
// input element of type `file` and click it
// to gather the selected files
const activeWindow = getActiveWindow();
const input = document.createElement('input');
document.body.appendChild(input);
activeWindow.document.body.appendChild(input);
input.type = 'file';
input.multiple = true;
@@ -1583,7 +1634,7 @@ export function triggerUpload(): Promise<FileList | undefined> {
input.click();
// Ensure to remove the element from DOM eventually
setTimeout(() => document.body.removeChild(input));
setTimeout(() => activeWindow.document.body.removeChild(input));
});
}
@@ -1616,10 +1667,10 @@ export interface IDetectedFullscreen {
guess: boolean;
}
export function detectFullscreen(): IDetectedFullscreen | null {
export function detectFullscreen(targetWindow: Window): IDetectedFullscreen | null {
// Browser fullscreen: use DOM APIs to detect
if (document.fullscreenElement || (<any>document).webkitFullscreenElement || (<any>document).webkitIsFullScreen) {
if (targetWindow.document.fullscreenElement || (<any>targetWindow.document).webkitFullscreenElement || (<any>targetWindow.document).webkitIsFullScreen) {
return { mode: DetectedFullscreenMode.DOCUMENT, guess: false };
}
@@ -1628,7 +1679,7 @@ export function detectFullscreen(): IDetectedFullscreen | null {
// height and comparing that to window height, we can guess
// it though.
if (window.innerHeight === screen.height) {
if (targetWindow.innerHeight === targetWindow.screen.height) {
// if the height of the window matches the screen height, we can
// safely assume that the browser is fullscreen because no browser
// chrome is taking height away (e.g. like toolbars).
@@ -1637,7 +1688,7 @@ export function detectFullscreen(): IDetectedFullscreen | null {
if (platform.isMacintosh || platform.isLinux) {
// macOS and Linux do not properly report `innerHeight`, only Windows does
if (window.outerHeight === screen.height && window.outerWidth === screen.width) {
if (targetWindow.outerHeight === targetWindow.screen.height && targetWindow.outerWidth === targetWindow.screen.width) {
// if the height of the browser matches the screen height, we can
// only guess that we are in fullscreen. It is also possible that
// the user has turned off taskbars in the OS and the browser is
@@ -1842,7 +1893,7 @@ export class ModifierKeyEmitter extends event.Emitter<IModifierKeyStatus> {
metaKey: false
};
this._subscriptions.add(event.Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => this.registerListeners(window, disposables), { window, disposables: this._subscriptions }));
this._subscriptions.add(event.Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => this.registerListeners(window, disposables), { window: mainWindow, disposables: this._subscriptions }));
}
private registerListeners(window: Window, disposables: DisposableStore): void {
@@ -1980,10 +2031,12 @@ export function getCookieValue(name: string): string | undefined {
}
export interface IDragAndDropObserverCallbacks {
readonly onDragEnter: (e: DragEvent) => void;
readonly onDragLeave: (e: DragEvent) => void;
readonly onDrop: (e: DragEvent) => void;
readonly onDragEnd: (e: DragEvent) => void;
readonly onDragEnter?: (e: DragEvent) => void;
readonly onDragLeave?: (e: DragEvent) => void;
readonly onDrop?: (e: DragEvent) => void;
readonly onDragEnd?: (e: DragEvent) => void;
readonly onDragStart?: (e: DragEvent) => void;
readonly onDrag?: (e: DragEvent) => void;
readonly onDragOver?: (e: DragEvent, dragDuration: number) => void;
}
@@ -2005,11 +2058,23 @@ export class DragAndDropObserver extends Disposable {
}
private registerListeners(): void {
if (this.callbacks.onDragStart) {
this._register(addDisposableListener(this.element, EventType.DRAG_START, (e: DragEvent) => {
this.callbacks.onDragStart?.(e);
}));
}
if (this.callbacks.onDrag) {
this._register(addDisposableListener(this.element, EventType.DRAG, (e: DragEvent) => {
this.callbacks.onDrag?.(e);
}));
}
this._register(addDisposableListener(this.element, EventType.DRAG_ENTER, (e: DragEvent) => {
this.counter++;
this.dragStartTime = e.timeStamp;
this.callbacks.onDragEnter(e);
this.callbacks.onDragEnter?.(e);
}));
this._register(addDisposableListener(this.element, EventType.DRAG_OVER, (e: DragEvent) => {
@@ -2024,7 +2089,7 @@ export class DragAndDropObserver extends Disposable {
if (this.counter === 0) {
this.dragStartTime = 0;
this.callbacks.onDragLeave(e);
this.callbacks.onDragLeave?.(e);
}
}));
@@ -2032,14 +2097,14 @@ export class DragAndDropObserver extends Disposable {
this.counter = 0;
this.dragStartTime = 0;
this.callbacks.onDragEnd(e);
this.callbacks.onDragEnd?.(e);
}));
this._register(addDisposableListener(this.element, EventType.DROP, (e: DragEvent) => {
this.counter = 0;
this.dragStartTime = 0;
this.callbacks.onDrop(e);
this.callbacks.onDrop?.(e);
}));
}
}
+20 -33
View File
@@ -6,19 +6,18 @@
/**
* Represents a window in a possible chain of iframes
*/
export interface IWindowChainElement {
interface IWindowChainElement {
/**
* The window object for it
*/
window: Window;
readonly window: WeakRef<Window>;
/**
* The iframe element inside the window.parent corresponding to window
*/
iframeElement: Element | null;
readonly iframeElement: Element | null;
}
let hasDifferentOriginAncestorFlag: boolean = false;
let sameOriginWindowChainCache: IWindowChainElement[] | null = null;
const sameOriginWindowChainCache = new WeakMap<Window, IWindowChainElement[] | null>();
function getParentWindowIfSameOrigin(w: Window): Window | null {
if (!w.parent || w.parent === w) {
@@ -30,11 +29,9 @@ function getParentWindowIfSameOrigin(w: Window): Window | null {
const location = w.location;
const parentLocation = w.parent.location;
if (location.origin !== 'null' && parentLocation.origin !== 'null' && location.origin !== parentLocation.origin) {
hasDifferentOriginAncestorFlag = true;
return null;
}
} catch (e) {
hasDifferentOriginAncestorFlag = true;
return null;
}
@@ -46,41 +43,31 @@ export class IframeUtils {
/**
* Returns a chain of embedded windows with the same origin (which can be accessed programmatically).
* Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin.
* To distinguish if at one point the current execution environment is running inside a window with a different origin, see hasDifferentOriginAncestor()
*/
public static getSameOriginWindowChain(): IWindowChainElement[] {
if (!sameOriginWindowChainCache) {
sameOriginWindowChainCache = [];
let w: Window | null = window;
private static getSameOriginWindowChain(targetWindow: Window): IWindowChainElement[] {
let windowChainCache = sameOriginWindowChainCache.get(targetWindow);
if (!windowChainCache) {
windowChainCache = [];
sameOriginWindowChainCache.set(targetWindow, windowChainCache);
let w: Window | null = targetWindow;
let parent: Window | null;
do {
parent = getParentWindowIfSameOrigin(w);
if (parent) {
sameOriginWindowChainCache.push({
window: w,
windowChainCache.push({
window: new WeakRef(w),
iframeElement: w.frameElement || null
});
} else {
sameOriginWindowChainCache.push({
window: w,
windowChainCache.push({
window: new WeakRef(w),
iframeElement: null
});
}
w = parent;
} while (w);
}
return sameOriginWindowChainCache.slice(0);
}
/**
* Returns true if the current execution environment is chained in a list of iframes which at one point ends in a window with a different origin.
* Returns false if the current execution environment is not running inside an iframe or if the entire chain of iframes have the same origin.
*/
public static hasDifferentOriginAncestor(): boolean {
if (!sameOriginWindowChainCache) {
this.getSameOriginWindowChain();
}
return hasDifferentOriginAncestorFlag;
return windowChainCache.slice(0);
}
/**
@@ -97,14 +84,14 @@ export class IframeUtils {
let top = 0, left = 0;
const windowChain = this.getSameOriginWindowChain();
const windowChain = this.getSameOriginWindowChain(childWindow);
for (const windowChainEl of windowChain) {
const windowInChain = windowChainEl.window.deref();
top += windowInChain?.scrollY ?? 0;
left += windowInChain?.scrollX ?? 0;
top += windowChainEl.window.scrollY;
left += windowChainEl.window.scrollX;
if (windowChainEl.window === ancestorWindow) {
if (windowInChain === ancestorWindow) {
break;
}
+4 -4
View File
@@ -54,7 +54,7 @@ export class IndexedDB {
private static doOpenDatabase(name: string, version: number | undefined, stores: string[]): Promise<IDBDatabase> {
return new Promise((c, e) => {
const request = window.indexedDB.open(name, version);
const request = indexedDB.open(name, version);
request.onerror = () => e(request.error);
request.onsuccess = () => {
const db = request.result;
@@ -78,13 +78,13 @@ export class IndexedDB {
});
}
private static deleteDatabase(indexedDB: IDBDatabase): Promise<void> {
private static deleteDatabase(database: IDBDatabase): Promise<void> {
return new Promise((c, e) => {
// Close any opened connections
indexedDB.close();
database.close();
// Delete the db
const deleteRequest = window.indexedDB.deleteDatabase(indexedDB.name);
const deleteRequest = indexedDB.deleteDatabase(database.name);
deleteRequest.onerror = (err) => e(deleteRequest.error);
deleteRequest.onsuccess = () => c();
});
+1 -1
View File
@@ -195,7 +195,7 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
const onClick = options.actionHandler.disposables.add(new DomEmitter(element, 'click'));
const onAuxClick = options.actionHandler.disposables.add(new DomEmitter(element, 'auxclick'));
options.actionHandler.disposables.add(Event.any(onClick.event, onAuxClick.event)(e => {
const mouseEvent = new StandardMouseEvent(e);
const mouseEvent = new StandardMouseEvent(DOM.getWindow(element), e);
if (!mouseEvent.leftButton && !mouseEvent.middleButton) {
return;
}
+4 -4
View File
@@ -45,7 +45,7 @@ export class StandardMouseEvent implements IMouseEvent {
public readonly metaKey: boolean;
public readonly timestamp: number;
constructor(e: MouseEvent) {
constructor(targetWindow: Window, e: MouseEvent) {
this.timestamp = Date.now();
this.browserEvent = e;
this.leftButton = e.button === 0;
@@ -74,7 +74,7 @@ export class StandardMouseEvent implements IMouseEvent {
}
// Find the position of the iframe this code is executing in relative to the iframe where the event was captured.
const iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(window, e.view);
const iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view);
this.posx -= iframeOffsets.left;
this.posy -= iframeOffsets.top;
}
@@ -92,8 +92,8 @@ export class DragMouseEvent extends StandardMouseEvent {
public readonly dataTransfer: DataTransfer;
constructor(e: MouseEvent) {
super(e);
constructor(targetWindow: Window, e: MouseEvent) {
super(targetWindow, e);
this.dataTransfer = (<any>e).dataTransfer;
}
}
+5 -4
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as DomUtils from 'vs/base/browser/dom';
import { mainWindow } from 'vs/base/browser/window';
import * as arrays from 'vs/base/common/arrays';
import { memoize } from 'vs/base/common/decorators';
import { Event as EventUtils } from 'vs/base/common/event';
@@ -95,7 +96,7 @@ export class Gesture extends Disposable {
disposables.add(DomUtils.addDisposableListener(window.document, 'touchstart', (e: TouchEvent) => this.onTouchStart(e), { passive: false }));
disposables.add(DomUtils.addDisposableListener(window.document, 'touchend', (e: TouchEvent) => this.onTouchEnd(window, e)));
disposables.add(DomUtils.addDisposableListener(window.document, 'touchmove', (e: TouchEvent) => this.onTouchMove(e), { passive: false }));
}, { window, disposables: this._store }));
}, { window: mainWindow, disposables: this._store }));
}
public static addTarget(element: HTMLElement): IDisposable {
@@ -126,7 +127,7 @@ export class Gesture extends Disposable {
static isTouchDevice(): boolean {
// `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be
// `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
return 'ontouchstart' in mainWindow || navigator.maxTouchPoints > 0;
}
public override dispose(): void {
@@ -283,7 +284,7 @@ export class Gesture extends Disposable {
}
private inertia(targetWindow: Window, dispatchTo: readonly EventTarget[], t1: number, vX: number, dirX: number, x: number, vY: number, dirY: number, y: number): void {
this.handle = DomUtils.scheduleAtNextAnimationFrame(() => {
this.handle = DomUtils.scheduleAtNextAnimationFrame(targetWindow, () => {
const now = Date.now();
// velocity: old speed + accel_over_time
@@ -313,7 +314,7 @@ export class Gesture extends Disposable {
if (!stopped) {
this.inertia(targetWindow, dispatchTo, now, vX, dirX, x + delta_pos_x, vY, dirY, y + delta_pos_y);
}
}, targetWindow);
});
}
private onTouchMove(e: TouchEvent): void {
+2 -1
View File
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mainWindow } from 'vs/base/browser/window';
import { onUnexpectedError } from 'vs/base/common/errors';
export function createTrustedTypesPolicy<Options extends TrustedTypePolicyOptions>(
@@ -27,7 +28,7 @@ export function createTrustedTypesPolicy<Options extends TrustedTypePolicyOption
}
}
try {
return window.trustedTypes?.createPolicy(policyName, policyOptions);
return mainWindow.trustedTypes?.createPolicy(policyName, policyOptions);
} catch (err) {
onUnexpectedError(err);
return undefined;
@@ -123,23 +123,23 @@ export class BreadcrumbsWidget {
private _updateDimensions(dim: dom.Dimension): IDisposable {
const disposables = new DisposableStore();
disposables.add(dom.modify(() => {
disposables.add(dom.modify(dom.getWindow(this._domNode), () => {
this._dimension = dim;
this._domNode.style.width = `${dim.width}px`;
this._domNode.style.height = `${dim.height}px`;
disposables.add(this._updateScrollbar());
}, dom.getWindow(this._domNode)));
}));
return disposables;
}
private _updateScrollbar(): IDisposable {
return dom.measure(() => {
dom.measure(() => { // double RAF
return dom.measure(dom.getWindow(this._domNode), () => {
dom.measure(dom.getWindow(this._domNode), () => { // double RAF
this._scrollable.setRevealOnScroll(false);
this._scrollable.scanDomNode();
this._scrollable.setRevealOnScroll(true);
}, dom.getWindow(this._domNode));
}, dom.getWindow(this._domNode));
});
});
}
private _style(styleElement: HTMLStyleElement, style: IBreadcrumbsWidgetStyles): void {
@@ -203,7 +203,7 @@ export class ActionWithDropdownActionViewItem extends ActionViewItem {
separator.classList.toggle('prominent', menuActionClassNames.includes('prominent'));
append(this.element, separator);
this.dropdownMenuActionViewItem = new DropdownMenuActionViewItem(this._register(new Action('dropdownAction', nls.localize('moreActions', "More Actions..."))), menuActionsProvider, this.contextMenuProvider, { classNames: ['dropdown', ...ThemeIcon.asClassNameArray(Codicon.dropDownButton), ...menuActionClassNames] });
this.dropdownMenuActionViewItem = this._register(new DropdownMenuActionViewItem(this._register(new Action('dropdownAction', nls.localize('moreActions', "More Actions..."))), menuActionsProvider, this.contextMenuProvider, { classNames: ['dropdown', ...ThemeIcon.asClassNameArray(Codicon.dropDownButton), ...menuActionClassNames] }));
this.dropdownMenuActionViewItem.render(this.element);
this._register(addDisposableListener(this.element, EventType.KEY_DOWN, e => {
+5 -5
View File
@@ -407,7 +407,7 @@ export class ListView<T> implements IListView<T> {
this.scrollable = this.disposables.add(new Scrollable({
forceIntegerValues: true,
smoothScrollDuration: (options.smoothScrolling ?? false) ? 125 : 0,
scheduleAtNextAnimationFrame: cb => scheduleAtNextAnimationFrame(cb, getWindow(this.domNode))
scheduleAtNextAnimationFrame: cb => scheduleAtNextAnimationFrame(getWindow(this.domNode), cb)
}));
this.scrollableElement = this.disposables.add(new SmoothScrollableElement(this.rowsContainer, {
alwaysConsumeMouseWheel: options.alwaysConsumeMouseWheel ?? DefaultOptions.alwaysConsumeMouseWheel,
@@ -680,11 +680,11 @@ export class ListView<T> implements IListView<T> {
this.rowsContainer.style.height = `${this._scrollHeight}px`;
if (!this.scrollableElementUpdateDisposable) {
this.scrollableElementUpdateDisposable = scheduleAtNextAnimationFrame(() => {
this.scrollableElementUpdateDisposable = scheduleAtNextAnimationFrame(getWindow(this.domNode), () => {
this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight });
this.updateScrollWidth();
this.scrollableElementUpdateDisposable = null;
}, getWindow(this.domNode));
});
}
}
@@ -940,7 +940,7 @@ export class ListView<T> implements IListView<T> {
item.row.domNode.style.width = 'fit-content';
item.width = getContentWidth(item.row.domNode);
const style = window.getComputedStyle(item.row.domNode);
const style = getWindow(item.row.domNode).getComputedStyle(item.row.domNode);
if (style.paddingLeft) {
item.width += parseFloat(style.paddingLeft);
@@ -1291,7 +1291,7 @@ export class ListView<T> implements IListView<T> {
private setupDragAndDropScrollTopAnimation(event: DragEvent): void {
if (!this.dragOverAnimationDisposable) {
const viewTop = getTopLeftOffset(this.domNode).top;
this.dragOverAnimationDisposable = animate(this.animateDragAndDropScrollTop.bind(this, viewTop), getWindow(this.domNode));
this.dragOverAnimationDisposable = animate(getWindow(this.domNode), this.animateDragAndDropScrollTop.bind(this, viewTop));
}
this.dragOverAnimationStopDisposable.dispose();
+3 -3
View File
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { IDragAndDropData } from 'vs/base/browser/dnd';
import { asCssValueWithDefault, createStyleSheet, Dimension, EventHelper, getActiveElement, isActiveElement, isMouseEvent } from 'vs/base/browser/dom';
import { asCssValueWithDefault, createStyleSheet, Dimension, EventHelper, getActiveElement, getWindow, isActiveElement, isMouseEvent } from 'vs/base/browser/dom';
import { DomEmitter } from 'vs/base/browser/event';
import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { Gesture } from 'vs/base/browser/touch';
@@ -618,7 +618,7 @@ class DOMFocusController<T> implements IDisposable {
return;
}
const style = window.getComputedStyle(tabIndexElement);
const style = getWindow(tabIndexElement).getComputedStyle(tabIndexElement);
if (style.visibility === 'hidden' || style.display === 'none') {
return;
}
@@ -1390,7 +1390,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
const fromMouse = Event.chain(this.view.onContextMenu, $ =>
$.filter(_ => !didJustPressContextMenuKey)
.map(({ element, index, browserEvent }) => ({ element, index, anchor: new StandardMouseEvent(browserEvent), browserEvent }))
.map(({ element, index, browserEvent }) => ({ element, index, anchor: new StandardMouseEvent(getWindow(this.view.domNode), browserEvent), browserEvent }))
);
return Event.any<IListContextMenuEvent<T>>(fromKeyDown, fromKeyUp, fromMouse);
+2 -2
View File
@@ -478,7 +478,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
// => to get the Copy and Paste context menu actions working on Firefox,
// there should be no timeout here
if (isFirefox) {
const mouseEvent = new StandardMouseEvent(e);
const mouseEvent = new StandardMouseEvent(getWindow(this.element), e);
// Allowing right click to trigger the event causes the issue described below,
// but since the solution below does not work in FF, we must disable right click
@@ -876,7 +876,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
// Set the top value of the menu container before construction
// This allows the menu constructor to calculate the proper max height
const computedStyles = getComputedStyle(this.parentData.parent.domNode);
const computedStyles = getWindow(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode);
const paddingTop = parseFloat(computedStyles.paddingTop || '0') || 0;
// this.submenuContainer.style.top = `${this.element.offsetTop - this.parentData.parent.scrollOffset - paddingTop}px`;
this.submenuContainer.style.zIndex = '1';
+4 -4
View File
@@ -258,7 +258,7 @@ export class MenuBar extends Disposable {
this._register(DOM.addDisposableListener(buttonElement, DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => {
// Ignore non-left-click
const mouseEvent = new StandardMouseEvent(e);
const mouseEvent = new StandardMouseEvent(DOM.getWindow(buttonElement), e);
if (!mouseEvent.leftButton) {
e.preventDefault();
return;
@@ -367,7 +367,7 @@ export class MenuBar extends Disposable {
this._register(DOM.addDisposableListener(buttonElement, DOM.EventType.MOUSE_DOWN, (e) => {
// Ignore non-left-click
const mouseEvent = new StandardMouseEvent(e);
const mouseEvent = new StandardMouseEvent(DOM.getWindow(buttonElement), e);
if (!mouseEvent.leftButton) {
e.preventDefault();
return;
@@ -627,10 +627,10 @@ export class MenuBar extends Disposable {
});
if (!this.overflowLayoutScheduled) {
this.overflowLayoutScheduled = DOM.scheduleAtNextAnimationFrame(() => {
this.overflowLayoutScheduled = DOM.scheduleAtNextAnimationFrame(DOM.getWindow(this.container), () => {
this.updateOverflowAction();
this.overflowLayoutScheduled = undefined;
}, DOM.getWindow(this.container));
});
}
this.setUnfocusedState();
@@ -576,7 +576,7 @@ export class ScrollableElement extends AbstractScrollableElement {
const scrollable = new Scrollable({
forceIntegerValues: true,
smoothScrollDuration: 0,
scheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(callback, dom.getWindow(element))
scheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(dom.getWindow(element), callback)
});
super(element, options, scrollable);
this._register(scrollable);
@@ -621,7 +621,7 @@ export class DomScrollableElement extends AbstractScrollableElement {
const scrollable = new Scrollable({
forceIntegerValues: false, // See https://github.com/microsoft/vscode/issues/139877
smoothScrollDuration: 0,
scheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(callback, dom.getWindow(element))
scheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(dom.getWindow(element), callback)
});
super(element, options, scrollable);
this._register(scrollable);
@@ -5,7 +5,7 @@
import { GlobalPointerMoveMonitor } from 'vs/base/browser/globalPointerMoveMonitor';
import { Widget } from 'vs/base/browser/ui/widget';
import { IntervalTimer, TimeoutTimer } from 'vs/base/common/async';
import { TimeoutTimer } from 'vs/base/common/async';
import { ThemeIcon } from 'vs/base/common/themables';
import * as dom from 'vs/base/browser/dom';
@@ -33,7 +33,7 @@ export class ScrollbarArrow extends Widget {
private _onActivate: () => void;
public bgDomNode: HTMLElement;
public domNode: HTMLElement;
private _pointerdownRepeatTimer: IntervalTimer;
private _pointerdownRepeatTimer: dom.WindowIntervalTimer;
private _pointerdownScheduleRepeatTimer: TimeoutTimer;
private _pointerMoveMonitor: GlobalPointerMoveMonitor;
@@ -83,7 +83,7 @@ export class ScrollbarArrow extends Widget {
this._register(dom.addStandardDisposableListener(this.bgDomNode, dom.EventType.POINTER_DOWN, (e) => this._arrowPointerDown(e)));
this._register(dom.addStandardDisposableListener(this.domNode, dom.EventType.POINTER_DOWN, (e) => this._arrowPointerDown(e)));
this._pointerdownRepeatTimer = this._register(new IntervalTimer());
this._pointerdownRepeatTimer = this._register(new dom.WindowIntervalTimer());
this._pointerdownScheduleRepeatTimer = this._register(new TimeoutTimer());
}
@@ -92,7 +92,7 @@ export class ScrollbarArrow extends Widget {
return;
}
const scheduleRepeater = () => {
this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1000 / 24);
this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1000 / 24, dom.getWindow(e));
};
this._onActivate();
@@ -547,7 +547,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
const window = dom.getWindow(this.selectElement);
const selectPosition = dom.getDomNodePagePosition(this.selectElement);
const styles = getComputedStyle(this.selectElement);
const styles = dom.getWindow(this.selectElement).getComputedStyle(this.selectElement);
const verticalPadding = parseFloat(styles.getPropertyValue('--dropdown-padding-top')) + parseFloat(styles.getPropertyValue('--dropdown-padding-bottom'));
const maxSelectDropDownHeightBelow = (window.innerHeight - selectPosition.top - selectPosition.height - (this.selectBoxOptions.minBottomMargin || 0));
const maxSelectDropDownHeightAbove = (selectPosition.top - SelectBoxList.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN);
+5 -5
View File
@@ -5,7 +5,7 @@
import { isFirefox } from 'vs/base/browser/browser';
import { DataTransfers } from 'vs/base/browser/dnd';
import { $, addDisposableListener, append, clearNode, EventHelper, EventType, trackFocus } from 'vs/base/browser/dom';
import { $, addDisposableListener, append, clearNode, EventHelper, EventType, getWindow, trackFocus } from 'vs/base/browser/dom';
import { DomEmitter } from 'vs/base/browser/event';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';
@@ -175,11 +175,11 @@ export abstract class Pane extends Disposable implements IView {
}
if (typeof this.animationTimer === 'number') {
clearTimeout(this.animationTimer);
getWindow(this.element).clearTimeout(this.animationTimer);
}
append(this.element, this.body);
} else {
this.animationTimer = window.setTimeout(() => {
this.animationTimer = getWindow(this.element).setTimeout(() => {
this.body.remove();
}, 200);
}
@@ -636,12 +636,12 @@ export class PaneView extends Disposable {
private setupAnimation(): void {
if (typeof this.animationTimer === 'number') {
window.clearTimeout(this.animationTimer);
getWindow(this.element).clearTimeout(this.animationTimer);
}
this.element.classList.add('animated');
this.animationTimer = window.setTimeout(() => {
this.animationTimer = getWindow(this.element).setTimeout(() => {
this.animationTimer = undefined;
this.element.classList.remove('animated');
}, 200);
@@ -584,7 +584,7 @@ export class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutCo
this.scrollable = this._register(new Scrollable({
forceIntegerValues: true,
smoothScrollDuration: 125,
scheduleAtNextAnimationFrame: callback => scheduleAtNextAnimationFrame(callback, getWindow(this.el)),
scheduleAtNextAnimationFrame: callback => scheduleAtNextAnimationFrame(getWindow(this.el), callback),
}));
this.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, {
vertical: this.orientation === Orientation.VERTICAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden,
+4 -4
View File
@@ -12,19 +12,19 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
export abstract class Widget extends Disposable {
protected onclick(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {
this._register(dom.addDisposableListener(domNode, dom.EventType.CLICK, (e: MouseEvent) => listener(new StandardMouseEvent(e))));
this._register(dom.addDisposableListener(domNode, dom.EventType.CLICK, (e: MouseEvent) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));
}
protected onmousedown(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {
this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => listener(new StandardMouseEvent(e))));
this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));
}
protected onmouseover(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {
this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_OVER, (e: MouseEvent) => listener(new StandardMouseEvent(e))));
this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_OVER, (e: MouseEvent) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));
}
protected onmouseleave(domNode: HTMLElement, listener: (e: IMouseEvent) => void): void {
this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_LEAVE, (e: MouseEvent) => listener(new StandardMouseEvent(e))));
this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_LEAVE, (e: MouseEvent) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));
}
protected onkeydown(domNode: HTMLElement, listener: (e: IKeyboardEvent) => void): void {
+18
View File
@@ -0,0 +1,18 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export type CodeWindow = Window & typeof globalThis & {
readonly vscodeWindowId: number;
};
// eslint-disable-next-line no-restricted-globals
export const mainWindow = window as CodeWindow;
/**
* @deprecated to support multi-window scenarios, use `DOM.mainWindow`
* if you target the main global window or use helpers such as `DOM.getWindow()`
* or `DOM.getActiveWindow()` to obtain the correct window for the context you are in.
*/
export const $window = mainWindow;
+49 -48
View File
@@ -522,20 +522,6 @@ export function disposableTimeout(handler: () => void, timeout = 0, store?: Disp
return disposable;
}
export function disposableInterval(handler: () => boolean /* stop interval */, interval: number, iterations: number): IDisposable {
let iteration = 0;
const timer = setInterval(() => {
iteration++;
if (iteration >= iterations || handler()) {
disposable.dispose();
}
}, interval);
const disposable = toDisposable(() => {
clearInterval(timer);
});
return disposable;
}
/**
* Runs the provided list of promise factories in sequential order. The returned
* promise will complete to an array of results from each promise.
@@ -894,29 +880,28 @@ export class TimeoutTimer implements IDisposable {
export class IntervalTimer implements IDisposable {
private _token: any;
private disposable: IDisposable | undefined = undefined;
constructor() {
this._token = -1;
cancel(): void {
this.disposable?.dispose();
this.disposable = undefined;
}
cancelAndSet(runner: () => void, interval: number, context = globalThis): void {
this.cancel();
const handle = context.setInterval(() => {
runner();
}, interval);
this.disposable = toDisposable(() => {
context.clearInterval(handle);
this.disposable = undefined;
});
}
dispose(): void {
this.cancel();
}
cancel(): void {
if (this._token !== -1) {
clearInterval(this._token);
this._token = -1;
}
}
cancelAndSet(runner: () => void, interval: number): void {
this.cancel();
this._token = setInterval(() => {
runner();
}, interval);
}
}
export class RunOnceScheduler implements IDisposable {
@@ -1220,6 +1205,9 @@ export interface IdleDeadline {
timeRemaining(): number;
}
type IdleApi = Pick<typeof globalThis, 'requestIdleCallback' | 'cancelIdleCallback'>;
/**
* Execute the callback the next time the browser is idle, returning an
* {@link IDisposable} that will cancel the callback when disposed. This wraps
@@ -1237,26 +1225,29 @@ export interface IdleDeadline {
* [IdleDeadline]: https://developer.mozilla.org/en-US/docs/Web/API/IdleDeadline
* [requestIdleCallback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
* [setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout
*
* **Note** that there is `dom.ts#runWhenWindowIdle` which is better suited when running inside a browser
* context
*/
export let runWhenIdle: (callback: (idle: IdleDeadline) => void, timeout?: number) => IDisposable;
export let runWhenGlobalIdle: (callback: (idle: IdleDeadline) => void, timeout?: number) => IDisposable;
declare function requestIdleCallback(callback: (args: IdleDeadline) => void, options?: { timeout: number }): number;
declare function cancelIdleCallback(handle: number): void;
export let _runWhenIdle: (targetWindow: IdleApi, callback: (idle: IdleDeadline) => void, timeout?: number) => IDisposable;
(function () {
if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') {
runWhenIdle = (runner) => {
if (typeof globalThis.requestIdleCallback !== 'function' || typeof globalThis.cancelIdleCallback !== 'function') {
_runWhenIdle = (_targetWindow, runner) => {
setTimeout0(() => {
if (disposed) {
return;
}
const end = Date.now() + 15; // one frame at 64fps
runner(Object.freeze({
const deadline: IdleDeadline = {
didTimeout: true,
timeRemaining() {
return Math.max(0, end - Date.now());
}
}));
};
runner(Object.freeze(deadline));
});
let disposed = false;
return {
@@ -1269,8 +1260,8 @@ declare function cancelIdleCallback(handle: number): void;
};
};
} else {
runWhenIdle = (runner, timeout?) => {
const handle: number = requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);
_runWhenIdle = (targetWindow: IdleApi, runner, timeout?) => {
const handle: number = targetWindow.requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);
let disposed = false;
return {
dispose() {
@@ -1278,18 +1269,15 @@ declare function cancelIdleCallback(handle: number): void;
return;
}
disposed = true;
cancelIdleCallback(handle);
targetWindow.cancelIdleCallback(handle);
}
};
};
}
runWhenGlobalIdle = (runner) => _runWhenIdle(globalThis, runner);
})();
/**
* An implementation of the "idle-until-urgent"-strategy as introduced
* here: https://philipwalton.com/articles/idle-until-urgent/
*/
export class IdleValue<T> {
export abstract class AbstractIdleValue<T> {
private readonly _executor: () => void;
private readonly _handle: IDisposable;
@@ -1298,7 +1286,7 @@ export class IdleValue<T> {
private _value?: T;
private _error: unknown;
constructor(executor: () => T) {
constructor(targetWindow: IdleApi, executor: () => T) {
this._executor = () => {
try {
this._value = executor();
@@ -1308,7 +1296,7 @@ export class IdleValue<T> {
this._didRun = true;
}
};
this._handle = runWhenIdle(() => this._executor());
this._handle = _runWhenIdle(targetWindow, () => this._executor());
}
dispose(): void {
@@ -1331,6 +1319,19 @@ export class IdleValue<T> {
}
}
/**
* An `IdleValue` that always uses the current window (which might be throttled or inactive)
*
* **Note** that there is `dom.ts#WindowIdleValue` which is better suited when running inside a browser
* context
*/
export class GlobalIdleValue<T> extends AbstractIdleValue<T> {
constructor(executor: () => T) {
super(globalThis, executor);
}
}
//#endregion
export async function retry<T>(task: ITask<Promise<T>>, delay: number, retries: number): Promise<T> {
+1 -1
View File
@@ -540,8 +540,8 @@ export namespace Event {
export interface IChainableSythensis<T> {
map<O>(fn: (i: T) => O): IChainableSythensis<O>;
forEach(fn: (i: T) => void): IChainableSythensis<T>;
filter<R extends T>(fn: (e: T) => e is R): IChainableSythensis<R>;
filter(fn: (e: T) => boolean): IChainableSythensis<T>;
filter<R>(fn: (e: T | R) => e is R): IChainableSythensis<R>;
reduce<R>(merge: (last: R, event: T) => R, initial: R): IChainableSythensis<R>;
reduce<R>(merge: (last: R | undefined, event: T) => R): IChainableSythensis<R>;
latch(equals?: (a: T, b: T) => boolean): IChainableSythensis<T>;
+37 -4
View File
@@ -14,7 +14,6 @@ export function registerHotReloadHandler(handler: HotReloadHandler): IDisposable
return { dispose() { } };
} else {
const handlers = registerGlobalHotReloadHandler();
handlers.add(handler);
return {
dispose() { handlers.delete(handler); }
@@ -28,7 +27,7 @@ export function registerHotReloadHandler(handler: HotReloadHandler): IDisposable
*
* If no handler can apply the new exports, the module will not be reloaded.
*/
export type HotReloadHandler = (oldExports: Record<string, unknown>) => AcceptNewExportsHandler | undefined;
export type HotReloadHandler = (args: { oldExports: Record<string, unknown>; newSrc: string }) => AcceptNewExportsHandler | undefined;
export type AcceptNewExportsHandler = (newExports: Record<string, unknown>) => boolean;
function registerGlobalHotReloadHandler() {
@@ -50,10 +49,44 @@ function registerGlobalHotReloadHandler() {
return hotReloadHandlers;
}
let hotReloadHandlers: Set<(oldExports: Record<string, unknown>) => AcceptNewExportsFn | undefined> | undefined = undefined;
let hotReloadHandlers: Set<(args: { oldExports: Record<string, unknown>; newSrc: string }) => AcceptNewExportsFn | undefined> | undefined = undefined;
interface GlobalThisAddition {
$hotReload_applyNewExports?(oldExports: Record<string, unknown>): AcceptNewExportsFn | undefined;
$hotReload_applyNewExports?(args: { oldExports: Record<string, unknown>; newSrc: string }): AcceptNewExportsFn | undefined;
}
type AcceptNewExportsFn = (newExports: Record<string, unknown>) => boolean;
if (isHotReloadEnabled()) {
// This code does not run in production.
registerHotReloadHandler(({ oldExports, newSrc }) => {
// Don't match its own source code
if (newSrc.indexOf('/* ' + 'hot-reload:patch-prototype-methods */') === -1) {
return undefined;
}
return newExports => {
for (const key in newExports) {
const exportedItem = newExports[key];
console.log(`[hot-reload] Patching prototype methods of '${key}'`, { exportedItem });
if (typeof exportedItem === 'function' && exportedItem.prototype) {
const oldExportedItem = oldExports[key];
if (oldExportedItem) {
for (const prop of Object.getOwnPropertyNames(exportedItem.prototype)) {
const descriptor = Object.getOwnPropertyDescriptor(exportedItem.prototype, prop)!;
const oldDescriptor = Object.getOwnPropertyDescriptor((oldExportedItem as any).prototype, prop);
if (descriptor?.value?.toString() !== oldDescriptor?.value?.toString()) {
console.log(`[hot-reload] Patching prototype method '${key}.${prop}'`);
}
Object.defineProperty((oldExportedItem as any).prototype, prop, descriptor);
}
newExports[key] = oldExportedItem;
}
}
}
return true;
};
});
}
+3 -3
View File
@@ -80,10 +80,10 @@ export function getPathLabel(resource: URI, formatting: IPathLabelFormatting): s
// to a user home resource. We cannot assume that the resource is
// already a user home resource.
let userHomeCandidate: string;
if (resource.scheme !== tildifier.userHome.scheme && resource.path.startsWith(posix.sep)) {
if (resource.scheme !== tildifier.userHome.scheme && resource.path[0] === posix.sep && resource.path[1] !== posix.sep) {
userHomeCandidate = tildifier.userHome.with({ path: resource.path }).fsPath;
} else {
userHomeCandidate = resource.fsPath;
userHomeCandidate = absolutePath;
}
absolutePath = tildify(userHomeCandidate, userHome, os);
@@ -108,7 +108,7 @@ function getRelativePathLabel(resource: URI, relativePathProvider: IRelativePath
// the resource belongs to, we need to make sure to convert it
// to a workspace resource. We cannot assume that the resource is
// already matching the workspace.
if (resource.scheme !== firstFolder.uri.scheme && resource.path.startsWith(posix.sep)) {
if (resource.scheme !== firstFolder.uri.scheme && resource.path[0] === posix.sep && resource.path[1] !== posix.sep) {
resource = firstFolder.uri.with({ path: resource.path });
}
+33
View File
@@ -556,6 +556,35 @@ export class MutableDisposable<T extends IDisposable> implements IDisposable {
}
}
/**
* Manages the lifecycle of a disposable value that may be changed like {@link MutableDisposable}, but the value must
* exist and cannot be undefined.
*/
export class MandatoryMutableDisposable<T extends IDisposable> implements IDisposable {
private _disposable = new MutableDisposable<T>();
private _isDisposed = false;
constructor(initialValue: T) {
this._disposable.value = initialValue;
}
get value(): T {
return this._disposable.value!;
}
set value(value: T) {
if (this._isDisposed || value === this._disposable.value) {
return;
}
this._disposable.value = value;
}
dispose() {
this._isDisposed = true;
this._disposable.dispose();
}
}
export class RefCountedDisposable {
private _counter: number = 1;
@@ -752,6 +781,10 @@ export class DisposableMap<K, V extends IDisposable = IDisposable> implements ID
return this._store.keys();
}
values(): IterableIterator<V> {
return this._store.values();
}
[Symbol.iterator](): IterableIterator<[K, V]> {
return this._store[Symbol.iterator]();
}
+1 -1
View File
@@ -229,7 +229,7 @@ class FileAccessImpl {
// ...and we run in native environments
platform.isNative ||
// ...or web worker extensions on desktop
(platform.isWebWorker && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)
(platform.webWorkerOrigin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)
)
) {
return uri.with({
+2
View File
@@ -3,6 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// This is a facade for the observable implementation. Only import from here!
export {
IObservable,
IObserver,
@@ -8,14 +8,33 @@ import { DisposableStore, IDisposable, markAsDisposed, toDisposable, trackDispos
import { IReader, IObservable, IObserver, IChangeContext, getFunctionName } from 'vs/base/common/observableInternal/base';
import { getLogger } from 'vs/base/common/observableInternal/logging';
export function autorunOpts(options: { debugName: string | (() => string | undefined) }, fn: (reader: IReader) => void): IDisposable {
return new AutorunObserver(options.debugName, fn, undefined, undefined);
}
/**
* Runs immediately and whenever a transaction ends and an observed observable changed.
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
*/
export function autorun(fn: (reader: IReader) => void): IDisposable {
return new AutorunObserver(undefined, fn, undefined, undefined);
}
/**
* Runs immediately and whenever a transaction ends and an observed observable changed.
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
*/
export function autorunOpts(options: { debugName?: string | (() => string | undefined) }, fn: (reader: IReader) => void): IDisposable {
return new AutorunObserver(options.debugName, fn, undefined, undefined);
}
/**
* Runs immediately and whenever a transaction ends and an observed observable changed.
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
*
* Use `createEmptyChangeSummary` to create a "change summary" that can collect the changes.
* Use `handleChange` to add a reported change to the change summary.
* The run function is given the last change summary.
* The change summary is discarded after the run function was called.
*
* @see autorun
*/
export function autorunHandleChanges<TChangeSummary>(
options: {
debugName?: string | (() => string | undefined);
@@ -27,6 +46,9 @@ export function autorunHandleChanges<TChangeSummary>(
return new AutorunObserver(options.debugName, fn, options.createEmptyChangeSummary, options.handleChange);
}
/**
* @see autorunHandleChanges (but with a disposable store that is cleared before the next run or on dispose)
*/
export function autorunWithStoreHandleChanges<TChangeSummary>(
options: {
debugName?: string | (() => string | undefined);
@@ -53,6 +75,9 @@ export function autorunWithStoreHandleChanges<TChangeSummary>(
});
}
/**
* @see autorun (but with a disposable store that is cleared before the next run or on dispose)
*/
export function autorunWithStore(fn: (reader: IReader, store: DisposableStore) => void): IDisposable {
const store = new DisposableStore();
const disposable = autorunOpts(
@@ -140,15 +165,18 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
this.state = AutorunState.upToDate;
const isDisposed = this.disposed;
try {
if (!this.disposed) {
if (!isDisposed) {
getLogger()?.handleAutorunTriggered(this);
const changeSummary = this.changeSummary!;
this.changeSummary = this.createChangeSummary?.();
this._runFn(this, changeSummary);
}
} finally {
getLogger()?.handleAutorunFinished(this);
if (!isDisposed) {
getLogger()?.handleAutorunFinished(this);
}
// We don't want our observed observables to think that they are (not even temporarily) not being observed.
// Thus, we only unsubscribe from observables that are definitely not read anymore.
for (const o of this.dependenciesToBeRemoved) {
+90 -22
View File
@@ -3,15 +3,19 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IDisposable } from 'vs/base/common/lifecycle';
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
import { recomputeInitiallyAndOnChange } from 'vs/base/common/observable';
import type { derivedOpts } from 'vs/base/common/observableInternal/derived';
import { getLogger } from 'vs/base/common/observableInternal/logging';
/**
* Represents an observable value.
*
* @template T The type of the value.
* @template TChange The type of delta information (usually `void` and only used in advanced scenarios).
* @template T The type of the values the observable can hold.
* @template TChange The type used to describe value changes
* (usually `void` and only used in advanced scenarios).
* While observers can miss temporary values of an observable,
* they will receive all change values (as long as they are subscribed)!
*/
export interface IObservable<T, TChange = unknown> {
/**
@@ -23,7 +27,7 @@ export interface IObservable<T, TChange = unknown> {
get(): T;
/**
* Forces the observable to check for and report changes.
* Forces the observable to check for changes and report them.
*
* Has the same effect as calling {@link IObservable.get}, but does not force the observable
* to actually construct the value, e.g. if change deltas are used.
@@ -45,21 +49,26 @@ export interface IObservable<T, TChange = unknown> {
removeObserver(observer: IObserver): void;
/**
* Reads the current value and subscribes to this observable.
* Reads the current value and subscribes the reader to this observable.
*
* Just calls {@link IReader.readObservable} if a reader is given, otherwise {@link IObservable.get}
* (see {@link ConvenientObservable.read}).
* Calls {@link IReader.readObservable} if a reader is given, otherwise {@link IObservable.get}
* (see {@link ConvenientObservable.read} for the implementation).
*/
read(reader: IReader | undefined): T;
/**
* Creates a derived observable that depends on this observable.
* Use the reader to read other observables
* (see {@link ConvenientObservable.map}).
* (see {@link ConvenientObservable.map} for the implementation).
*/
map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;
map<TNew>(owner: object, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;
/**
* Makes sure this value is computed eagerly.
*/
recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T>;
/**
* A human-readable name for debugging purposes.
*/
@@ -92,12 +101,14 @@ export interface IObserver {
* Signals that the given observable might have changed and a transaction potentially modifying that observable started.
* Before the given observable can call this method again, is must call {@link IObserver.endUpdate}.
*
* Implementations must not get/read the value of other observables, as they might not have received this event yet!
* The method {@link IObservable.reportChanges} can be used to force the observable to report the changes.
*/
beginUpdate<T>(observable: IObservable<T>): void;
/**
* Signals that the transaction that potentially modified the given observable ended.
* This is a good place to react to (potential) changes.
*/
endUpdate<T>(observable: IObservable<T>): void;
@@ -105,16 +116,18 @@ export interface IObserver {
* Signals that the given observable might have changed.
* The method {@link IObservable.reportChanges} can be used to force the observable to report the changes.
*
* Implementations must not call into other observables, as they might not have received this event yet!
* Implementations must not get/read the value of other observables, as they might not have received this event yet!
* The change should be processed lazily or in {@link IObserver.endUpdate}.
*/
handlePossibleChange<T>(observable: IObservable<T>): void;
/**
* Signals that the given observable changed.
* Signals that the given {@link observable} changed.
*
* Implementations must not call into other observables, as they might not have received this event yet!
* Implementations must not get/read the value of other observables, as they might not have received this event yet!
* The change should be processed lazily or in {@link IObserver.endUpdate}.
*
* @param change Indicates how or why the value changed.
*/
handleChange<T, TChange>(observable: IObservable<T, TChange>, change: TChange): void;
}
@@ -123,6 +136,9 @@ export interface ISettable<T, TChange = void> {
/**
* Sets the value of the observable.
* Use a transaction to batch multiple changes (with a transaction, observers only react at the end of the transaction).
*
* @param transaction When given, value changes are handled on demand or when the transaction ends.
* @param change Describes how or why the value changed.
*/
set(value: T, transaction: ITransaction | undefined, change: TChange): void;
}
@@ -135,6 +151,12 @@ export interface ITransaction {
updateObserver(observer: IObserver, observable: IObservable<any, any>): void;
}
let _recomputeInitiallyAndOnChange: typeof recomputeInitiallyAndOnChange;
export function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange: typeof _recomputeInitiallyAndOnChange) {
_recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange;
}
let _derived: typeof derivedOpts;
/**
* @internal
@@ -197,6 +219,11 @@ export abstract class ConvenientObservable<T, TChange> implements IObservable<T,
);
}
public recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T> {
store.add(_recomputeInitiallyAndOnChange!(this, handleValue));
return this;
}
public abstract get debugName(): string;
}
@@ -222,6 +249,12 @@ export abstract class BaseObservable<T, TChange = void> extends ConvenientObserv
protected onLastObserverRemoved(): void { }
}
/**
* Starts a transaction in which many observables can be changed at once.
* {@link fn} should start with a JS Doc using `@description` to give the transaction a debug name.
* Reaction run on demand or when the transaction ends.
*/
export function transaction(fn: (tx: ITransaction) => void, getDebugName?: () => string): void {
const tx = new TransactionImpl(fn, getDebugName);
try {
@@ -231,6 +264,24 @@ export function transaction(fn: (tx: ITransaction) => void, getDebugName?: () =>
}
}
let _globalTransaction: ITransaction | undefined = undefined;
export function globalTransaction(fn: (tx: ITransaction) => void) {
if (_globalTransaction) {
fn(_globalTransaction);
} else {
const tx = new TransactionImpl(fn, undefined);
_globalTransaction = tx;
try {
fn(tx);
} finally {
tx.finish(); // During finish, more actions might be added to the transaction.
// Which is why we only clear the global transaction after finish.
_globalTransaction = undefined;
}
}
}
export async function asyncTransaction(fn: (tx: ITransaction) => Promise<void>, getDebugName?: () => string): Promise<void> {
const tx = new TransactionImpl(fn, getDebugName);
try {
@@ -240,6 +291,9 @@ export async function asyncTransaction(fn: (tx: ITransaction) => Promise<void>,
}
}
/**
* Allows to chain transactions.
*/
export function subtransaction(tx: ITransaction | undefined, fn: (tx: ITransaction) => void, getDebugName?: () => string): void {
if (!tx) {
transaction(fn, getDebugName);
@@ -263,17 +317,19 @@ export class TransactionImpl implements ITransaction {
}
public updateObserver(observer: IObserver, observable: IObservable<any>): void {
// When this gets called while finish is active, they will still get considered
this.updatingObservers!.push({ observer, observable });
observer.beginUpdate(observable);
}
public finish(): void {
const updatingObservers = this.updatingObservers!;
// Prevent anyone from updating observers from now on.
this.updatingObservers = null;
for (const { observer, observable } of updatingObservers) {
for (let i = 0; i < updatingObservers.length; i++) {
const { observer, observable } = updatingObservers[i];
observer.endUpdate(observable);
}
// Prevent anyone from updating observers from now on.
this.updatingObservers = null;
getLogger()?.handleEndTransaction();
}
}
@@ -372,12 +428,17 @@ export function getFunctionName(fn: Function): string | undefined {
return result?.trim();
}
/**
* A settable observable.
*/
export interface ISettableObservable<T, TChange = void> extends IObservable<T, TChange>, ISettable<T, TChange> {
}
/**
* Creates an observable value.
* Observers get informed when the value changes.
* @template TChange An arbitrary type to describe how or why the value changed. Defaults to `void`.
* Observers will receive every single change value.
*/
export function observableValue<T, TChange = void>(name: string, initialValue: T): ISettableObservable<T, TChange>;
export function observableValue<T, TChange = void>(owner: object, initialValue: T): ISettableObservable<T, TChange>;
@@ -445,6 +506,10 @@ export class ObservableValue<T, TChange = void>
}
}
/**
* A disposable observable. When disposed, its value is also disposed.
* When a new value is set, the previous value is disposed.
*/
export function disposableObservableValue<T extends IDisposable | undefined, TChange = void>(nameOrOwner: string | object, initialValue: T): ISettableObservable<T, TChange> & IDisposable {
if (typeof nameOrOwner === 'string') {
return new DisposableObservableValue(undefined, nameOrOwner, initialValue);
@@ -469,17 +534,20 @@ export class DisposableObservableValue<T extends IDisposable | undefined, TChang
}
}
export interface IChangeTracker {
/**
* Returns if this change should cause an invalidation.
* Implementations can record changes.
*/
handleChange(context: IChangeContext): boolean;
}
export interface IChangeContext {
readonly changedObservable: IObservable<any, any>;
readonly change: unknown;
/**
* Returns if the given observable caused the change.
*/
didChange<T, TChange>(observable: IObservable<T, TChange>): this is { change: TChange };
}
export interface IChangeTracker {
/**
* Returns if this change should cause an invalidation.
* Can record the changes to just process deltas.
*/
handleChange(context: IChangeContext): boolean;
}
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { BugIndicatingError } from 'vs/base/common/errors';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { IReader, IObservable, BaseObservable, IObserver, _setDerivedOpts, IChangeContext, getFunctionName, DebugNameFn, getDebugName } from 'vs/base/common/observableInternal/base';
import { getLogger } from 'vs/base/common/observableInternal/logging';
@@ -13,6 +13,9 @@ const defaultEqualityComparer: EqualityComparer<any> = (a, b) => a === b;
/**
* Creates an observable that is derived from other observables.
* The value is only recomputed when absolutely needed.
*
* {@link computeFn} should start with a JS Doc using `@description` to name the derived.
*/
export function derived<T>(computeFn: (reader: IReader) => T): IObservable<T>;
export function derived<T>(owner: object, computeFn: (reader: IReader) => T): IObservable<T>;
@@ -34,6 +37,19 @@ export function derivedOpts<T>(
return new Derived(options.owner, options.debugName, computeFn, undefined, undefined, undefined, options.equalityComparer ?? defaultEqualityComparer);
}
/**
* Represents an observable that is derived from other observables.
* The value is only recomputed when absolutely needed.
*
* {@link computeFn} should start with a JS Doc using `@description` to name the derived.
*
* Use `createEmptyChangeSummary` to create a "change summary" that can collect the changes.
* Use `handleChange` to add a reported change to the change summary.
* The compute function is given the last change summary.
* The change summary is discarded after the compute function was called.
*
* @see derived
*/
export function derivedHandleChanges<T, TChangeSummary>(
options: {
owner?: object;
@@ -74,6 +90,37 @@ export function derivedWithStore<T>(computeFnOrOwner: ((reader: IReader, store:
);
}
export function derivedDisposable<T extends IDisposable | undefined>(computeFn: (reader: IReader) => T): IObservable<T>;
export function derivedDisposable<T extends IDisposable | undefined>(owner: object, computeFn: (reader: IReader) => T): IObservable<T>;
export function derivedDisposable<T extends IDisposable | undefined>(computeFnOrOwner: ((reader: IReader) => T) | object, computeFnOrUndefined?: ((reader: IReader) => T)): IObservable<T> {
let computeFn: (reader: IReader) => T;
let owner: object | undefined;
if (computeFnOrUndefined === undefined) {
computeFn = computeFnOrOwner as any;
owner = undefined;
} else {
owner = computeFnOrOwner;
computeFn = computeFnOrUndefined as any;
}
const store = new DisposableStore();
return new Derived(
owner,
(() => getFunctionName(computeFn) ?? '(anonymous)'),
r => {
store.clear();
const result = computeFn(r);
if (result) {
store.add(result);
}
return result;
}, undefined,
undefined,
() => store.dispose(),
defaultEqualityComparer
);
}
_setDerivedOpts(derivedOpts);
const enum DerivedState {
+58 -19
View File
@@ -6,7 +6,7 @@
import { Event } from 'vs/base/common/event';
import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { autorun } from 'vs/base/common/observableInternal/autorun';
import { BaseObservable, ConvenientObservable, IObservable, IObserver, IReader, ITransaction, getDebugName, getFunctionName, observableValue, transaction } from 'vs/base/common/observableInternal/base';
import { BaseObservable, ConvenientObservable, IObservable, IObserver, IReader, ITransaction, _setRecomputeInitiallyAndOnChange, getDebugName, getFunctionName, observableValue, subtransaction, transaction } from 'vs/base/common/observableInternal/base';
import { derived } from 'vs/base/common/observableInternal/derived';
import { getLogger } from 'vs/base/common/observableInternal/logging';
@@ -56,16 +56,17 @@ export function waitForState<T>(observable: IObservable<T>, predicate: (state: T
return new Promise(resolve => {
let didRun = false;
let shouldDispose = false;
const stateObs = observable.map(state => ({ isFinished: predicate(state), state }));
const d = autorun(reader => {
/** @description waitForState */
const currentState = observable.read(reader);
if (predicate(currentState)) {
const { isFinished, state } = stateObs.read(reader);
if (isFinished) {
if (!didRun) {
shouldDispose = true;
} else {
d.dispose();
}
resolve(currentState);
resolve(state);
}
});
didRun = true;
@@ -83,6 +84,8 @@ export function observableFromEvent<T, TArgs = unknown>(
}
export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
public static globalTransaction: ITransaction | undefined;
private value: T | undefined;
private hasValue = false;
private subscription: IDisposable | undefined;
@@ -109,17 +112,21 @@ export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
private readonly handleEvent = (args: TArgs | undefined) => {
const newValue = this._getValue(args);
const oldValue = this.value;
const didChange = !this.hasValue || this.value !== newValue;
getLogger()?.handleFromEventObservableTriggered(this, { oldValue: this.value, newValue, change: undefined, didChange, hadValue: this.hasValue });
const didChange = !this.hasValue || oldValue !== newValue;
let didRunTransaction = false;
if (didChange) {
this.value = newValue;
if (this.hasValue) {
transaction(
didRunTransaction = true;
subtransaction(
FromEventObservable.globalTransaction,
(tx) => {
getLogger()?.handleFromEventObservableTriggered(this, { oldValue, newValue, change: undefined, didChange, hadValue: this.hasValue });
for (const o of this.observers) {
tx.updateObserver(o, this);
o.handleChange(this, undefined);
@@ -133,6 +140,10 @@ export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
}
this.hasValue = true;
}
if (!didRunTransaction) {
getLogger()?.handleFromEventObservableTriggered(this, { oldValue, newValue, change: undefined, didChange, hadValue: this.hasValue });
}
};
protected override onLastObserverRemoved(): void {
@@ -157,6 +168,21 @@ export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
export namespace observableFromEvent {
export const Observer = FromEventObservable;
export function batchEventsGlobally(tx: ITransaction, fn: () => void): void {
let didSet = false;
if (FromEventObservable.globalTransaction === undefined) {
FromEventObservable.globalTransaction = tx;
didSet = true;
}
try {
fn();
} finally {
if (didSet) {
FromEventObservable.globalTransaction = undefined;
}
}
}
}
export function observableSignalFromEvent(
@@ -298,7 +324,7 @@ export function wasEventTriggeredRecently(event: Event<any>, timeoutMs: number,
* This makes sure the observable is being observed and keeps its cache alive.
*/
export function keepObserved<T>(observable: IObservable<T>): IDisposable {
const o = new KeepAliveObserver(false);
const o = new KeepAliveObserver(false, undefined);
observable.addObserver(o);
return toDisposable(() => {
observable.removeObserver(o);
@@ -308,29 +334,42 @@ export function keepObserved<T>(observable: IObservable<T>): IDisposable {
/**
* This converts the given observable into an autorun.
*/
export function recomputeInitiallyAndOnChange<T>(observable: IObservable<T>): IDisposable {
const o = new KeepAliveObserver(true);
export function recomputeInitiallyAndOnChange<T>(observable: IObservable<T>, handleValue?: (value: T) => void): IDisposable {
const o = new KeepAliveObserver(true, handleValue);
observable.addObserver(o);
observable.reportChanges();
if (handleValue) {
handleValue(observable.get());
} else {
observable.reportChanges();
}
return toDisposable(() => {
observable.removeObserver(o);
});
}
class KeepAliveObserver implements IObserver {
private counter = 0;
_setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange);
constructor(private readonly forceRecompute: boolean) { }
class KeepAliveObserver implements IObserver {
private _counter = 0;
constructor(
private readonly _forceRecompute: boolean,
private readonly _handleValue: ((value: any) => void) | undefined,
) { }
beginUpdate<T>(observable: IObservable<T, void>): void {
this.counter++;
this._counter++;
}
endUpdate<T>(observable: IObservable<T, void>): void {
this.counter--;
if (this.counter === 0 && this.forceRecompute) {
observable.reportChanges();
this._counter--;
if (this._counter === 0 && this._forceRecompute) {
if (this._handleValue) {
this._handleValue(observable.get());
} else {
observable.reportChanges();
}
}
}
+9 -12
View File
@@ -53,18 +53,13 @@ export interface INodeProcess {
}
declare const process: INodeProcess;
declare const global: unknown;
declare const self: unknown;
/**
* @deprecated use `globalThis` instead
*/
export const globals: any = (typeof self === 'object' ? self : typeof global === 'object' ? global : {});
const $globalThis: any = globalThis;
let nodeProcess: INodeProcess | undefined = undefined;
if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') {
if (typeof $globalThis.vscode !== 'undefined' && typeof $globalThis.vscode.process !== 'undefined') {
// Native environment (sandboxed)
nodeProcess = globals.vscode.process;
nodeProcess = $globalThis.vscode.process;
} else if (typeof process !== 'undefined') {
// Native environment (non-sandboxed)
nodeProcess = process;
@@ -167,7 +162,8 @@ export const isLinuxSnap = _isLinuxSnap;
export const isNative = _isNative;
export const isElectron = _isElectron;
export const isWeb = _isWeb;
export const isWebWorker = (_isWeb && typeof globals.importScripts === 'function');
export const isWebWorker = (_isWeb && typeof $globalThis.importScripts === 'function');
export const webWorkerOrigin = isWebWorker ? $globalThis.origin : undefined;
export const isIOS = _isIOS;
export const isMobile = _isMobile;
/**
@@ -226,7 +222,7 @@ export const platformLocale = _platformLocale;
*/
export const translationsConfigFile = _translationsConfigFile;
export const setTimeout0IsFaster = (typeof globals.postMessage === 'function' && !globals.importScripts);
export const setTimeout0IsFaster = (typeof $globalThis.postMessage === 'function' && !$globalThis.importScripts);
/**
* See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.
@@ -241,7 +237,8 @@ export const setTimeout0 = (() => {
callback: () => void;
}
const pending: IQueueElement[] = [];
globals.addEventListener('message', (e: MessageEvent) => {
$globalThis.addEventListener('message', (e: any) => {
if (e.data && e.data.vscodeScheduleAsyncWork) {
for (let i = 0, len = pending.length; i < len; i++) {
const candidate = pending[i];
@@ -260,7 +257,7 @@ export const setTimeout0 = (() => {
id: myId,
callback: callback
});
globals.postMessage({ vscodeScheduleAsyncWork: myId }, '*');
$globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, '*');
};
}
return (callback: () => void) => setTimeout(callback);
+4 -3
View File
@@ -3,14 +3,15 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { globals, INodeProcess, isMacintosh, isWindows } from 'vs/base/common/platform';
import { INodeProcess, isMacintosh, isWindows } from 'vs/base/common/platform';
let safeProcess: Omit<INodeProcess, 'arch'> & { arch: string | undefined };
declare const process: INodeProcess;
// Native sandbox environment
if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') {
const sandboxProcess: INodeProcess = globals.vscode.process;
const vscodeGlobal = (globalThis as any).vscode;
if (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.process !== 'undefined') {
const sandboxProcess: INodeProcess = vscodeGlobal.process;
safeProcess = {
get platform() { return sandboxProcess.platform; },
get arch() { return sandboxProcess.arch; },
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mainWindow } from 'vs/base/browser/window';
import { Event } from 'vs/base/common/event';
import { generateUuid } from 'vs/base/common/uuid';
import { ipcMessagePort, ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals';
@@ -28,8 +29,8 @@ export async function acquirePort(requestChannel: string | undefined, responseCh
// Wait until the main side has returned the `MessagePort`
// We need to filter by the `nonce` to ensure we listen
// to the right response.
const onMessageChannelResult = Event.fromDOMEventEmitter<IMessageChannelResult>(window, 'message', (e: MessageEvent) => ({ nonce: e.data, port: e.ports[0], source: e.source }));
const { port } = await Event.toPromise(Event.once(Event.filter(onMessageChannelResult, e => e.nonce === nonce && e.source === window)));
const onMessageChannelResult = Event.fromDOMEventEmitter<IMessageChannelResult>(mainWindow, 'message', (e: MessageEvent) => ({ nonce: e.data, port: e.ports[0], source: e.source }));
const { port } = await Event.toPromise(Event.once(Event.filter(onMessageChannelResult, e => e.nonce === nonce && e.source === mainWindow)));
return port;
}
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { globals, INodeProcess, IProcessEnvironment } from 'vs/base/common/platform';
import { INodeProcess, IProcessEnvironment } from 'vs/base/common/platform';
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
import { IpcRenderer, ProcessMemoryInfo, WebFrame } from 'vs/base/parts/sandbox/electron-sandbox/electronTypes';
@@ -115,11 +115,12 @@ export interface ISandboxContext {
resolveConfiguration(): Promise<ISandboxConfiguration>;
}
export const ipcRenderer: IpcRenderer = globals.vscode.ipcRenderer;
export const ipcMessagePort: IpcMessagePort = globals.vscode.ipcMessagePort;
export const webFrame: WebFrame = globals.vscode.webFrame;
export const process: ISandboxNodeProcess = globals.vscode.process;
export const context: ISandboxContext = globals.vscode.context;
const vscodeGlobal = (globalThis as any).vscode;
export const ipcRenderer: IpcRenderer = vscodeGlobal.ipcRenderer;
export const ipcMessagePort: IpcMessagePort = vscodeGlobal.ipcMessagePort;
export const webFrame: WebFrame = vscodeGlobal.webFrame;
export const process: ISandboxNodeProcess = vscodeGlobal.process;
export const context: ISandboxContext = vscodeGlobal.context;
/**
* A set of globals that are available in all windows that either
+49 -2
View File
@@ -4,8 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { $, asCssValueWithDefault, h, multibyteAwareBtoa, trackAttributes, copyAttributes } from 'vs/base/browser/dom';
import { timeout } from 'vs/base/common/async';
import { $, asCssValueWithDefault, h, multibyteAwareBtoa, trackAttributes, copyAttributes, disposableWindowInterval } from 'vs/base/browser/dom';
import { mainWindow } from 'vs/base/browser/window';
import { DeferredPromise, timeout } from 'vs/base/common/async';
import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler';
suite('dom', () => {
@@ -336,4 +337,50 @@ suite('dom', () => {
disposable.dispose();
});
});
suite('disposableWindowInterval', () => {
test('basics', async () => {
let count = 0;
const promise = new DeferredPromise<void>();
const interval = disposableWindowInterval(mainWindow, () => {
count++;
if (count === 3) {
promise.complete(undefined);
return true;
} else {
return false;
}
}, 0, 10);
await promise.p;
assert.strictEqual(count, 3);
interval.dispose();
});
test('iterations', async () => {
let count = 0;
const interval = disposableWindowInterval(mainWindow, () => {
count++;
return false;
}, 0, 0);
await timeout(5);
assert.strictEqual(count, 0);
interval.dispose();
});
test('dispose', async () => {
let count = 0;
const interval = disposableWindowInterval(mainWindow, () => {
count++;
return false;
}, 0, 10);
interval.dispose();
await timeout(5);
assert.strictEqual(count, 0);
});
});
});
@@ -77,7 +77,7 @@ suite('FormattedTextRenderer', () => {
});
assert.strictEqual(result.innerHTML, '<a>action</a>');
const event: MouseEvent = <any>document.createEvent('MouseEvent');
const event: MouseEvent = document.createEvent('MouseEvent');
event.initEvent('click', true, true);
result.firstChild!.dispatchEvent(event);
assert.strictEqual(callbackCalled, true);
@@ -96,7 +96,7 @@ suite('FormattedTextRenderer', () => {
});
assert.strictEqual(result.innerHTML, '<i><b><a>action</a></b></i>');
const event: MouseEvent = <any>document.createEvent('MouseEvent');
const event: MouseEvent = document.createEvent('MouseEvent');
event.initEvent('click', true, true);
result.firstChild!.firstChild!.firstChild!.dispatchEvent(event);
assert.strictEqual(callbackCalled, true);
@@ -116,7 +116,7 @@ suite('FormattedTextRenderer', () => {
});
assert.strictEqual(result.innerHTML, '<code><i><b><a>action</a></b></i></code>');
const event: MouseEvent = <any>document.createEvent('MouseEvent');
const event: MouseEvent = document.createEvent('MouseEvent');
event.initEvent('click', true, true);
result.firstChild!.firstChild!.firstChild!.firstChild!.dispatchEvent(event);
assert.strictEqual(callbackCalled, true);

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