mirror of
https://github.com/cline/cline.git
synced 2026-09-11 16:42:40 +08:00
Stopping the auto removal of unused imports
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user