diff --git a/bin/esbuild.mjs b/bin/esbuild.mjs index aa86aa1b..6d2a4063 100644 --- a/bin/esbuild.mjs +++ b/bin/esbuild.mjs @@ -172,10 +172,8 @@ if (config.addon) { }; outConfig = { ...outConfig, - entryPoints: [ - `src/**/*.ts` - ], - outdir: 'out-esbuild/', + entryPoints: ['src/**/*.ts'], + outdir: 'out-esbuild/' }; outTestConfig = { ...outConfig, diff --git a/bin/vs_base_find_unused.js b/bin/vs_base_find_unused.js index 572cca09..df54aab5 100644 --- a/bin/vs_base_find_unused.js +++ b/bin/vs_base_find_unused.js @@ -25,6 +25,7 @@ function findUnusedSymbols( const allFilesInBase = ( fs.readdirSync('src/vs/base', { recursive: true, withFileTypes: true }) .filter(e => e.isFile()) + // @ts-ignore HACK: This is only available in Node 20 .map(e => `${e.parentPath}/${e.name}`.replace(/\\/g, '/')) ); const unusedFilesInBase = allFilesInBase.filter(e => !usedFilesInBase.includes(e)); diff --git a/package.json b/package.json index a367d3f0..894ec18a 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,6 @@ "mustache": "^4.2.0", "node-pty": "1.1.0-beta5", "nyc": "^15.1.0", - "semver": "^7.6.2", "source-map-loader": "^3.0.0", "source-map-support": "^0.5.20", "ts-loader": "^9.3.1", diff --git a/src/browser/decorations/OverviewRulerRenderer.ts b/src/browser/decorations/OverviewRulerRenderer.ts index dbdf4e9c..80095222 100644 --- a/src/browser/decorations/OverviewRulerRenderer.ts +++ b/src/browser/decorations/OverviewRulerRenderer.ts @@ -8,6 +8,10 @@ import { ICoreBrowserService, IRenderService, IThemeService } from 'browser/serv import { Disposable, toDisposable } from 'common/Lifecycle'; import { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services'; +const enum Constants { + OVERVIEW_RULER_BORDER_WIDTH = 1 +} + // Helper objects to avoid excessive calculation and garbage collection during rendering. These are // static values for each render and can be accessed using the decoration position as the key. const drawHeight = { @@ -98,8 +102,8 @@ export class OverviewRulerRenderer extends Disposable { private _refreshDrawConstants(): void { // width - const outerWidth = Math.floor((this._canvas.width - 1) / 3); - const innerWidth = Math.ceil((this._canvas.width - 1) / 3); + const outerWidth = Math.floor((this._canvas.width - Constants.OVERVIEW_RULER_BORDER_WIDTH) / 3); + const innerWidth = Math.ceil((this._canvas.width - Constants.OVERVIEW_RULER_BORDER_WIDTH) / 3); drawWidth.full = this._canvas.width; drawWidth.left = outerWidth; drawWidth.center = innerWidth; @@ -107,10 +111,10 @@ export class OverviewRulerRenderer extends Disposable { // height this._refreshDrawHeightConstants(); // x - drawX.full = 1; - drawX.left = 1; - drawX.center = 1 + drawWidth.left; - drawX.right = 1 + drawWidth.left + drawWidth.center; + drawX.full = Constants.OVERVIEW_RULER_BORDER_WIDTH; + drawX.left = Constants.OVERVIEW_RULER_BORDER_WIDTH; + drawX.center = Constants.OVERVIEW_RULER_BORDER_WIDTH + drawWidth.left; + drawX.right = Constants.OVERVIEW_RULER_BORDER_WIDTH + drawWidth.left + drawWidth.center; } private _refreshDrawHeightConstants(): void { @@ -171,7 +175,7 @@ export class OverviewRulerRenderer extends Disposable { private _renderRulerOutline(): void { this._ctx.fillStyle = this._themeService.colors.overviewRulerBorder.css; - this._ctx.fillRect(0, 0, 1, this._canvas.height); + this._ctx.fillRect(0, 0, Constants.OVERVIEW_RULER_BORDER_WIDTH, this._canvas.height); } private _renderColorZone(zone: IColorZone): void { diff --git a/src/browser/services/ThemeService.ts b/src/browser/services/ThemeService.ts index 645777b9..3e6dd481 100644 --- a/src/browser/services/ThemeService.ts +++ b/src/browser/services/ThemeService.ts @@ -23,12 +23,12 @@ interface IRestoreColorSet { const DEFAULT_FOREGROUND = css.toColor('#ffffff'); const DEFAULT_BACKGROUND = css.toColor('#000000'); const DEFAULT_CURSOR = css.toColor('#ffffff'); -const DEFAULT_CURSOR_ACCENT = css.toColor('#000000'); +const DEFAULT_CURSOR_ACCENT = DEFAULT_BACKGROUND; const DEFAULT_SELECTION = { css: 'rgba(255, 255, 255, 0.3)', rgba: 0xFFFFFF4D }; -const DEFAULT_OVERVIEW_RULER_BORDER = css.toColor('#000000'); +const DEFAULT_OVERVIEW_RULER_BORDER = DEFAULT_FOREGROUND; export class ThemeService extends Disposable implements IThemeService { public serviceBrand: undefined; @@ -61,7 +61,7 @@ export class ThemeService extends Disposable implements IThemeService { scrollbarSliderBackground: color.opacity(DEFAULT_FOREGROUND, 0.2), scrollbarSliderHoverBackground: color.opacity(DEFAULT_FOREGROUND, 0.4), scrollbarSliderActiveBackground: color.opacity(DEFAULT_FOREGROUND, 0.5), - overviewRulerBorder: DEFAULT_OVERVIEW_RULER_BORDER, + overviewRulerBorder: DEFAULT_FOREGROUND, ansi: DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache, halfContrastCache: this._halfContrastCache