Skip to content

Commit f85f312

Browse files
authored
Merge pull request #210 from Opencode-DCP/feat/lsp-parameter-extraction
feat: add LSP tool parameter extraction
2 parents 830338c + a25248e commit f85f312

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

lib/messages/utils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ export const extractParameterKey = (tool: string, parameters: any): string => {
110110
return parameters.name
111111
}
112112

113+
if (tool === "lsp") {
114+
const op = parameters.operation || "lsp"
115+
const path = parameters.filePath || ""
116+
const line = parameters.line
117+
const char = parameters.character
118+
if (path && line !== undefined && char !== undefined) {
119+
return `${op} ${path}:${line}:${char}`
120+
}
121+
if (path) {
122+
return `${op} ${path}`
123+
}
124+
return op
125+
}
126+
113127
const paramStr = JSON.stringify(parameters)
114128
if (paramStr === "{}" || paramStr === "[]" || paramStr === "null") {
115129
return ""

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@tarquinen/opencode-dcp",
4-
"version": "1.1.2",
4+
"version": "1.1.3",
55
"type": "module",
66
"description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context",
77
"main": "./dist/index.js",

0 commit comments

Comments
 (0)