Skip to content

Commit ec18917

Browse files
committed
chore(api): cleaning up diagnostics
1 parent c5f6c26 commit ec18917

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lua/opencode/api.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ end
4242

4343
function M.toggle(new_session)
4444
if state.windows == nil then
45-
local focus = state.last_focused_opencode_window or 'input'
46-
45+
local focus = state.last_focused_opencode_window or 'input' ---@cast focus 'input' | 'output'
4746
core.open({ new_session = new_session == true, focus = focus, start_insert = false })
4847
else
4948
M.close()
@@ -52,7 +51,7 @@ end
5251

5352
function M.toggle_focus(new_session)
5453
if not ui.is_opencode_focused() then
55-
local focus = state.last_focused_opencode_window or 'input'
54+
local focus = state.last_focused_opencode_window or 'input' ---@cast focus 'input' | 'output'
5655
core.open({ new_session = new_session == true, focus = focus })
5756
else
5857
ui.return_to_last_code_win()
@@ -1146,8 +1145,8 @@ M.commands = {
11461145
---@return OpencodeSlashCommand[]
11471146
function M.get_slash_commands()
11481147
local commands = vim.tbl_filter(function(cmd)
1149-
return cmd.slash_cmd and cmd.slash_cmd ~= ''
1150-
end, M.commands)
1148+
return cmd.slash_cmd and cmd.slash_cmd ~= '' or false
1149+
end, M.commands) --[[@as OpencodeSlashCommand[] ]]
11511150

11521151
local user_commands = require('opencode.config_file').get_user_commands()
11531152
if user_commands then

lua/opencode/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
---@class OpencodeCompletionFileSourcesConfig
7777
---@field enabled boolean
78-
---@field preferred_cli_tool 'fd'|'fdfind'|'rg'|'git'
78+
---@field preferred_cli_tool 'server'|'fd'|'fdfind'|'rg'|'git'
7979
---@field ignore_patterns string[]
8080
---@field max_files number
8181
---@field max_display_length number

0 commit comments

Comments
 (0)