Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
node: true,
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'eslint-plugin-import'],
plugins: ['@typescript-eslint', 'eslint-plugin-import', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
Expand Down Expand Up @@ -148,6 +148,7 @@ module.exports = {
'prefer-rest-params': 'warn',
'no-control-regex': 'warn',
'@typescript-eslint/no-non-null-assertion': 'off',
'unused-imports/no-unused-imports': 'warn',
// 让 import 中的内部包和外部包分组,看起来更美观
'import/order': [
'error',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"eslint-config-prettier": "^8.4.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-unused-imports": "^2.0.0",
"git-rev-sync": "^3.0.1",
"got": "^12.1.0",
"handlebars": "^4.7.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Text as YText } from 'yjs';

import { Injectable, Autowired } from '@opensumi/di';
import { AppConfig } from '@opensumi/ide-core-browser';
import { EventBusImpl, IEventBus, ILogger, URI, Disposable } from '@opensumi/ide-core-common';
import { EventBusImpl, IEventBus, ILogger, URI } from '@opensumi/ide-core-common';
import { INodeLogger } from '@opensumi/ide-core-node';
import { createBrowserInjector } from '@opensumi/ide-dev-tool/src/injector-helper';
import { MockInjector } from '@opensumi/ide-dev-tool/src/mock-injector';
Expand Down
1 change: 0 additions & 1 deletion packages/comments/src/browser/comments-panel.view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import clx from 'classnames';
import React, { FC, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react';

import { IRecycleTreeHandle, RecycleTree } from '@opensumi/ide-components';
Expand Down
2 changes: 0 additions & 2 deletions packages/comments/src/browser/comments.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ import {
CommentsContribution,
ICommentsFeatureRegistry,
CollapseId,
CommentPanelCollapse,
CloseThreadId,
ICommentThreadTitle,
SwitchCommandReaction,
ICommentsThread,
CommentReactionPayload,
CommentReactionClick,
} from '../common';
Expand Down
3 changes: 0 additions & 3 deletions packages/comments/src/browser/comments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ import {
IDisposable,
positionToRange,
Deferred,
path,
LRUCache,
MaybePromise,
LabelService,
formatLocalize,
getExternalIcon,
} from '@opensumi/ide-core-browser';
import { IEditor } from '@opensumi/ide-editor';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ILoggerManagerClient } from '@opensumi/ide-core-common';

import { createBrowserInjector } from '../../../../tools/dev-tool/src/injector-helper';
import { MockInjector } from '../../../../tools/dev-tool/src/mock-injector';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createBrowserInjector } from '../../../../tools/dev-tool/src/injector-helper';
import { MockInjector } from '../../../../tools/dev-tool/src/mock-injector';
import { IContextKeyService, IEventBus, ToolbarActionsWhenChangeEvent } from '../../src';
import { IContextKeyService } from '../../src';
import { IToolbarRegistry } from '../../src/toolbar';
import { NextToolbarRegistryImpl } from '../../src/toolbar/toolbar.registry';

Expand Down
1 change: 0 additions & 1 deletion packages/core-electron-main/src/bootstrap/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
IEventBus,
EventBusImpl,
asExtensionCandidate,
isUndefined,
} from '@opensumi/ide-core-common';
import { IElectronMainLifeCycleService } from '@opensumi/ide-core-common/lib/electron';
import { argv } from '@opensumi/ide-core-common/lib/node/cli';
Expand Down
1 change: 0 additions & 1 deletion packages/core-node/src/connection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import http from 'http';
import net from 'net';

import ws from 'ws';

import { Injector, InstanceCreator, ClassCreator, FactoryCreator } from '@opensumi/di';
import { WSChannel, initRPCService, RPCServiceCenter } from '@opensumi/ide-connection';
Expand Down
2 changes: 1 addition & 1 deletion packages/debug/src/browser/editor/debug-hover-model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Optional } from '@opensumi/di';
import { TreeModel, TreeNodeEvent, CompositeTreeNode } from '@opensumi/ide-components';
import { ThrottledDelayer, Emitter, Event } from '@opensumi/ide-core-browser';
import { ThrottledDelayer } from '@opensumi/ide-core-browser';

import { ExpressionContainer } from '../tree/debug-tree-node.define';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
ariaDescribedByIds,
descriptionId,
getTemplate,
labelValue,
FormContextType,
RJSFSchema,
StrictRJSFSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {
ArrayFieldTemplateItemType,
FieldTemplateProps,
FormContextType,
RJSFSchema,
StrictRJSFSchema,
} from '@rjsf/utils';
import cls from 'classnames';
import React, { Fragment, useMemo } from 'react';
import React, { useMemo } from 'react';

