Skip to content

Commit

Permalink
Sort all imports (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-grant-work authored Mar 15, 2024
1 parent bbf3e9d commit 4af1bfd
Show file tree
Hide file tree
Showing 24 changed files with 102 additions and 87 deletions.
17 changes: 16 additions & 1 deletion configs/errors.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,22 @@
}
}
],
"import/no-extraneous-dependencies": "error"
"import/no-extraneous-dependencies": "error",
"import/order": [
"error",
{
"alphabetize": {
"order": "asc"
}
}
],
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true,
"ignoreCase": true
}
]
},
"overrides": [
{
Expand Down
6 changes: 3 additions & 3 deletions src/common/messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

import type { DebugProtocol } from '@vscode/debugprotocol';
import type { NotificationType, RequestType } from 'vscode-messenger-common';
import { MemoryViewSettings } from '../webview/utils/view-types';
import type { VariableRange, WrittenMemory } from './memory-range';
import { DebugRequestTypes } from './debug-requests';
import { URI } from 'vscode-uri';
import { VariablesView } from '../plugin/external-views';
import { MemoryViewSettings } from '../webview/utils/view-types';
import { DebugRequestTypes } from './debug-requests';
import type { VariableRange, WrittenMemory } from './memory-range';
import { WebviewContext } from './webview-context';

// convenience types for easier readability and better semantics
Expand Down
4 changes: 2 additions & 2 deletions src/entry-points/browser/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

import * as vscode from 'vscode';
import { AdapterRegistry } from '../../plugin/adapter-registry/adapter-registry';
import { MemoryProvider } from '../../plugin/memory-provider';
import { MemoryWebview } from '../../plugin/memory-webview-main';
import { CAdapter } from '../../plugin/adapter-registry/c-adapter';
import { MemoryProvider } from '../../plugin/memory-provider';
import { MemoryStorage } from '../../plugin/memory-storage';
import { MemoryWebview } from '../../plugin/memory-webview-main';

export const activate = async (context: vscode.ExtensionContext): Promise<AdapterRegistry> => {
const registry = new AdapterRegistry();
Expand Down
4 changes: 2 additions & 2 deletions src/entry-points/desktop/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

import * as vscode from 'vscode';
import { AdapterRegistry } from '../../plugin/adapter-registry/adapter-registry';
import { MemoryProvider } from '../../plugin/memory-provider';
import { MemoryWebview } from '../../plugin/memory-webview-main';
import { CAdapter } from '../../plugin/adapter-registry/c-adapter';
import { MemoryProvider } from '../../plugin/memory-provider';
import { MemoryStorage } from '../../plugin/memory-storage';
import { MemoryWebview } from '../../plugin/memory-webview-main';

export const activate = async (context: vscode.ExtensionContext): Promise<AdapterRegistry> => {
const registry = new AdapterRegistry();
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/adapter-registry/adapter-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import * as vscode from 'vscode';
import { DebugProtocol } from '@vscode/debugprotocol';
import * as vscode from 'vscode';
import { isDebugRequest, isDebugResponse } from '../../common/debug-requests';
import { VariableRange } from '../../common/memory-range';
import { Logger } from '../logger';
import { isDebugRequest, isDebugResponse } from '../../common/debug-requests';

/** Represents capabilities that may be achieved with particular debug adapters but are not part of the DAP */
export interface AdapterCapabilities {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/adapter-registry/adapter-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
********************************************************************************/

import * as vscode from 'vscode';
import { AdapterCapabilities } from './adapter-capabilities';
import { outputChannelLogger as logger } from '../logger';
import { AdapterCapabilities } from './adapter-capabilities';

export class AdapterRegistry implements vscode.Disposable {
protected handlers = new Map<string, AdapterCapabilities>();
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/adapter-registry/c-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
********************************************************************************/

import * as vscode from 'vscode';
import { outputChannelLogger } from '../logger';
import * as manifest from '../manifest';
import { VariableTracker } from './adapter-capabilities';
import { outputChannelLogger } from '../logger';
import { AdapterRegistry } from './adapter-registry';
import { CTracker } from './c-tracker';

Expand Down
6 changes: 3 additions & 3 deletions src/plugin/adapter-registry/c-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import * as vscode from 'vscode';
import { DebugProtocol } from '@vscode/debugprotocol';
import { AdapterVariableTracker, extractAddress, notADigit } from './adapter-capabilities';
import { toHexStringWithRadixMarker, VariableRange } from '../../common/memory-range';
import * as vscode from 'vscode';
import { sendRequest } from '../../common/debug-requests';
import { toHexStringWithRadixMarker, VariableRange } from '../../common/memory-range';
import { AdapterVariableTracker, extractAddress, notADigit } from './adapter-capabilities';

export namespace CEvaluateExpression {
export function sizeOf(expression: string): string {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/external-views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
********************************************************************************/

import { DebugProtocol } from '@vscode/debugprotocol';
import { isDebugVariable, isDebugScope, isDebugEvaluateArguments } from '../common/debug-requests';
import { isDebugEvaluateArguments, isDebugScope, isDebugVariable } from '../common/debug-requests';

export namespace VariablesView {
// from https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/debug/browser/variablesView.ts
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
********************************************************************************/

import * as vscode from 'vscode';
import * as manifest from './manifest';
import { stringifyWithBigInts } from '../common/typescript';
import * as manifest from './manifest';

export enum Verbosity {
off = 0,
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/memory-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

import { DebugProtocol } from '@vscode/debugprotocol';
import * as vscode from 'vscode';
import { isDebugEvent, isDebugRequest, isDebugResponse, sendRequest } from '../common/debug-requests';
import { stringToBytesMemory } from '../common/memory';
import { VariableRange, WrittenMemory } from '../common/memory-range';
import { ReadMemoryResult, SessionContext, WriteMemoryResult } from '../common/messaging';
import { AdapterRegistry } from './adapter-registry/adapter-registry';
import * as manifest from './manifest';
import { isDebugEvent, isDebugRequest, isDebugResponse, sendRequest } from '../common/debug-requests';
import { stringToBytesMemory } from '../common/memory';

export interface LabeledUint8Array extends Uint8Array {
label?: string;
Expand Down
6 changes: 3 additions & 3 deletions src/plugin/memory-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
validateCount, validateMemoryReference, validateOffset
} from '../common/memory';
import { toHexStringWithRadixMarker } from '../common/memory-range';
import * as manifest from './manifest';
import { MemoryProvider } from './memory-provider';
import { ApplyMemoryArguments, ApplyMemoryResult, MemoryOptions, StoreMemoryArguments } from '../common/messaging';
import { isVariablesContext } from './external-views';
import { isWebviewContext } from '../common/webview-context';
import { isVariablesContext } from './external-views';
import * as manifest from './manifest';
import { MemoryProvider } from './memory-provider';

export const StoreCommandType = `${manifest.PACKAGE_NAME}.store-file`;
export const ApplyCommandType = `${manifest.PACKAGE_NAME}.apply-file`;
Expand Down
20 changes: 10 additions & 10 deletions src/plugin/memory-webview-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ import { Messenger } from 'vscode-messenger';
import { WebviewIdMessageParticipant } from 'vscode-messenger-common';
import { Endianness, VariableRange } from '../common/memory-range';
import {
MemoryOptions,
ReadMemoryArguments,
ReadMemoryResult,
SessionContext,
StoreMemoryArguments,
WebviewSelection,
WriteMemoryArguments,
WriteMemoryResult,
applyMemoryType,
getVariablesType,
getWebviewSelectionType,
logMessageType,
MemoryOptions,
memoryWrittenType,
ReadMemoryArguments,
ReadMemoryResult,
readMemoryType,
readyType,
resetMemoryViewSettingsType,
SessionContext,
sessionContextChangedType,
setMemoryViewSettingsType,
setOptionsType,
setTitleType,
showAdvancedOptionsType,
StoreMemoryArguments,
storeMemoryType,
WebviewSelection,
WriteMemoryArguments,
WriteMemoryResult,
writeMemoryType,
} from '../common/messaging';
import { WebviewContext, getVisibleColumns } from '../common/webview-context';
import { getVisibleColumns, WebviewContext } from '../common/webview-context';
import { AddressPaddingOptions, MemoryViewSettings, ScrollingBehavior } from '../webview/utils/view-types';
import { isVariablesContext } from './external-views';
import { outputChannelLogger } from './logger';
import * as manifest from './manifest';
import { MemoryProvider } from './memory-provider';
import { ApplyCommandType, StoreCommandType } from './memory-storage';
import { isVariablesContext } from './external-views';

enum RefreshEnum {
off = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/webview/columns/address-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
********************************************************************************/

import React, { ReactNode } from 'react';
import { Memory } from '../../common/memory';
import { BigIntMemoryRange, getAddressString, getRadixMarker } from '../../common/memory-range';
import { ColumnContribution, ColumnFittingType, TableRenderOptions } from './column-contribution-service';
import { Memory } from '../../common/memory';

export class AddressColumn implements ColumnContribution {
static ID = 'address';
Expand Down
2 changes: 1 addition & 1 deletion src/webview/columns/ascii-column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
********************************************************************************/

import { ReactNode } from 'react';
import { Memory } from '../../common/memory';
import { BigIntMemoryRange, toOffset } from '../../common/memory-range';
import { ColumnContribution, TableRenderOptions } from './column-contribution-service';
import { Memory } from '../../common/memory';

function isPrintableAsAscii(input: number): boolean {
return input >= 32 && input < (128 - 1);
Expand Down
4 changes: 2 additions & 2 deletions src/webview/columns/column-contribution-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
********************************************************************************/

import type * as React from 'react';
import { BigIntMemoryRange } from '../../common/memory-range';
import type { Disposable, MemoryState, SerializedTableRenderOptions, UpdateExecutor } from '../utils/view-types';
import { Memory } from '../../common/memory';
import { BigIntMemoryRange } from '../../common/memory-range';
import { ReadMemoryArguments } from '../../common/messaging';
import type { Disposable, MemoryState, SerializedTableRenderOptions, UpdateExecutor } from '../utils/view-types';

export type ColumnFittingType = 'content-width';

Expand Down
8 changes: 4 additions & 4 deletions src/webview/columns/data-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
********************************************************************************/

import * as React from 'react';
import { Memory } from '../../common/memory';
import { BigIntMemoryRange, Endianness, toOffset } from '../../common/memory-range';
import type { MemorySizeOptions } from '../components/memory-table';
import { decorationService } from '../decorations/decoration-service';
import { FullNodeAttributes } from '../utils/view-types';
import { characterWidthInContainer, elementInnerWidth } from '../utils/window';
import { ColumnContribution, TableRenderOptions } from './column-contribution-service';
import { decorationService } from '../decorations/decoration-service';
import type { MemorySizeOptions } from '../components/memory-table';
import { elementInnerWidth, characterWidthInContainer } from '../utils/window';
import { Memory } from '../../common/memory';

export class DataColumn implements ColumnContribution {
static CLASS_NAME = 'column-data';
Expand Down
20 changes: 10 additions & 10 deletions src/webview/components/memory-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import isDeepEqual from 'fast-deep-equal';
import { debounce } from 'lodash';
import memoize from 'memoize-one';
import { Column } from 'primereact/column';
import { DataTable, DataTableCellSelection, DataTableProps, DataTableSelectionCellChangeEvent } from 'primereact/datatable';
import { ProgressSpinner } from 'primereact/progressspinner';
import { Tooltip } from 'primereact/tooltip';
import React from 'react';
import { TableRenderOptions } from '../columns/column-contribution-service';
import { Decoration, MemoryDisplayConfiguration, ScrollingBehavior, isTrigger } from '../utils/view-types';
import isDeepEqual from 'fast-deep-equal';
import { TooltipEvent } from 'primereact/tooltip/tooltipoptions';
import { classNames } from 'primereact/utils';
import { tryToNumber } from '../../common/typescript';
import { DataColumn } from '../columns/data-column';
import { createColumnVscodeContext, createSectionVscodeContext } from '../utils/vscode-contexts';
import React from 'react';
import { Memory } from '../../common/memory';
import { WebviewSelection } from '../../common/messaging';
import { MemoryOptions, ReadMemoryArguments } from '../../common/messaging';
import { Memory } from '../../common/memory';
import { debounce } from 'lodash';
import { tryToNumber } from '../../common/typescript';
import { TableRenderOptions } from '../columns/column-contribution-service';
import { DataColumn } from '../columns/data-column';
import type { HoverService } from '../hovers/hover-service';
import { TooltipEvent } from 'primereact/tooltip/tooltipoptions';
import { Decoration, isTrigger, MemoryDisplayConfiguration, ScrollingBehavior } from '../utils/view-types';
import { createColumnVscodeContext, createSectionVscodeContext } from '../utils/vscode-contexts';

export interface MoreMemorySelectProps {
activeReadArguments: Required<ReadMemoryArguments>;
Expand Down
12 changes: 6 additions & 6 deletions src/webview/components/memory-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
********************************************************************************/

import React from 'react';
import { ColumnStatus } from '../columns/column-contribution-service';
import { Decoration, MemoryDisplayConfiguration, MemoryState } from '../utils/view-types';
import { MemoryTable } from './memory-table';
import { OptionsWidget } from './options-widget';
import { WebviewIdMessageParticipant } from 'vscode-messenger-common';
import { VscodeContext, createAppVscodeContext } from '../utils/vscode-contexts';
import { Memory } from '../../common/memory';
import { WebviewSelection } from '../../common/messaging';
import { MemoryOptions, ReadMemoryArguments, SessionContext } from '../../common/messaging';
import { Memory } from '../../common/memory';
import { ColumnStatus } from '../columns/column-contribution-service';
import { HoverService } from '../hovers/hover-service';
import { Decoration, MemoryDisplayConfiguration, MemoryState } from '../utils/view-types';
import { createAppVscodeContext, VscodeContext } from '../utils/vscode-contexts';
import { MemoryTable } from './memory-table';
import { OptionsWidget } from './options-widget';

interface MemoryWidgetProps extends MemoryDisplayConfiguration {
messageParticipant: WebviewIdMessageParticipant;
Expand Down
14 changes: 7 additions & 7 deletions src/webview/components/options-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@

import { Formik, FormikConfig, FormikErrors, FormikProps } from 'formik';
import { Button } from 'primereact/button';
import { Checkbox } from 'primereact/checkbox';
import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown';
import { InputText } from 'primereact/inputtext';
import { OverlayPanel } from 'primereact/overlaypanel';
import { classNames } from 'primereact/utils';
import React, { FocusEventHandler, KeyboardEvent, KeyboardEventHandler, MouseEventHandler, ReactNode } from 'react';
import { validateCount, validateMemoryReference, validateOffset } from '../../common/memory';
import { Endianness } from '../../common/memory-range';
import { MemoryOptions, ReadMemoryArguments, SessionContext } from '../../common/messaging';
import { tryToNumber } from '../../common/typescript';
import { CONFIG_BYTES_PER_WORD_CHOICES, CONFIG_GROUPS_PER_ROW_CHOICES, CONFIG_WORDS_PER_GROUP_CHOICES } from '../../plugin/manifest';
import { TableRenderOptions } from '../columns/column-contribution-service';
import { AddressPaddingOptions, MemoryState, SerializedTableRenderOptions } from '../utils/view-types';
import { MultiSelectWithLabel } from './multi-select';
import { CONFIG_BYTES_PER_WORD_CHOICES, CONFIG_GROUPS_PER_ROW_CHOICES, CONFIG_WORDS_PER_GROUP_CHOICES } from '../../plugin/manifest';
import { tryToNumber } from '../../common/typescript';
import { Checkbox } from 'primereact/checkbox';
import { MemoryOptions, ReadMemoryArguments, SessionContext } from '../../common/messaging';
import { validateMemoryReference, validateOffset, validateCount } from '../../common/memory';
import { Endianness } from '../../common/memory-range';
import { createSectionVscodeContext } from '../utils/vscode-contexts';
import { MultiSelectWithLabel } from './multi-select';

export interface OptionsWidgetProps
extends Omit<TableRenderOptions, 'scrollingBehavior' | 'effectiveAddressLength'> {
Expand Down
2 changes: 1 addition & 1 deletion src/webview/hovers/hover-service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import * as React from 'react';
import { HOST_EXTENSION } from 'vscode-messenger-common';
import { logMessageType } from '../../common/messaging';
import { MemoryAppState } from '../memory-webview-view';
import { Disposable, MemoryDisplayConfiguration } from '../utils/view-types';
import { messenger } from '../view-messenger';
import { MemoryAppState } from '../memory-webview-view';

export interface HoverableDetails {
columnId: string;
Expand Down
Loading

0 comments on commit 4af1bfd

Please sign in to comment.