refactor(lsp): move ty flag to runtime flags (#27610)

This commit is contained in:
Shoubhit Dash
2026-05-15 03:40:30 +05:30
committed by GitHub
parent 93b1ccc029
commit e22cfa435a
6 changed files with 87 additions and 10 deletions
+4 -3
View File
@@ -14,6 +14,7 @@ import { which } from "../util/which"
import { Module } from "@opencode-ai/core/util/module"
import { spawn } from "./launch"
import { Npm } from "@opencode-ai/core/npm"
import type { RuntimeFlags } from "@/effect/runtime-flags"
const log = Log.create({ service: "lsp.server" })
const pathExists = async (p: string) =>
@@ -60,7 +61,7 @@ export interface Info {
extensions: string[]
global?: boolean
root: RootFunction
spawn(root: string, ctx: InstanceContext): Promise<Handle | undefined>
spawn(root: string, ctx: InstanceContext, flags: RuntimeFlags.Info): Promise<Handle | undefined>
}
export const Deno: Info = {
@@ -431,8 +432,8 @@ export const Ty: Info = {
"Pipfile",
"pyrightconfig.json",
]),
async spawn(root) {
if (!Flag.OPENCODE_EXPERIMENTAL_LSP_TY) {
async spawn(root, _ctx, flags) {
if (!flags.experimentalLspTy) {
return undefined
}