import styles from './json-templates.module.less';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IconButtonProps, SubmitButtonProps } from '@rjsf/utils';
import React, { useCallback, useEffect, useMemo } from 'react';
import React, { useCallback, useEffect } from 'react';

import { Button, ButtonProps, getIcon } from '@opensumi/ide-components';
import { Button, getIcon } from '@opensumi/ide-components';
import { defaultIconfont } from '@opensumi/ide-components/lib/icon/iconfont/iconMap';
import { useInjectable } from '@opensumi/ide-core-browser';
import { MenuActionList } from '@opensumi/ide-core-browser/lib/components/actions/index';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Optional } from '@opensumi/di';
import { TreeModel, TreeNodeEvent, CompositeTreeNode } from '@opensumi/ide-components';
import { ThrottledDelayer, Emitter, Event } from '@opensumi/ide-core-browser';
import { ThrottledDelayer } from '@opensumi/ide-core-browser';

import { ExpressionContainer } from '../../tree/debug-tree-node.define';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { DidChangeActiveDebugSession } from '../../debug-session-manager';
import { AnsiConsoleNode } from '../../tree';
import {
ExpressionContainer,
ExpressionNode,
DebugConsoleNode,
DebugConsoleRoot,
} from '../../tree/debug-tree-node.define';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Optional } from '@opensumi/di';
import { TreeModel, TreeNodeEvent, CompositeTreeNode } from '@opensumi/ide-components';
import { ThrottledDelayer, Emitter, Event } from '@opensumi/ide-core-browser';
import { ThrottledDelayer } from '@opensumi/ide-core-browser';

import { ExpressionContainer } from '../../tree/debug-tree-node.define';

Expand Down
2 changes: 1 addition & 1 deletion packages/debug/src/browser/view/watch/debug-watch-model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Optional } from '@opensumi/di';
import { TreeModel, TreeNodeEvent, CompositeTreeNode } from '@opensumi/ide-components';
import { ThrottledDelayer, Emitter, Event } from '@opensumi/ide-core-browser';
import { ThrottledDelayer } from '@opensumi/ide-core-browser';

import { ExpressionContainer } from '../../tree/debug-tree-node.define';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { AbstractContextMenuService, MenuId, ICtxMenuRenderer } from '@opensumi/

import { DebugSessionManager } from '../../debug-session-manager';
import { DebugWatch } from '../../model';
import { ExpressionContainer, ExpressionNode, DebugWatchNode, DebugWatchRoot } from '../../tree/debug-tree-node.define';
import { ExpressionContainer, DebugWatchNode, DebugWatchRoot } from '../../tree/debug-tree-node.define';
import { DebugViewModel } from '../debug-view-model';

import { CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_WATCH_ITEM_TYPE } from './../../../common/constants';
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/browser/breadcrumb/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
WithEventBus,
LRUMap,
path,
Schemes,
} from '@opensumi/ide-core-browser';
import { LabelService } from '@opensumi/ide-core-browser/lib/services';
import { FileStat } from '@opensumi/ide-file-service/lib/common';
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/browser/fs-resource/fs-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Autowired, Injectable } from '@opensumi/di';
import {
OperatingSystem,
URI,
MaybePromise,
WithEventBus,
localize,
formatLocalize,
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/browser/menu/breadcrumbs.menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
AbstractContextMenuService,
ICtxMenuRenderer,
MenuId,
IContextMenu,
} from '@opensumi/ide-core-browser/lib/menu/next';
import { URI } from '@opensumi/ide-core-common';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { WSChannel } from '@opensumi/ide-connection';
import { WSChannelHandler } from '@opensumi/ide-connection/lib/browser/ws-channel-handler';
import {
IContextKeyService,
ILogServiceManager,
StorageProvider,
DefaultStorageProvider,
createContributionProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Injector } from '@opensumi/di';
import { RPCProtocol } from '@opensumi/ide-connection/lib/common/rpcProtocol';
import { Emitter, CommandRegistry, CommandRegistryImpl } from '@opensumi/ide-core-common';
import { MonacoCommandService } from '@opensumi/ide-editor/lib/browser/monaco-contrib/command/command.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type vscode from 'vscode';

