opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: ty lsp rather than pyright

Open vlashada opened this issue 1 month ago • 10 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The ty lsp is starting to get a lot better and is so much faster than pyright which can allow us to run the lsp much more liberally for large code bases. It would be great if there was an option to select if we want to use pyright or ty!

vlashada avatar Dec 10 '25 22:12 vlashada

Yeah I was thinking about this.

rekram1-node avatar Dec 10 '25 22:12 rekram1-node

I haven't touched python much is ty out of beta yet? Would it be a sane default yet? The speed is something that'd be rlly good

rekram1-node avatar Dec 10 '25 22:12 rekram1-node

It is quite stable and mostly on par with pyright in terms of correctness, but it is technically still in alpha (although very close to beta). I think pyright should probably be the default for a few more weeks/months, but it would be nice to allow people to switch to ty since it is basically ready for production

vlashada avatar Dec 11 '25 02:12 vlashada

if u (or anyone else) is up to id accept a pr w an opencode experimental flag for lsp ty and then it should disable pyright, ty should only run if the flag is set

rekram1-node avatar Dec 11 '25 02:12 rekram1-node

flag.ts, lsp.ts relevant files i think its called lsp.ts or its lsp/server.ts

rekram1-node avatar Dec 11 '25 02:12 rekram1-node

it can be added as custom lsp in settings, although I can't see the the point, as ruff is the way to go for llm interaction imho

debjan avatar Dec 11 '25 11:12 debjan

@rekram1-node Taking a look at this, ways to install the lsp is either with brew, or like pip, to go with pip we have to make a venv and call the binary from there. Which of these approach you think is best?

OpeOginni avatar Dec 15 '25 18:12 OpeOginni

@OpeOginni prolly best to not auto install it, should use it if it exists instead

rekram1-node avatar Dec 15 '25 18:12 rekram1-node

@rekram1-node thanks, Let me know what you think

OpeOginni avatar Dec 15 '25 18:12 OpeOginni