refactor(flags): migrate lsp download flag (#27699)

This commit is contained in:
Shoubhit Dash 2026-05-15 14:35:31 +05:30 committed by GitHub
commit 7b370406a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 102 additions and 52 deletions

View file

@ -28,6 +28,7 @@ describe("RuntimeFlags", () => {
OPENCODE_AUTO_SHARE: "true",
OPENCODE_DISABLE_EMBEDDED_WEB_UI: "true",
OPENCODE_DISABLE_EXTERNAL_SKILLS: "true",
OPENCODE_DISABLE_LSP_DOWNLOAD: "true",
OPENCODE_EXPERIMENTAL: "true",
OPENCODE_ENABLE_EXA: "true",
OPENCODE_ENABLE_PARALLEL: "true",
@ -44,6 +45,7 @@ describe("RuntimeFlags", () => {
expect(flags.disableChannelDb).toBe(true)
expect(flags.disableEmbeddedWebUi).toBe(true)
expect(flags.disableExternalSkills).toBe(true)
expect(flags.disableLspDownload).toBe(true)
expect(flags.disableClaudeCodePrompt).toBe(false)
expect(flags.enableExa).toBe(true)
expect(flags.enableParallel).toBe(true)
@ -88,6 +90,7 @@ describe("RuntimeFlags", () => {
expect(flags.disableChannelDb).toBe(false)
expect(flags.disableEmbeddedWebUi).toBe(false)
expect(flags.disableExternalSkills).toBe(false)
expect(flags.disableLspDownload).toBe(false)
expect(flags.disableClaudeCodePrompt).toBe(false)
expect(flags.disableClaudeCodeSkills).toBe(false)
expect(flags.enableExa).toBe(false)
@ -124,6 +127,22 @@ describe("RuntimeFlags", () => {
}),
)
it.effect("disableLspDownload defaults to false", () =>
Effect.gen(function* () {
const flags = yield* readFlags.pipe(Effect.provide(fromConfig({})))
expect(flags.disableLspDownload).toBe(false)
}),
)
it.effect("disableLspDownload reads OPENCODE_DISABLE_LSP_DOWNLOAD", () =>
Effect.gen(function* () {
const flags = yield* readFlags.pipe(Effect.provide(fromConfig({ OPENCODE_DISABLE_LSP_DOWNLOAD: "true" })))
expect(flags.disableLspDownload).toBe(true)
}),
)
it.effect("disableClaudeCodePrompt defaults to false", () =>
Effect.gen(function* () {
const flags = yield* readFlags.pipe(Effect.provide(fromConfig({})))
@ -268,6 +287,7 @@ describe("RuntimeFlags", () => {
OPENCODE_PURE: "true",
OPENCODE_DISABLE_DEFAULT_PLUGINS: "true",
OPENCODE_DISABLE_EXTERNAL_SKILLS: "true",
OPENCODE_DISABLE_LSP_DOWNLOAD: "true",
OPENCODE_EXPERIMENTAL: "true",
OPENCODE_ENABLE_EXA: "true",
OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: "1234",
@ -282,6 +302,7 @@ describe("RuntimeFlags", () => {
expect(flags.disableChannelDb).toBe(false)
expect(flags.disableEmbeddedWebUi).toBe(false)
expect(flags.disableExternalSkills).toBe(false)
expect(flags.disableLspDownload).toBe(false)
expect(flags.disableClaudeCodePrompt).toBe(false)
expect(flags.disableClaudeCodeSkills).toBe(false)
expect(flags.enableExa).toBe(false)