added LSP configuration to opencode
All checks were successful
CI / Build opencode docker images (push) Successful in 25s

This commit is contained in:
2026-03-05 21:54:01 +08:00
parent 76b71e2931
commit c585db1ef3
2 changed files with 31 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ ADD https://github.com/anomalyco/opencode/releases/download/v${OPENCODE_VERSION}
FROM builder-${TARGETPLATFORM//\//_} AS release
RUN tar -xvf ./opencode.tgz -C /usr/bin
RUN rm opencode.tgz
ADD --chown=opencode:opencode ./opencode.json /var/lib/opencode/.config/opencode/opencode.json
USER opencode
WORKDIR /workspace
ENTRYPOINT ["opencode"]

30
opencode/opencode.json Normal file
View File

@@ -0,0 +1,30 @@
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"java": {
"command": [
"jdtls"
],
"extensions": [
".java"
]
},
"python": {
"command": [
"pyright"
],
"extensions": [
".py",
"pyi"
]
},
"rust": {
"command": [
"rust-analyzer"
],
"extensions": [
".rs"
]
}
}
}