Skip to content

Commit

Permalink
Fixes #164934: Only export symbols that are needed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Oct 31, 2022
1 parent 9059a3b commit 15feec9
Show file tree
Hide file tree
Showing 34 changed files with 46 additions and 211 deletions.
2 changes: 1 addition & 1 deletion src/vs/base/common/scrollable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export class SmoothScrollingUpdate {

}

export interface IAnimation {
interface IAnimation {
(completion: number): number;
}

Expand Down
6 changes: 3 additions & 3 deletions src/vs/base/parts/ipc/common/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface IServerChannel<TContext = string> {
listen<T>(ctx: TContext, event: string, arg?: any): Event<T>;
}

export const enum RequestType {
const enum RequestType {
Promise = 100,
PromiseCancel = 101,
EventListen = 102,
Expand All @@ -62,7 +62,7 @@ type IRawEventListenRequest = { type: RequestType.EventListen; id: number; chann
type IRawEventDisposeRequest = { type: RequestType.EventDispose; id: number };
type IRawRequest = IRawPromiseRequest | IRawPromiseCancelRequest | IRawEventListenRequest | IRawEventDisposeRequest;

export const enum ResponseType {
const enum ResponseType {
Initialize = 200,
PromiseSuccess = 201,
PromiseError = 202,
Expand Down Expand Up @@ -1186,7 +1186,7 @@ function pretty(data: any): any {
return prettyWithoutArrays(data);
}

export function logWithColors(direction: string, totalLength: number, msgLength: number, req: number, initiator: RequestInitiator, str: string, data: any): void {
function logWithColors(direction: string, totalLength: number, msgLength: number, req: number, initiator: RequestInitiator, str: string, data: any): void {
data = pretty(data);

const colorTable = colorTables[initiator];
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/config/fontMeasurements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ISerializedFontInfo {
readonly maxDigitWidth: number;
}

class FontMeasurementsImpl extends Disposable {
export class FontMeasurementsImpl extends Disposable {

private _cache: FontMeasurementsCache;
private _evictUntrustedReadingsTimeout: number;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/controller/mouseTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ export class MouseTargetFactory {
}
}

export function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y: number): Range {
function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y: number): Range {
const range = document.createRange();

// Get the element under the point
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/browser/services/abstractCodeEditorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class ModelTransientSettingWatcher {
}
}

export class RefCountedStyleSheet {
class RefCountedStyleSheet {

private readonly _parent: AbstractCodeEditorService;
private readonly _editorId: string;
Expand Down Expand Up @@ -366,7 +366,7 @@ interface IModelDecorationOptionsProvider extends IDisposable {
resolveDecorationCSSRules(): CSSRuleList;
}

export class DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvider {
class DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvider {

private readonly _styleSheet: GlobalStyleSheet | RefCountedStyleSheet;
public refCount: number;
Expand Down Expand Up @@ -421,7 +421,7 @@ interface ProviderArguments {
}


export class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider {
class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider {

private readonly _disposables = new DisposableStore();
private readonly _styleSheet: GlobalStyleSheet | RefCountedStyleSheet;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/commands/shiftCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface IShiftCommandOpts {
}

const repeatCache: { [str: string]: string[] } = Object.create(null);
export function cachedStringRepeat(str: string, count: number): string {
function cachedStringRepeat(str: string, count: number): string {
if (count <= 0) {
return '';
}
Expand Down
9 changes: 0 additions & 9 deletions src/vs/editor/common/cursorCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ export interface IColumnSelectData {
toViewVisualColumn: number;
}

export const enum RevealTarget {
Primary = 0,
TopMost = 1,
BottomMost = 2
}

/**
* This is an operation type that will be recorded for undo/redo purposes.
* The goal is to introduce an undo stop when the controller switches between different operation types.
Expand All @@ -48,9 +42,6 @@ export const enum EditOperationType {
export interface CharacterMap {
[char: string]: string;
}
export interface MultipleCharacterMap {
[char: string]: string[];
}

const autoCloseAlways = () => true;
const autoCloseNever = () => false;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/languages/linkComputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const enum State {

export type Edge = [State, number, State];

export class Uint8Matrix {
class Uint8Matrix {

private readonly _data: Uint8Array;
public readonly rows: number;
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/common/model/textModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function createTextBuffer(value: string | model.ITextBufferFactory | mode
let MODEL_ID = 0;

const LIMIT_FIND_COUNT = 999;
export const LONG_LINE_BOUNDARY = 10000;
const LONG_LINE_BOUNDARY = 10000;

class TextModelSnapshot implements model.ITextSnapshot {

Expand Down Expand Up @@ -2308,7 +2308,7 @@ function _normalizeOptions(options: model.IModelDecorationOptions): ModelDecorat
return ModelDecorationOptions.createDynamic(options);
}

export class DidChangeDecorationsEmitter extends Disposable {
class DidChangeDecorationsEmitter extends Disposable {

private readonly _actual: Emitter<IModelDecorationsChangedEvent> = this._register(new Emitter<IModelDecorationsChangedEvent>());
public readonly event: Event<IModelDecorationsChangedEvent> = this._actual.event;
Expand Down Expand Up @@ -2394,7 +2394,7 @@ export class DidChangeDecorationsEmitter extends Disposable {

//#endregion

export class DidChangeContentEmitter extends Disposable {
class DidChangeContentEmitter extends Disposable {

/**
* Both `fastEvent` and `slowEvent` work the same way and contain the same events, but first we invoke `fastEvent` and then `slowEvent`.
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/services/editorBaseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Selection } from 'vs/editor/common/core/selection';
import { Token } from 'vs/editor/common/languages';
import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';

export class KeyMod {
class KeyMod {
public static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd;
public static readonly Shift: number = ConstKeyMod.Shift;
public static readonly Alt: number = ConstKeyMod.Alt;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/services/editorSimpleWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface IWordRange {
/**
* @internal
*/
export class MirrorModel extends BaseMirrorModel implements ICommonModel {
class MirrorModel extends BaseMirrorModel implements ICommonModel {

public get uri(): URI {
return this._uri;
Expand Down
3 changes: 1 addition & 2 deletions src/vs/editor/common/services/editorWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeText
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import type { EditorSimpleWorker } from 'vs/editor/common/services/editorSimpleWorker';

export const ID_EDITOR_WORKER_SERVICE = 'editorWorkerService';
export const IEditorWorkerService = createDecorator<IEditorWorkerService>(ID_EDITOR_WORKER_SERVICE);
export const IEditorWorkerService = createDecorator<IEditorWorkerService>('editorWorkerService');

export interface IEditorWorkerService {
readonly _serviceBrand: undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/services/languagesRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
const hasOwnProperty = Object.prototype.hasOwnProperty;
const NULL_LANGUAGE_ID = 'vs.editor.nullLanguage';

export interface IResolvedLanguage {
interface IResolvedLanguage {
identifier: string;
name: string | null;
mimetypes: string[];
Expand Down
17 changes: 4 additions & 13 deletions src/vs/editor/common/services/modelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log';
import { IUndoRedoService, ResourceEditStackSnapshot } from 'vs/platform/undoRedo/common/undoRedo';
import { StringSHA1 } from 'vs/base/common/hash';
import { EditStackElement, isEditStackElement } from 'vs/editor/common/model/editStack';
import { isEditStackElement } from 'vs/editor/common/model/editStack';
import { Schemas } from 'vs/base/common/network';
import { SemanticTokensProviderStyling, toMultilineTokens2 } from 'vs/editor/common/services/semanticTokensProviderStyling';
import { getDocumentSemanticTokens, hasDocumentSemanticTokensProvider, isSemanticTokens, isSemanticTokensEdits } from 'vs/editor/common/services/getSemanticTokens';
Expand Down Expand Up @@ -117,11 +117,6 @@ interface IRawConfig {

const DEFAULT_EOL = (platform.isLinux || platform.isMacintosh) ? DefaultEndOfLine.LF : DefaultEndOfLine.CRLF;

export interface EditStackPastFutureElements {
past: EditStackElement[];
future: EditStackElement[];
}

class DisposedModelInfo {
constructor(
public readonly uri: URI,
Expand Down Expand Up @@ -450,7 +445,7 @@ export class ModelService extends Disposable implements IModelService {
disposable.dispose();
}

private static _commonPrefix(a: ILineSequence, aLen: number, aDelta: number, b: ILineSequence, bLen: number, bDelta: number): number {
private static _commonPrefix(a: ITextModel, aLen: number, aDelta: number, b: ITextBuffer, bLen: number, bDelta: number): number {
const maxResult = Math.min(aLen, bLen);

let result = 0;
Expand All @@ -460,7 +455,7 @@ export class ModelService extends Disposable implements IModelService {
return result;
}

private static _commonSuffix(a: ILineSequence, aLen: number, aDelta: number, b: ILineSequence, bLen: number, bDelta: number): number {
private static _commonSuffix(a: ITextModel, aLen: number, aDelta: number, b: ITextBuffer, bLen: number, bDelta: number): number {
const maxResult = Math.min(aLen, bLen);

let result = 0;
Expand Down Expand Up @@ -640,10 +635,6 @@ export class ModelService extends Disposable implements IModelService {
}
}

export interface ILineSequence {
getLineContent(lineNumber: number): string;
}

export const SEMANTIC_HIGHLIGHTING_SETTING_ID = 'editor.semanticHighlighting';

export function isSemanticColoringEnabled(model: ITextModel, themeService: IThemeService, configurationService: IConfigurationService): boolean {
Expand Down Expand Up @@ -756,7 +747,7 @@ class SemanticTokensResponse {
}
}

export class ModelSemanticColoring extends Disposable {
class ModelSemanticColoring extends Disposable {

public static REQUEST_MIN_DELAY = 300;
public static REQUEST_MAX_DELAY = 2000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ILogService, LogLevel } from 'vs/platform/log/common/log';
import { SparseMultilineTokens } from 'vs/editor/common/tokens/sparseMultilineTokens';
import { ILanguageService } from 'vs/editor/common/languages/language';

export const enum SemanticTokensProviderStylingConstants {
const enum SemanticTokensProviderStylingConstants {
NO_STYLING = 0b01111111111111111111111111111111
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/viewLayout/viewLineRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class RenderLineInput {
}
}

export const enum CharacterMappingConstants {
const enum CharacterMappingConstants {
PART_INDEX_MASK = 0b11111111111111110000000000000000,
CHAR_INDEX_MASK = 0b00000000000000001111111111111111,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IStorageService } from 'vs/platform/storage/common/storage';

export class TestFindController extends CommonFindController {
class TestFindController extends CommonFindController {

public hasFocus: boolean;
public delayUpdateHistory: boolean = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { QuickInputService, IQuickInputControllerHost } from 'vs/platform/quicki
import { once } from 'vs/base/common/functional';
import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess';

export class EditorScopedQuickInputService extends QuickInputService {
class EditorScopedQuickInputService extends QuickInputService {

private host: IQuickInputControllerHost | undefined = undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/test/browser/commands/shiftCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
/**
* Create single edit operation
*/
export function createSingleEditOp(text: string, positionLineNumber: number, positionColumn: number, selectionLineNumber: number = positionLineNumber, selectionColumn: number = positionColumn): ISingleEditOperation {
function createSingleEditOp(text: string, positionLineNumber: number, positionColumn: number, selectionLineNumber: number = positionLineNumber, selectionColumn: number = positionColumn): ISingleEditOperation {
return {
range: new Range(selectionLineNumber, selectionColumn, positionLineNumber, positionColumn),
text: text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function createInsertDeleteSingleEditOp(text: string | null, positionLineNumber:
/**
* Create single edit operation
*/
export function createSingleEditOp(text: string | null, positionLineNumber: number, positionColumn: number, selectionLineNumber: number = positionLineNumber, selectionColumn: number = positionColumn): ISingleEditOperation {
function createSingleEditOp(text: string | null, positionLineNumber: number, positionColumn: number, selectionLineNumber: number = positionLineNumber, selectionColumn: number = positionColumn): ISingleEditOperation {
return {
range: new Range(selectionLineNumber, selectionColumn, positionLineNumber, positionColumn),
text: text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { createTextModel } from 'vs/editor/test/common/testTextModel';

export class MockTextAreaWrapper extends Disposable implements ITextAreaWrapper {
class MockTextAreaWrapper extends Disposable implements ITextAreaWrapper {

public _value: string;
public _selectionStart: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DefaultEndOfLine } from 'vs/editor/common/model';
import { PieceTreeTextBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer';
import { createTextBufferFactory } from 'vs/editor/common/model/textModel';

export function testTextBufferFactory(text: string, eol: string, mightContainNonBasicASCII: boolean, mightContainRTL: boolean): void {
function testTextBufferFactory(text: string, eol: string, mightContainNonBasicASCII: boolean, mightContainRTL: boolean): void {
const textBuffer = <PieceTreeTextBuffer>createTextBufferFactory(text).create(DefaultEndOfLine.LF).textBuffer;

assert.strictEqual(textBuffer.mightContainNonBasicASCII(), mightContainNonBasicASCII);
Expand Down
Loading

0 comments on commit 15feec9

Please sign in to comment.