import { Injector } from '@opensumi/di';
import { RPCProtocol } from '@opensumi/ide-connection/lib/common/rpcProtocol';
import { Event, Uri, Emitter, DisposableCollection, CancellationToken } from '@opensumi/ide-core-common';
import { IDecorationsService } from '@opensumi/ide-decoration';
Expand Down
3 changes: 1 addition & 2 deletions packages/extension/__tests__/browser/main.thread.env.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Injector, Injectable } from '@opensumi/di';
import { Injectable } from '@opensumi/di';
import { RPCProtocol } from '@opensumi/ide-connection/lib/common/rpcProtocol';
import { AppConfig } from '@opensumi/ide-core-browser';
import {
Emitter,
ILoggerManagerClient,
LogServiceForClientPath,
LogLevel,
getLanguageId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Disposable } from '@opensumi/ide-core-common';
import { MockInjector } from '@opensumi/ide-dev-tool/src/mock-injector';
import { IExtension } from '@opensumi/ide-extension';
import { AbstractExtInstanceManagementService } from '@opensumi/ide-extension/lib/browser/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type vscode from 'vscode';

import { RPCProtocol } from '@opensumi/ide-connection';
import { WSChannelHandler } from '@opensumi/ide-connection/lib/browser/ws-channel-handler';
import { Emitter, ILoggerManagerClient, Uri, uuid } from '@opensumi/ide-core-common';
import { Emitter, Uri, uuid } from '@opensumi/ide-core-common';
import { MainThreadEnv } from '@opensumi/ide-extension/lib/browser/vscode/api/main.thread.env';
import { MainThreadAPIIdentifier, ExtHostAPIIdentifier } from '@opensumi/ide-extension/lib/common/vscode';
import { UIKind } from '@opensumi/ide-extension/lib/common/vscode/ext-types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
convertToVSCFileStat,
ExtHostFileSystem,
} from '@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.file-system';
import { FileChangeType, FileType, FileStat } from '@opensumi/ide-file-service/lib/common';
import { FileType, FileStat } from '@opensumi/ide-file-service/lib/common';

