Skip to content

#23861 — "command" is required for lsp overrides while docs suggest it is not #564

Description

@ElioNeto

Description

In the documentation, an example for environment variables includes a config that only overrides the env property for a rust language server but accoding to both the schema and the error message of opencode that refuses to launch with this config, the command field is also required. Unfortunately, overriding the command property is not what I have in mind because I only need opencode to use the correct JDK (since JDTLS requires 21 but the project I am running it for requires 11) and the default JDTLS command is pretty long.

The following configuration does not work:

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "jdtls": {
      "env": {
        "PATH": "/usr/bin"
      }
    }
  }
}
$ opencode
Configuration is invalid at …/opencode.jsonc
↳ Invalid input lsp

My preferred solution would be to make the command property optional so that only the environment variables can be overridden.

The documentation change was made in github.com/ElioNeto/teamcode/pull/11435.

Plugins

No response

OpenCode version

1.4.1

Steps to reproduce

  1. Create an opencode.jsonc as specified above.
  2. Try to launch opencode (in a Java project)

Screenshot and/or share link

No response

Operating System

Arch Linux

Terminal

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DORDefinition of Ready — issue meets readiness criteriabugSomething isn't workinghighphase:p1-highImportant improvements — next priorityscope:featuresSearch, skills, commands, workspaceupstream

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions