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

Function lspTitle

packages/opencode/src/cli/cmd/run/tool.ts:445–464  ·  view source on GitHub ↗
(
  input: {
    operation?: string
    filePath?: string
    line?: number
    character?: number
  },
  opts: { home?: boolean } = {},
)

Source from the content-addressed store, hash-verified

443}
444
445function lspTitle(
446 input: {
447 operation?: string
448 filePath?: string
449 line?: number
450 character?: number
451 },
452 opts: { home?: boolean } = {},
453): string {
454 const op = input.operation || "request"
455 const file = input.filePath ? toolPath(input.filePath, opts) : ""
456 const line = typeof input.line === "number" ? input.line : undefined
457 const char = typeof input.character === "number" ? input.character : undefined
458 const pos = line !== undefined && char !== undefined ? `:${line}:${char}` : ""
459 if (!file) {
460 return `LSP ${op}`
461 }
462
463 return `LSP ${op} ${file}${pos}`
464}
465
466function runLsp(p: ToolProps<typeof LspTool>): ToolInline {
467 return {

Callers 3

runLspFunction · 0.85
scrollLspStartFunction · 0.85
permLspFunction · 0.85

Calls 1

toolPathFunction · 0.85

Tested by

no test coverage detected