diff --git a/src/fuzz/fuzzing.test.ts b/src/fuzz/fuzzing.test.ts index 04ca01a..46ccfef 100644 --- a/src/fuzz/fuzzing.test.ts +++ b/src/fuzz/fuzzing.test.ts @@ -1,11 +1,11 @@ import { test } from "node:test"; import assert from "node:assert/strict"; import fc from "fast-check"; -import { MessageReader, encodeMessage, stringifyJson } from "../tcf/channel"; -import { parseJson, toBigInt } from "../tcf/json"; -import { MAX_ADDRESS } from "../shared/targetMemory/format"; -import { encodeNeedle, MAX_NEEDLE_LENGTH } from "../shared/targetMemory/needle"; -import { scanMemory } from "../shared/targetMemory/search"; +import { MessageReader, encodeMessage, stringifyJson } from "@/tcf/channel"; +import { parseJson, toBigInt } from "@/tcf/json"; +import { MAX_ADDRESS } from "@/shared/targetMemory/format"; +import { encodeNeedle, MAX_NEEDLE_LENGTH } from "@/shared/targetMemory/needle"; +import { scanMemory } from "@/shared/targetMemory/search"; const options = { numRuns: 1000 }; const endianness = fc.constantFrom("little", "big"); diff --git a/src/launchSettings/webview/launchSettings.ts b/src/launchSettings/webview/launchSettings.ts index 037d85c..ceea051 100644 --- a/src/launchSettings/webview/launchSettings.ts +++ b/src/launchSettings/webview/launchSettings.ts @@ -1,5 +1,5 @@ -import type { LaunchConfiguration } from "../launchJson"; -import type { JsonPath, StateMessage, WebviewMessage } from "../protocol"; +import type { LaunchConfiguration } from "@/launchSettings/launchJson"; +import type { JsonPath, StateMessage, WebviewMessage } from "@/launchSettings/protocol"; import { agentAddress, editList, @@ -10,7 +10,7 @@ import { parseInput, toggleChoice, valueAtPath, -} from "../schema"; +} from "@/launchSettings/schema"; /* * The launch configurations form: configuration names on the left, the attributes diff --git a/src/targetMemory/memoryClient.ts b/src/targetMemory/memoryClient.ts index 6c881d9..904def8 100644 --- a/src/targetMemory/memoryClient.ts +++ b/src/targetMemory/memoryClient.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; -import * as req from "../tcfRequests"; -import { MemoryAccessMode, type ByteRange } from "../tcf/services/memory"; +import * as req from "@/tcfRequests"; +import { MemoryAccessMode, type ByteRange } from "@/tcf/services/memory"; export interface ReadResult { bytes: Uint8Array; diff --git a/src/targetMemory/targetMemoryManager.ts b/src/targetMemory/targetMemoryManager.ts index d26de2c..8df800b 100644 --- a/src/targetMemory/targetMemoryManager.ts +++ b/src/targetMemory/targetMemoryManager.ts @@ -1,14 +1,14 @@ import * as vscode from "vscode"; import type { DebugProtocol } from "@vscode/debugprotocol"; -import * as req from "../tcfRequests"; -import { BYTES_PER_ROW_OPTIONS, GROUP_SIZES, addressFromValue, parseAddress } from "../shared/targetMemory/format"; -import { INT_SIZES } from "../shared/targetMemory/needle"; +import * as req from "@/tcfRequests"; +import { BYTES_PER_ROW_OPTIONS, GROUP_SIZES, addressFromValue, parseAddress } from "@/shared/targetMemory/format"; +import { INT_SIZES } from "@/shared/targetMemory/needle"; import { DEFAULT_SETTINGS, type ContextMenuCommand, type PanelSettings, type PhysicalContext, -} from "../shared/targetMemory/protocol"; +} from "@/shared/targetMemory/protocol"; import { TargetMemoryClient } from "./memoryClient"; import { TargetMemoryPanel, errorText } from "./targetMemoryPanel"; diff --git a/src/targetMemory/targetMemoryPanel.ts b/src/targetMemory/targetMemoryPanel.ts index 98878c7..7fe13b3 100644 --- a/src/targetMemory/targetMemoryPanel.ts +++ b/src/targetMemory/targetMemoryPanel.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; import { randomBytes } from "crypto"; -import { formatHex, hexString as hex, parseAddress } from "../shared/targetMemory/format"; +import { formatHex, hexString as hex, parseAddress } from "@/shared/targetMemory/format"; import { TARGET_MEMORY_VIEW_TYPE, type ContextMenuCommand, @@ -9,7 +9,7 @@ import { type MenuTarget, type TargetState, type ToWebview, -} from "../shared/targetMemory/protocol"; +} from "@/shared/targetMemory/protocol"; import type { TargetMemoryClient } from "./memoryClient"; import type { TargetMemoryManager } from "./targetMemoryManager"; diff --git a/src/tcf/services/breakpoints.ts b/src/tcf/services/breakpoints.ts index 7d1da04..edf090d 100644 --- a/src/tcf/services/breakpoints.ts +++ b/src/tcf/services/breakpoints.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /** Breakpoint properties, see TCF Services -> Breakpoints -> set. */ export interface BreakpointProperties { diff --git a/src/tcf/services/commandLine.ts b/src/tcf/services/commandLine.ts index ab586a3..a800f0b 100644 --- a/src/tcf/services/commandLine.ts +++ b/src/tcf/services/commandLine.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /* * The Simics CommandLine service, see CommandLine-service.md in the Simics TCF diff --git a/src/tcf/services/disassembly.ts b/src/tcf/services/disassembly.ts index 527560e..27d6191 100644 --- a/src/tcf/services/disassembly.ts +++ b/src/tcf/services/disassembly.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; export interface DisassemblyField { Type?: string; diff --git a/src/tcf/services/expressions.ts b/src/tcf/services/expressions.ts index 99835e6..5e8bc97 100644 --- a/src/tcf/services/expressions.ts +++ b/src/tcf/services/expressions.ts @@ -1,4 +1,4 @@ -import { TcfChannel, formatTcfError } from "../channel"; +import { TcfChannel, formatTcfError } from "@/tcf/channel"; /** Type classes, see TCF Services -> Symbols -> TypeClass. */ export const enum TypeClass { diff --git a/src/tcf/services/lineNumbers.ts b/src/tcf/services/lineNumbers.ts index 8233532..c13f3e3 100644 --- a/src/tcf/services/lineNumbers.ts +++ b/src/tcf/services/lineNumbers.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /** A code area, see TCF Services -> Line Numbers. */ export interface CodeArea { diff --git a/src/tcf/services/memory.ts b/src/tcf/services/memory.ts index bea4200..a9dbd25 100644 --- a/src/tcf/services/memory.ts +++ b/src/tcf/services/memory.ts @@ -1,5 +1,5 @@ -import { TcfChannel, TcfError, formatTcfError } from "../channel"; -import { toBigInt } from "../json"; +import { TcfChannel, TcfError, formatTcfError } from "@/tcf/channel"; +import { toBigInt } from "@/tcf/json"; /** Memory context properties, see TCF Services -> Memory. */ export interface MemoryContext { diff --git a/src/tcf/services/memoryMap.ts b/src/tcf/services/memoryMap.ts index d001889..cf223d1 100644 --- a/src/tcf/services/memoryMap.ts +++ b/src/tcf/services/memoryMap.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /** Memory map region properties, see TCF Services -> Memory Map. */ export interface MemoryRegionProperties { diff --git a/src/tcf/services/pathMap.ts b/src/tcf/services/pathMap.ts index 17120d4..44d99c7 100644 --- a/src/tcf/services/pathMap.ts +++ b/src/tcf/services/pathMap.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /** Path map rule properties, see TCF Services -> Path Map. */ export interface PathMapRuleProperties { diff --git a/src/tcf/services/registers.ts b/src/tcf/services/registers.ts index 4f73622..f4dfe6d 100644 --- a/src/tcf/services/registers.ts +++ b/src/tcf/services/registers.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; export interface NamedValue { Name?: string; diff --git a/src/tcf/services/runControl.ts b/src/tcf/services/runControl.ts index 81679bb..6ca821e 100644 --- a/src/tcf/services/runControl.ts +++ b/src/tcf/services/runControl.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /** RunControl context properties, see TCF Services -> Run Control. */ export interface RunControlContext { diff --git a/src/tcf/services/stackTrace.ts b/src/tcf/services/stackTrace.ts index 703c431..ea5d0a0 100644 --- a/src/tcf/services/stackTrace.ts +++ b/src/tcf/services/stackTrace.ts @@ -1,4 +1,4 @@ -import { TcfChannel, TcfError, formatTcfError } from "../channel"; +import { TcfChannel, TcfError, formatTcfError } from "@/tcf/channel"; import { CodeArea } from "./lineNumbers"; /** Stack frame context properties, see TCF Services -> Stack Trace. */ diff --git a/src/tcf/services/symbols.ts b/src/tcf/services/symbols.ts index e5d4a43..5bc304e 100644 --- a/src/tcf/services/symbols.ts +++ b/src/tcf/services/symbols.ts @@ -1,4 +1,4 @@ -import { TcfChannel } from "../channel"; +import { TcfChannel } from "@/tcf/channel"; /** Symbol classes, see TCF Services -> Symbols -> SymbolClass. */ export const enum SymbolClass { diff --git a/src/test/breakpointManager.test.ts b/src/test/breakpointManager.test.ts index 1bf7b78..df4da5c 100644 --- a/src/test/breakpointManager.test.ts +++ b/src/test/breakpointManager.test.ts @@ -1,15 +1,15 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import { BreakpointHost, BreakpointManager, parseHitCondition } from "../breakpointManager"; -import { instructionReference } from "../disassembly"; -import { formatFunctionBreakpointName, parseFunctionBreakpointName } from "../functionBreakpoint"; -import { PathMapper } from "../pathMapper"; +import { BreakpointHost, BreakpointManager, parseHitCondition } from "@/breakpointManager"; +import { instructionReference } from "@/disassembly"; +import { formatFunctionBreakpointName, parseFunctionBreakpointName } from "@/functionBreakpoint"; +import { PathMapper } from "@/pathMapper"; import { BreakpointCapabilities, BreakpointProperties, BreakpointStatus, BreakpointsService, -} from "../tcf/services/breakpoints"; +} from "@/tcf/services/breakpoints"; // TCF ignores the first IgnoreCount hits, so "N" means ignore N-1 hits. // Zero and extra spaces are allowed. diff --git a/src/test/callStackFrame.test.ts b/src/test/callStackFrame.test.ts index 9190326..b3b07c7 100644 --- a/src/test/callStackFrame.test.ts +++ b/src/test/callStackFrame.test.ts @@ -1,6 +1,6 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import { parseCallStackContext } from "../callStackFrame"; +import { parseCallStackContext } from "@/callStackFrame"; test("parseCallStackContext reads the thread and frame index", () => { assert.deepEqual( diff --git a/src/test/channel.test.ts b/src/test/channel.test.ts index 73b667c..5c445ef 100644 --- a/src/test/channel.test.ts +++ b/src/test/channel.test.ts @@ -1,8 +1,8 @@ import { test } from "node:test"; import assert from "node:assert/strict"; import * as net from "net"; -import { MessageReader, TcfChannel, TraceMessage, encodeMessage, formatTcfError, stringifyJson } from "../tcf/channel"; -import { parseJson, toBigInt } from "../tcf/json"; +import { MessageReader, TcfChannel, TraceMessage, encodeMessage, formatTcfError, stringifyJson } from "@/tcf/channel"; +import { parseJson, toBigInt } from "@/tcf/json"; const ESC = 3; diff --git a/src/test/disassembly.test.ts b/src/test/disassembly.test.ts index 87a4879..3adb414 100644 --- a/src/test/disassembly.test.ts +++ b/src/test/disassembly.test.ts @@ -7,9 +7,9 @@ import { DisassemblyCache, KnownInstructionStarts, parseInstructionReference, -} from "../disassembly"; -import { TcfError } from "../tcf/channel"; -import { DisassemblyLine } from "../tcf/services/disassembly"; +} from "@/disassembly"; +import { TcfError } from "@/tcf/channel"; +import { DisassemblyLine } from "@/tcf/services/disassembly"; const NOP = Buffer.from([0x90, 0x90, 0x90, 0x90]).toString("base64"); diff --git a/src/test/expressions.test.ts b/src/test/expressions.test.ts index fc01b40..e8e3114 100644 --- a/src/test/expressions.test.ts +++ b/src/test/expressions.test.ts @@ -1,6 +1,6 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import { TypeClass, ValueProperties, formatExpressionValue } from "../tcf/services/expressions"; +import { TypeClass, ValueProperties, formatExpressionValue } from "@/tcf/services/expressions"; function format(bytes: number[], properties: ValueProperties): string { return formatExpressionValue({ bytes: Buffer.from(bytes), properties }); diff --git a/src/test/functionHeaders.test.ts b/src/test/functionHeaders.test.ts index 793ea75..41eb445 100644 --- a/src/test/functionHeaders.test.ts +++ b/src/test/functionHeaders.test.ts @@ -7,7 +7,7 @@ import { functionHeaderLine, functionHeaderSource, functionHeaderText, -} from "../functionHeaders"; +} from "@/functionHeaders"; /** Lookup over fixed functions, counting the addresses asked for. */ function fakeLookup(functions: FunctionInfo[]) { diff --git a/src/test/fuzzing.test.ts b/src/test/fuzzing.test.ts index 9a6641e..8ae558d 100644 --- a/src/test/fuzzing.test.ts +++ b/src/test/fuzzing.test.ts @@ -1 +1 @@ -import "../fuzz/fuzzing.test"; +import "@/fuzz/fuzzing.test"; diff --git a/src/test/launchJson.test.ts b/src/test/launchJson.test.ts index 140da44..64ca922 100644 --- a/src/test/launchJson.test.ts +++ b/src/test/launchJson.test.ts @@ -12,7 +12,7 @@ import { setPathMapRules, setNamedConfigurationValue, uniqueName, -} from "../launchSettings/launchJson"; +} from "@/launchSettings/launchJson"; const LAUNCH = `{ // Comment at the top. diff --git a/src/test/pathMapper.test.ts b/src/test/pathMapper.test.ts index 2c6cb5a..3321450 100644 --- a/src/test/pathMapper.test.ts +++ b/src/test/pathMapper.test.ts @@ -10,8 +10,8 @@ import { parsePathMapConfig, pathMapProblems, pathMapContextQuery, -} from "../pathMapper"; -import { PathMapRuleProperties, PathMapService } from "../tcf/services/pathMap"; +} from "@/pathMapper"; +import { PathMapRuleProperties, PathMapService } from "@/tcf/services/pathMap"; function fakePathMapService(agentRules: PathMapRuleProperties[] | Error) { const sets: PathMapRuleProperties[][] = []; diff --git a/src/test/schema.test.ts b/src/test/schema.test.ts index 42a2160..be1ab49 100644 --- a/src/test/schema.test.ts +++ b/src/test/schema.test.ts @@ -14,8 +14,8 @@ import { parseInput, toggleChoice, valueAtPath, -} from "../launchSettings/schema"; -import { DEFAULT_TRACE_SILENCE } from "../tcf/traceSilence"; +} from "@/launchSettings/schema"; +import { DEFAULT_TRACE_SILENCE } from "@/tcf/traceSilence"; // The bundled test runs from out/test. const PACKAGE_JSON: unknown = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "..", "package.json"), "utf8")); diff --git a/src/test/simicsConsole.test.ts b/src/test/simicsConsole.test.ts index 33da9e5..f7122ef 100644 --- a/src/test/simicsConsole.test.ts +++ b/src/test/simicsConsole.test.ts @@ -14,8 +14,8 @@ import { isEmptySession, simicsCliOptions, trimHistory, -} from "../simicsConsole"; -import { TcfError } from "../tcf/channel"; +} from "@/simicsConsole"; +import { TcfError } from "@/tcf/channel"; const SHIFT = 1; const CTRL = 2; diff --git a/src/test/symbolFiles.test.ts b/src/test/symbolFiles.test.ts index 07832da..3ed69dd 100644 --- a/src/test/symbolFiles.test.ts +++ b/src/test/symbolFiles.test.ts @@ -9,8 +9,8 @@ import { describeForeignSymbolFile, formatSymbolFileAddress, parseSymbolFilesConfig, -} from "../symbolFiles"; -import { MemoryMapService, MemoryRegionProperties } from "../tcf/services/memoryMap"; +} from "@/symbolFiles"; +import { MemoryMapService, MemoryRegionProperties } from "@/tcf/services/memoryMap"; // No setting gives no files and no errors. A setting that is not a list // is an error. diff --git a/src/test/targetMemory.test.ts b/src/test/targetMemory.test.ts index 4072f3a..bd899c0 100644 --- a/src/test/targetMemory.test.ts +++ b/src/test/targetMemory.test.ts @@ -8,17 +8,17 @@ import { inspectBytes, parseAddress, setNibble, -} from "../shared/targetMemory/format"; -import { encodeNeedle } from "../shared/targetMemory/needle"; +} from "@/shared/targetMemory/format"; +import { encodeNeedle } from "@/shared/targetMemory/needle"; import { findInChunk, planChunks, scanMemory, type ScanRead, type SearchDirection, -} from "../shared/targetMemory/search"; -import { ByteState, MemoryCache } from "../webview/targetMemory/memoryCache"; -import type { FromWebview } from "../shared/targetMemory/protocol"; +} from "@/shared/targetMemory/search"; +import { ByteState, MemoryCache } from "@/webview/targetMemory/memoryCache"; +import type { FromWebview } from "@/shared/targetMemory/protocol"; const bytes = (...b: number[]) => Uint8Array.from(b); diff --git a/src/test/targetMemoryAdapter.test.ts b/src/test/targetMemoryAdapter.test.ts index 6ed98e0..21423a7 100644 --- a/src/test/targetMemoryAdapter.test.ts +++ b/src/test/targetMemoryAdapter.test.ts @@ -1,9 +1,9 @@ import { test } from "node:test"; import assert from "node:assert/strict"; import type { DebugProtocol } from "@vscode/debugprotocol"; -import { TcfDebugSession } from "../tcfDebugSession"; -import type { MemoryReadResult } from "../tcf/services/memory"; -import * as req from "../tcfRequests"; +import { TcfDebugSession } from "@/tcfDebugSession"; +import type { MemoryReadResult } from "@/tcf/services/memory"; +import * as req from "@/tcfRequests"; /** A debug session with a fake Memory service holding `data` at `base`. */ function sessionWithMemory( diff --git a/src/test/tcfDebugSession.test.ts b/src/test/tcfDebugSession.test.ts index bdcc009..b96cd54 100644 --- a/src/test/tcfDebugSession.test.ts +++ b/src/test/tcfDebugSession.test.ts @@ -1,10 +1,10 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import { TcfDebugSession, formatRegisterValue, selectStepMode } from "../tcfDebugSession"; -import { ResumeMode } from "../tcf/services/runControl"; +import { TcfDebugSession, formatRegisterValue, selectStepMode } from "@/tcfDebugSession"; +import { ResumeMode } from "@/tcf/services/runControl"; import type { DebugProtocol } from "@vscode/debugprotocol"; -import type { LineNumbersService } from "../tcf/services/lineNumbers"; -import { PathMapper } from "../pathMapper"; +import type { LineNumbersService } from "@/tcf/services/lineNumbers"; +import { PathMapper } from "@/pathMapper"; import * as fs from "fs"; import * as os from "os"; import * as path from "path"; diff --git a/src/test/traceSilence.test.ts b/src/test/traceSilence.test.ts index da47e70..9ac4f06 100644 --- a/src/test/traceSilence.test.ts +++ b/src/test/traceSilence.test.ts @@ -1,7 +1,7 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import type { TraceMessage } from "../tcf/channel"; -import { DEFAULT_TRACE_SILENCE, TraceSilenceRule, isSilenced, parseTraceSilence } from "../tcf/traceSilence"; +import type { TraceMessage } from "@/tcf/channel"; +import { DEFAULT_TRACE_SILENCE, TraceSilenceRule, isSilenced, parseTraceSilence } from "@/tcf/traceSilence"; // The default keeps the trace to the debugger's own traffic: no heartbeats or // other peer events, and nothing from the Simics console. diff --git a/src/webview/targetMemory/App.tsx b/src/webview/targetMemory/App.tsx index ac80f88..ab064c7 100644 --- a/src/webview/targetMemory/App.tsx +++ b/src/webview/targetMemory/App.tsx @@ -6,7 +6,7 @@ import { formatGroup, asciiChar, hexString, -} from "../../shared/targetMemory/format"; +} from "@/shared/targetMemory/format"; import { DEFAULT_SETTINGS, type ContextMenuCommand, @@ -15,7 +15,7 @@ import { type PanelSettings, type TargetState, type ToWebview, -} from "../../shared/targetMemory/protocol"; +} from "@/shared/targetMemory/protocol"; import { MemoryCache } from "./memoryCache"; import { onMessage, post } from "./vscode"; import { GridHeader, MemoryGrid, selectionRange, type GridHandle, type Selection } from "./components/MemoryGrid"; diff --git a/src/webview/targetMemory/components/FindWidget.tsx b/src/webview/targetMemory/components/FindWidget.tsx index f997e7d..62b1aeb 100644 --- a/src/webview/targetMemory/components/FindWidget.tsx +++ b/src/webview/targetMemory/components/FindWidget.tsx @@ -5,16 +5,16 @@ import { hexString, parseAddress, type Endianness, -} from "../../../shared/targetMemory/format"; +} from "@/shared/targetMemory/format"; import { INT_SIZES, encodeNeedle, type EncodeResult, type FindFormat, type IntSize, -} from "../../../shared/targetMemory/needle"; -import { DEFAULT_SETTINGS, type FindSettings } from "../../../shared/targetMemory/protocol"; -import type { SearchDirection } from "../../../shared/targetMemory/search"; +} from "@/shared/targetMemory/needle"; +import { DEFAULT_SETTINGS, type FindSettings } from "@/shared/targetMemory/protocol"; +import type { SearchDirection } from "@/shared/targetMemory/search"; import { IconButton, Segmented } from "./controls"; export type FindStatus = diff --git a/src/webview/targetMemory/components/MemoryGrid.tsx b/src/webview/targetMemory/components/MemoryGrid.tsx index 36666c6..43816e5 100644 --- a/src/webview/targetMemory/components/MemoryGrid.tsx +++ b/src/webview/targetMemory/components/MemoryGrid.tsx @@ -10,8 +10,8 @@ import { hexString, setNibble, type Endianness, -} from "../../../shared/targetMemory/format"; -import { ByteState, type MemoryCache } from "../memoryCache"; +} from "@/shared/targetMemory/format"; +import { ByteState, type MemoryCache } from "@/webview/targetMemory/memoryCache"; export const ROW_HEIGHT = 20; /** diff --git a/src/webview/targetMemory/components/Toolbar.tsx b/src/webview/targetMemory/components/Toolbar.tsx index a723747..4469000 100644 --- a/src/webview/targetMemory/components/Toolbar.tsx +++ b/src/webview/targetMemory/components/Toolbar.tsx @@ -1,7 +1,7 @@ import * as React from "react"; -import type { BytesPerRow, Endianness, GroupSize } from "../../../shared/targetMemory/format"; -import { BYTES_PER_ROW_OPTIONS, GROUP_SIZES } from "../../../shared/targetMemory/format"; -import type { MemoryTarget, PanelSettings, TargetState } from "../../../shared/targetMemory/protocol"; +import type { BytesPerRow, Endianness, GroupSize } from "@/shared/targetMemory/format"; +import { BYTES_PER_ROW_OPTIONS, GROUP_SIZES } from "@/shared/targetMemory/format"; +import type { MemoryTarget, PanelSettings, TargetState } from "@/shared/targetMemory/protocol"; import { IconButton, Segmented } from "./controls"; interface ToolbarProps { diff --git a/src/webview/targetMemory/components/controls.tsx b/src/webview/targetMemory/components/controls.tsx index ae40045..77af16e 100644 --- a/src/webview/targetMemory/components/controls.tsx +++ b/src/webview/targetMemory/components/controls.tsx @@ -1,4 +1,4 @@ -import { formatAddress, inspectBytes, type Endianness } from "../../../shared/targetMemory/format"; +import { formatAddress, inspectBytes, type Endianness } from "@/shared/targetMemory/format"; export function Segmented(props: { value: T; diff --git a/src/webview/targetMemory/memoryCache.ts b/src/webview/targetMemory/memoryCache.ts index be17234..ea6366e 100644 --- a/src/webview/targetMemory/memoryCache.ts +++ b/src/webview/targetMemory/memoryCache.ts @@ -1,5 +1,5 @@ -import { alignDown, hexString as hex } from "../../shared/targetMemory/format"; -import type { FromWebview, ToWebview } from "../../shared/targetMemory/protocol"; +import { alignDown, hexString as hex } from "@/shared/targetMemory/format"; +import type { FromWebview, ToWebview } from "@/shared/targetMemory/protocol"; export const BLOCK_SIZE = 1024; const BLOCK = BigInt(BLOCK_SIZE); diff --git a/src/webview/targetMemory/vscode.ts b/src/webview/targetMemory/vscode.ts index 856ac18..403b38d 100644 --- a/src/webview/targetMemory/vscode.ts +++ b/src/webview/targetMemory/vscode.ts @@ -1,4 +1,4 @@ -import type { FromWebview, ToWebview } from "../../shared/targetMemory/protocol"; +import type { FromWebview, ToWebview } from "@/shared/targetMemory/protocol"; interface VsCodeApi { postMessage(message: unknown): void; diff --git a/test/disassembly.test.ts b/test/disassembly.test.ts index 9007fee..915f8da 100644 --- a/test/disassembly.test.ts +++ b/test/disassembly.test.ts @@ -1,9 +1,9 @@ import assert from "node:assert/strict"; import { test } from "node:test"; -import { disassembleInstructions, instructionReference, parseInstructionReference } from "../src/disassembly"; -import { TcfChannel, TcfError } from "../src/tcf/channel"; -import { DisassemblyService } from "../src/tcf/services/disassembly"; -import { DisassemblyLine } from "../src/tcf/services/disassembly"; +import { disassembleInstructions, instructionReference, parseInstructionReference } from "@/disassembly"; +import { TcfChannel, TcfError } from "@/tcf/channel"; +import { DisassemblyService } from "@/tcf/services/disassembly"; +import { DisassemblyLine } from "@/tcf/services/disassembly"; test("TCF disassembly requests opcode bytes in the requested context", async () => { const lines: DisassemblyLine[] = [{ Address: 0x123456789abcdef0n, Size: 1, Instruction: [{ Text: "ret" }] }]; diff --git a/test/symbolContexts.test.ts b/test/symbolContexts.test.ts index 4fe5115..df2e2ab 100644 --- a/test/symbolContexts.test.ts +++ b/test/symbolContexts.test.ts @@ -1,10 +1,10 @@ import assert from "node:assert/strict"; import { test } from "node:test"; import { DebugProtocol } from "@vscode/debugprotocol"; -import { TcfChannel } from "../src/tcf/channel"; -import { RunControlContext } from "../src/tcf/services/runControl"; -import { TcfDebugSession } from "../src/tcfDebugSession"; -import { symbolFileBreakpointContext } from "../src/symbolFiles"; +import { TcfChannel } from "@/tcf/channel"; +import { RunControlContext } from "@/tcf/services/runControl"; +import { TcfDebugSession } from "@/tcfDebugSession"; +import { symbolFileBreakpointContext } from "@/symbolFiles"; test("symbol file breakpoints resolve their own context, not the selected thread", () => { const contexts = [ diff --git a/test/symbolFiles.test.ts b/test/symbolFiles.test.ts index b1f296e..cc5f938 100644 --- a/test/symbolFiles.test.ts +++ b/test/symbolFiles.test.ts @@ -4,10 +4,10 @@ import * as fs from "node:fs/promises"; import * as os from "node:os"; import * as path from "node:path"; import { test } from "node:test"; -import { SymbolFile, applySymbolFiles } from "../src/symbolFiles"; -import { TcfChannel } from "../src/tcf/channel"; -import { MemoryMapService, MemoryRegionProperties } from "../src/tcf/services/memoryMap"; -import { TcfDebugSession } from "../src/tcfDebugSession"; +import { SymbolFile, applySymbolFiles } from "@/symbolFiles"; +import { TcfChannel } from "@/tcf/channel"; +import { MemoryMapService, MemoryRegionProperties } from "@/tcf/services/memoryMap"; +import { TcfDebugSession } from "@/tcfDebugSession"; test("removing the last symbol file clears its context map", async () => { const calls: { context: string; regions: MemoryRegionProperties[] }[] = []; diff --git a/test/symbolPath.test.ts b/test/symbolPath.test.ts index 33e03fb..dd9b18b 100644 --- a/test/symbolPath.test.ts +++ b/test/symbolPath.test.ts @@ -3,7 +3,7 @@ import * as fs from "node:fs/promises"; import * as os from "node:os"; import * as path from "node:path"; import { test } from "node:test"; -import { suggestSymbolPaths } from "../src/symbolPath"; +import { suggestSymbolPaths } from "@/symbolPath"; test("suggests workspace-relative and absolute symbol paths", async () => { const workspace = await fs.mkdtemp(path.join(os.tmpdir(), "tcf-symbol-path-")); diff --git a/tsconfig.json b/tsconfig.json index 6d59dba..03691ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,9 @@ "lib": ["ES2022"], "outDir": "out", "rootDir": "src", + "paths": { + "@/*": ["./src/*"] + }, "strict": true, "noImplicitOverride": true, "noUnusedLocals": true,