Skip to content

feat: add experimental support for Ty language server#5575

Merged
rekram1-node merged 8 commits into
anomalyco:devfrom
OpeOginni:feat/experimental-ty-lsp
Dec 18, 2025
Merged

feat: add experimental support for Ty language server#5575
rekram1-node merged 8 commits into
anomalyco:devfrom
OpeOginni:feat/experimental-ty-lsp

Conversation

@OpeOginni

@OpeOginni OpeOginni commented Dec 15, 2025

Copy link
Copy Markdown
Contributor
  • Introduced OPENCODE_EXPERIMENTAL_LSP_TY flag to conditionally enable Ty language server functionality.
  • Implemented Ty language server with support for Python file extensions and virtual environment detection.

Proposed fix for #5345

- Introduced OPENCODE_EXPERIMENTAL_LSP_TY flag to conditionally enable Ty language server functionality.
- Implemented Ty language server with support for Python file extensions and virtual environment detection.
Comment thread packages/opencode/src/lsp/index.ts Outdated
@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/lsp/index.ts
Comment thread packages/opencode/src/lsp/index.ts
Comment thread packages/opencode/src/lsp/index.ts
Comment thread packages/opencode/src/lsp/server.ts
Comment thread packages/opencode/src/lsp/server.ts
},
experimental: true,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential issue: The experimental: true property is added here but it is not actually used anywhere. The filterExperimentalServers function checks for specific server IDs ("ty", "pyright") rather than using this property. This could be intentional for now, but it is worth noting that this property is currently unused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense bro-chacho

@rekram1-node

Copy link
Copy Markdown
Collaborator

the only comment left that I recommend is killing that "experimental" key, ignore all the other agent feedback

id: "ty",
extensions: [".py", ".pyi"],
root: NearestRoot(["pyproject.toml", "ty.toml", "setup.py", "setup.cfg", "requirements.txt", "Pipfile", "pyrightconfig.json"]),
async spawn(root) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this spawning even when the var isn't set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I thought the way the logic goes, the servers only get spawned at after being loaded to the Instance.state? Before then the server is removed when the var isn't set.

But then again i could just add a check there just to be 1000% guaranteed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just like how in index.ts

      if (cfg.lsp === false) {
        log.info("all LSPs are disabled")
        return {
          broken: new Set<string>(),
          servers,
          clients,
          spawning: new Map<string, Promise<LSPClient.Info | undefined>>(),
        }
      }

it can return just empty servers and spawning methods

@rekram1-node rekram1-node merged commit ab9ac7c into anomalyco:dev Dec 18, 2025
2 of 3 checks passed
@OpeOginni OpeOginni deleted the feat/experimental-ty-lsp branch December 18, 2025 21:33
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants