chore: generate
This commit is contained in:
@@ -35,13 +35,14 @@ export const LspTool = Tool.defineEffect(
|
|||||||
line: z.number().int().min(1).describe("The line number (1-based, as shown in editors)"),
|
line: z.number().int().min(1).describe("The line number (1-based, as shown in editors)"),
|
||||||
character: z.number().int().min(1).describe("The character offset (1-based, as shown in editors)"),
|
character: z.number().int().min(1).describe("The character offset (1-based, as shown in editors)"),
|
||||||
}),
|
}),
|
||||||
execute: (args: { operation: (typeof operations)[number]; filePath: string; line: number; character: number }, ctx: Tool.Context) =>
|
execute: (
|
||||||
|
args: { operation: (typeof operations)[number]; filePath: string; line: number; character: number },
|
||||||
|
ctx: Tool.Context,
|
||||||
|
) =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const file = path.isAbsolute(args.filePath) ? args.filePath : path.join(Instance.directory, args.filePath)
|
const file = path.isAbsolute(args.filePath) ? args.filePath : path.join(Instance.directory, args.filePath)
|
||||||
yield* assertExternalDirectoryEffect(ctx, file)
|
yield* assertExternalDirectoryEffect(ctx, file)
|
||||||
yield* Effect.promise(() =>
|
yield* Effect.promise(() => ctx.ask({ permission: "lsp", patterns: ["*"], always: ["*"], metadata: {} }))
|
||||||
ctx.ask({ permission: "lsp", patterns: ["*"], always: ["*"], metadata: {} }),
|
|
||||||
)
|
|
||||||
|
|
||||||
const uri = pathToFileURL(file).href
|
const uri = pathToFileURL(file).href
|
||||||
const position = { file, line: args.line - 1, character: args.character - 1 }
|
const position = { file, line: args.line - 1, character: args.character - 1 }
|
||||||
|
|||||||
Reference in New Issue
Block a user