Stopping the auto removal of unused imports

This commit is contained in:
Arafatkatze
2025-09-16 10:13:00 -07:00
parent eabdb4758c
commit e8e516bb52
3 changed files with 5 additions and 11 deletions
@@ -1,5 +1,6 @@
import type { ToolUse } from "@core/assistant-message"
import { formatResponse } from "@core/prompts/responses"
import { WorkspacePathAdapter } from "@core/workspace/WorkspacePathAdapter"
import { showSystemNotification } from "@integrations/notifications"
import { COMMAND_REQ_APP_STRING } from "@shared/combineCommandSequences"
import { ClineAsk } from "@shared/ExtensionMessage"
@@ -89,9 +90,6 @@ export class ExecuteCommandToolHandler implements IFullyManagedTool {
const workspaceHint = commandMatch[1]
actualCommand = commandMatch[2].trim()
// Import inline to avoid auto-formatter issues
const { WorkspacePathAdapter } = await import("@core/workspace/WorkspacePathAdapter")
// Find the workspace root for this hint
const adapter = new WorkspacePathAdapter({
cwd: config.cwd,
@@ -1,5 +1,7 @@
import type { ToolUse } from "@core/assistant-message"
import { getWorkspaceBasename, resolveWorkspacePath } from "@core/workspace"
import { parseWorkspaceInlinePath } from "@core/workspace/utils/parseWorkspaceInlinePath"
import { WorkspacePathAdapter } from "@core/workspace/WorkspacePathAdapter"
import { parseSourceCodeForDefinitionsTopLevel } from "@services/tree-sitter"
import { getReadablePath, isLocatedInWorkspace } from "@utils/path"
import { formatResponse } from "@/core/prompts/responses"
@@ -64,10 +66,6 @@ export class ListCodeDefinitionNamesToolHandler implements IFullyManagedTool {
let displayPath: string = relDirPath!
if (config.isMultiRootEnabled && config.workspaceManager) {
// Import inline to avoid auto-formatter issues
const { parseWorkspaceInlinePath } = await import("@core/workspace/utils/parseWorkspaceInlinePath")
const { WorkspacePathAdapter } = await import("@core/workspace/WorkspacePathAdapter")
// Parse workspace hint from the path (e.g., @frontend:src/)
const { workspaceHint, relPath: parsedPath } = parseWorkspaceInlinePath(relDirPath!)
@@ -3,6 +3,8 @@ import type { ToolUse } from "@core/assistant-message"
import { constructNewFileContent } from "@core/assistant-message/diff"
import { formatResponse } from "@core/prompts/responses"
import { getWorkspaceBasename, resolveWorkspacePath } from "@core/workspace"
import { parseWorkspaceInlinePath } from "@core/workspace/utils/parseWorkspaceInlinePath"
import { WorkspacePathAdapter } from "@core/workspace/WorkspacePathAdapter"
import { processFilesIntoText } from "@integrations/misc/extract-text"
import { ClineSayTool } from "@shared/ExtensionMessage"
import { fileExistsAtPath } from "@utils/fs"
@@ -302,10 +304,6 @@ export class WriteToFileToolHandler implements IFullyManagedTool {
let absolutePath: string
if (config.isMultiRootEnabled && config.workspaceManager) {
// Import inline to avoid auto-formatter issues
const { parseWorkspaceInlinePath } = await import("@core/workspace/utils/parseWorkspaceInlinePath")
const { WorkspacePathAdapter } = await import("@core/workspace/WorkspacePathAdapter")
// Parse workspace hint from the path (e.g., @frontend:src/index.ts)
const { workspaceHint, relPath: parsedPath } = parseWorkspaceInlinePath(relPath)