Merge pull request #5969 from Tyriar/import-no-cycle-5897-2
Add oxlint import/no-cycle and break existing src/common cycles
This commit is contained in:
@@ -4,9 +4,8 @@
|
||||
*/
|
||||
|
||||
import { Disposable } from '../Lifecycle';
|
||||
import { IAttributeData, IBufferLine } from '../Types';
|
||||
import { IAttributeData, IBuffer, IBufferLine, IBufferSet } from '../buffer/Types';
|
||||
import { BufferSet } from '../buffer/BufferSet';
|
||||
import { IBuffer, IBufferSet } from '../buffer/Types';
|
||||
import { IBufferService, ILogService, IOptionsService, type IBufferResizeEvent } from './Services';
|
||||
import { Emitter } from '../Event';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { DecorationLineCache, DecorationService } from './DecorationService';
|
||||
import { IMarker } from '../Types';
|
||||
import { IMarker } from '../buffer/Types';
|
||||
import { Disposable } from '../Lifecycle';
|
||||
import { Emitter } from '../Event';
|
||||
import { MockLogService, MockBufferService, MockOptionsService } from '../TestUtils.test';
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import type { IDeleteEvent, IInsertEvent } from '../CircularList';
|
||||
import type { ICircularList, IDeleteEvent, IInsertEvent } from '../CircularList';
|
||||
import { MicrotaskTimer } from '../Async';
|
||||
import { css } from '../Color';
|
||||
import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../Lifecycle';
|
||||
import { IBufferService, IDecorationService, IInternalDecoration, ILogService } from './Services';
|
||||
import { SortedList } from '../SortedList';
|
||||
import { IColor, ICircularList } from '../Types';
|
||||
import { IColor } from '../Types';
|
||||
import { IDecoration, IDecorationOptions, IMarker } from '@xterm/xterm';
|
||||
import { Emitter } from '../Event';
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IInstantiationService, IServiceIdentifier } from './Services';
|
||||
import { getServiceDependencies } from './ServiceRegistry';
|
||||
import { IInstantiationService } from './Services';
|
||||
import { IServiceIdentifier, getServiceDependencies } from './ServiceRegistry';
|
||||
|
||||
export class ServiceCollection {
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* @license MIT
|
||||
*/
|
||||
import { IBufferService, IOscLinkService } from './Services';
|
||||
import { IMarker, IOscLinkData } from '../Types';
|
||||
import { IOscLinkData } from '../Types';
|
||||
import { IMarker } from '../buffer/Types';
|
||||
|
||||
export class OscLinkService implements IOscLinkService {
|
||||
public serviceBrand: any;
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IServiceIdentifier } from './Services';
|
||||
export interface IServiceIdentifier<T> {
|
||||
(...args: any[]): void;
|
||||
type: T;
|
||||
_id: string;
|
||||
}
|
||||
|
||||
const enum Constants {
|
||||
DI_TARGET = 'di$target',
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
|
||||
import type { IDecoration, IDecorationOptions, ILinkHandler, ILogger, IWindowsPty, IOverviewRulerOptions } from '@xterm/xterm';
|
||||
import { CoreMouseEncoding, CoreMouseEventType, CursorInactiveStyle, CursorStyle, IAttributeData, ICharset, IColor, ICoreMouseEvent, ICoreMouseProtocol, IDecPrivateModes, IDisposable, IKittyKeyboardState, IModes, IOscLinkData, IWindowOptions } from '../Types';
|
||||
import { IBuffer, IBufferSet } from '../buffer/Types';
|
||||
import { createDecorator } from './ServiceRegistry';
|
||||
import { CoreMouseEncoding, CoreMouseEventType, CursorInactiveStyle, CursorStyle, ICharset, IColor, ICoreMouseEvent, ICoreMouseProtocol, IDecPrivateModes, IDisposable, IKittyKeyboardState, IModes, IOscLinkData, IWindowOptions } from '../Types';
|
||||
import { IAttributeData, IBuffer, IBufferSet } from '../buffer/Types';
|
||||
import { createDecorator, IServiceIdentifier } from './ServiceRegistry';
|
||||
import type { Emitter, IEvent } from '../Event';
|
||||
|
||||
export const IBufferService = createDecorator<IBufferService>('BufferService');
|
||||
@@ -119,12 +119,6 @@ export interface ICharsetService {
|
||||
setgCharset(g: number, charset: ICharset | undefined): void;
|
||||
}
|
||||
|
||||
export interface IServiceIdentifier<T> {
|
||||
(...args: any[]): void;
|
||||
type: T;
|
||||
_id: string;
|
||||
}
|
||||
|
||||
export interface IBrandedService {
|
||||
serviceBrand: undefined;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { UnicodeV6 } from '../input/UnicodeV6';
|
||||
import { UnicodeService } from './UnicodeService';
|
||||
import { IUnicodeVersionProvider } from './Services';
|
||||
|
||||
@@ -21,6 +22,7 @@ describe('unicode provider', () => {
|
||||
let us: UnicodeService;
|
||||
beforeEach(() => {
|
||||
us = new UnicodeService();
|
||||
us.register(new UnicodeV6());
|
||||
});
|
||||
it('default to V6', () => {
|
||||
assert.equal(us.activeVersion, '6');
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { UnicodeV6 } from '../input/UnicodeV6';
|
||||
import { IUnicodeService, IUnicodeVersionProvider, UnicodeCharProperties, UnicodeCharWidth } from './Services';
|
||||
import { Emitter } from '../Event';
|
||||
|
||||
@@ -12,7 +11,7 @@ export class UnicodeService implements IUnicodeService {
|
||||
|
||||
private _providers: {[key: string]: IUnicodeVersionProvider} = Object.create(null);
|
||||
private _active: string = '';
|
||||
private _activeProvider: IUnicodeVersionProvider;
|
||||
private _activeProvider!: IUnicodeVersionProvider;
|
||||
|
||||
private readonly _onChange = new Emitter<string>();
|
||||
public readonly onChange = this._onChange.event;
|
||||
@@ -30,13 +29,6 @@ export class UnicodeService implements IUnicodeService {
|
||||
return ((state & 0xffffff) << 3) | ((width & 3) << 1) | (shouldJoin?1:0);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
const defaultProvider = new UnicodeV6();
|
||||
this.register(defaultProvider);
|
||||
this._active = defaultProvider.version;
|
||||
this._activeProvider = defaultProvider;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._onChange.dispose();
|
||||
}
|
||||
@@ -60,6 +52,9 @@ export class UnicodeService implements IUnicodeService {
|
||||
|
||||
public register(provider: IUnicodeVersionProvider): void {
|
||||
this._providers[provider.version] = provider;
|
||||
if (!this._active) {
|
||||
this.activeVersion = provider.version;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user