MCPcopy Index your code
hub / github.com/anomalyco/opencode / permLsp

Function permLsp

packages/opencode/src/cli/cmd/run/tool.ts:1006–1020  ·  view source on GitHub ↗
(p: ToolPermissionProps<typeof LspTool>)

Source from the content-addressed store, hash-verified

1004}
1005
1006function permLsp(p: ToolPermissionProps<typeof LspTool>): ToolPermissionInfo {
1007 const file = p.input.filePath || ""
1008 const line = typeof p.input.line === "number" ? p.input.line : undefined
1009 const char = typeof p.input.character === "number" ? p.input.character : undefined
1010 const pos = line !== undefined && char !== undefined ? `${line}:${char}` : undefined
1011 return {
1012 icon: "→",
1013 title: lspTitle(p.input, { home: true }),
1014 lines: [
1015 ...(p.input.operation ? [`Operation: ${p.input.operation}`] : []),
1016 ...(file ? [`Path: ${toolPath(file, { home: true })}`] : []),
1017 ...(pos ? [`Position: ${pos}`] : []),
1018 ],
1019 }
1020}
1021
1022const TOOL_RULES = {
1023 invalid: {

Callers

nothing calls this directly

Calls 2

lspTitleFunction · 0.85
toolPathFunction · 0.85

Tested by

no test coverage detected