Skip to content

Commit 5e883c4

Browse files
committed
chore(types): minor emmylua type cleanup
1 parent e5cb4a1 commit 5e883c4

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

lua/opencode/event_manager.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function EventManager:_cleanup_server_subscription()
359359
if self.server_subscription.shutdown then
360360
self.server_subscription:shutdown()
361361
elseif self.server_subscription.pid and type(self.server_subscription.pid) == 'number' then
362-
vim.fn.jobstop(self.server_subscription.pid)
362+
vim.fn.jobstop(self.server_subscription.pid --[[@as integer]])
363363
end
364364
end)
365365
self.server_subscription = nil

lua/opencode/opencode_server.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function OpencodeServer:shutdown()
5353
end
5454

5555
--- @class OpencodeServerSpawnOpts
56-
--- @field cwd string
56+
--- @field cwd? string
5757
--- @field on_ready fun(job: any, url: string)
5858
--- @field on_error fun(err: any)
5959
--- @field on_exit fun(exit_opts: vim.SystemCompleted )

lua/opencode/server_job.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ function M.ensure_server()
134134
local promise = Promise.new()
135135
state.opencode_server = opencode_server.new()
136136

137-
---@diagnostic disable-next-line: missing-fields
138137
state.opencode_server:spawn({
139138
on_ready = function(_, base_url)
140139
promise:resolve(state.opencode_server)

lua/opencode/state.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ local config = require('opencode.config')
4545
-- Internal raw state table
4646
local _state = {
4747
-- ui
48-
windows = nil, ---@type OpencodeWindowState
48+
windows = nil, ---@type OpencodeWindowState|nil
4949
input_content = {},
5050
is_opencode_focused = false,
5151
last_focused_opencode_window = nil,
@@ -123,7 +123,7 @@ local function _notify(key, new_val, old_val)
123123
for _, cb in ipairs(_listeners[key]) do
124124
local ok, err = pcall(cb, key, new_val, old_val)
125125
if not ok then
126-
vim.notify(err)
126+
vim.notify(err --[[@as string]])
127127
end
128128
end
129129
end

0 commit comments

Comments
 (0)