describe('convertToVSCFileStat', () => {
it('Should return normal conversion to VSCode format results.', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
} from '@opensumi/ide-terminal-next';
import {
createTerminalClientFactory2,
TerminalClientFactory,
} from '@opensumi/ide-terminal-next/lib/browser/terminal.client';
import { TerminalController } from '@opensumi/ide-terminal-next/lib/browser/terminal.controller';
import { TerminalEnvironmentService } from '@opensumi/ide-terminal-next/lib/browser/terminal.environment.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Emitter,
Disposable,
CancellationTokenSource,
CancellationToken,
uuid,
BinaryBuffer,
} from '@opensumi/ide-core-common';
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/__tests__/hosted/ext.host.proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import { INodeLogger, Event, getDebugLogger, Disposable } from '@opensumi/ide-core-node';
import { INodeLogger, Event, getDebugLogger } from '@opensumi/ide-core-node';
import { EnvironmentVariableServiceToken } from '@opensumi/ide-terminal-next/lib/common/environmentVariable';

import { createNodeInjector } from '../../../../tools/dev-tool/src/injector-helper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Optional } from '@opensumi/di';
import { TreeModel, TreeNodeEvent, CompositeTreeNode } from '@opensumi/ide-components';
import { ThrottledDelayer, Emitter, Event } from '@opensumi/ide-core-browser';
import { ThrottledDelayer } from '@opensumi/ide-core-browser';

import { ExtensionTreeRoot } from './tree-view.node.defined';

Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/common/vscode/data-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// Modified from https://github.com/microsoft/vscode/blob/f86ceb6749721ca068f0407914521ad11ca704a8/src/vs/base/common/dataTransfer.ts

import { Mimes, parse, Uri as URI, uuid } from '@opensumi/ide-core-common';
import { Mimes, Uri as URI, uuid } from '@opensumi/ide-core-common';

export const CodeDataTransfers = {
EDITORS: 'CodeEditors',
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/common/vscode/editor-tabs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as vscode from 'vscode';

import { Event, IDisposable, URI } from '@opensumi/ide-core-common';
import { Event, IDisposable } from '@opensumi/ide-core-common';

export interface IEditorTabDto {
group: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/common/vscode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { IExtHostSecret, IMainThreadSecret } from './secret';
import { IMainThreadStorage, IExtHostStorage } from './storage';
import { IExtHostTasks, IMainThreadTasks } from './tasks';
import { IExtHostTerminal, IMainThreadTerminal } from './terminal';
import { IExtHostTests, IMainThreadTesting } from './tests';
import { IExtHostTests } from './tests';
import { IExtHostTheming, IMainThreadTheming } from './theming';
import { IExtHostTreeView, IMainThreadTreeView } from './treeview';
import { IMainThreadUrls, IExtHostUrls } from './urls';
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/common/vscode/scm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IDisposable, UriComponents, IThemeColor } from '@opensumi/ide-core-common';
import type { IDisposable, UriComponents } from '@opensumi/ide-core-common';
import { CancellationToken } from '@opensumi/vscode-jsonrpc/lib/common/cancellation';

import { VSCommand } from './model.api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IRPCProtocol } from '@opensumi/ide-connection';
import { Emitter, Event, URI, Uri } from '@opensumi/ide-core-common';
import { Emitter, Event, Uri } from '@opensumi/ide-core-common';

import {
IExtHostEditorTabs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type vscode from 'vscode';

import { IRPCProtocol } from '@opensumi/ide-connection';
import { MessageType, IDisposable, CancellationToken, Emitter, IExtensionInfo } from '@opensumi/ide-core-common';
import { QuickInputOptions } from '@opensumi/ide-quick-open';

import {
IExtHostMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Selection, Range, ChainedCacheId, IWorkspaceEditDto } from '../../../..
import { CommandsConverter } from '../ext.host.command';

import { Diagnostics } from './diagnostics';
import { createToken } from './util';

export class CodeActionAdapter {
private static readonly _maxCodeActionsPerFile: number = 1000;
Expand Down
1 change: 0 additions & 1 deletion packages/extension/src/hosted/extension-log2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ILogService,
LogLevel,
IExtensionLogger,
ILogServiceManager,
} from '@opensumi/ide-core-common';
import { AppConfig } from '@opensumi/ide-core-node/lib/types';
import { LogServiceManager } from '@opensumi/ide-logs/lib/node/log-manager';
Expand Down
1 change: 0 additions & 1 deletion packages/file-scheme/src/browser/file-scheme-doc.client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Injectable, Autowired } from '@opensumi/di';
import { CancellationToken, IEditorDocumentModelSaveResult } from '@opensumi/ide-core-browser';

import { CancellationTokenSource } from '../../../utils/lib';
import {
IFileSchemeDocNodeService,
FileSchemeDocNodeServicePath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import { CancellationTokenSource } from '@opensumi/ide-core-common';
import { FileUri, URI, AppConfig, INodeLogger, NodeLogger } from '@opensumi/ide-core-node';
import { FileUri, AppConfig, INodeLogger, NodeLogger } from '@opensumi/ide-core-node';
import { createNodeInjector } from '@opensumi/ide-dev-tool/src/injector-helper';
import { ProcessModule } from '@opensumi/ide-process/lib/node';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as fse from 'fs-extra';
import temp from 'temp';

import { URI, isMacintosh } from '@opensumi/ide-core-common';
import { isMacintosh } from '@opensumi/ide-core-common';
import { FileUri } from '@opensumi/ide-core-node';

import { createNodeInjector } from '../../../../tools/dev-tool/src/injector-helper';
import { MockInjector } from '../../../../tools/dev-tool/src/mock-injector';
import { DidFilesChangedParams, FileChangeType } from '../../src/common';
import { FileSystemWatcherServer } from '../../src/node/file-service-watcher';

Expand Down
2 changes: 1 addition & 1 deletion packages/file-service/__tests__/node/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path';
import * as fse from 'fs-extra';

import { isWindows } from '@opensumi/ide-core-common';
import { URI, FileUri, AppConfig } from '@opensumi/ide-core-node';
import { URI, FileUri } from '@opensumi/ide-core-node';
import { expectThrowsAsync } from '@opensumi/ide-core-node/__tests__/helper';
import { MockInjector } from '@opensumi/ide-dev-tool/src/mock-injector';

Expand Down
2 changes: 1 addition & 1 deletion packages/file-service/src/node/file-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
Schemes,
} from '@opensumi/ide-core-node';

import { FileChangeEvent, EXT_LIST_IMAGE, TextDocumentContentChangeEvent } from '../common';
import { FileChangeEvent, TextDocumentContentChangeEvent } from '../common';
import {
FileSystemError,
FileStat,
Expand Down
Loading