Skip to content

Conversation

@OpeOginni
Copy link
Contributor

@OpeOginni OpeOginni commented Dec 15, 2025

  • 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.
@rekram1-node
Copy link
Collaborator

/review

},
experimental: true,
}

Copy link
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
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
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
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
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
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 sst:dev Dec 18, 2025
2 of 3 checks passed
@OpeOginni OpeOginni deleted the feat/experimental-ty-lsp branch December 18, 2025 21:33
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