Skip to content

Commit 604eb62

Browse files
authored
fix: don't use global variable (#424)
rg -n '^function\s+[A-Za-z_]\w*\('
1 parent 0707f40 commit 604eb62

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

.emmyrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"runtime": {
44
"version": "LuaJIT"
55
},
6+
"diagnostics": {
7+
"enables": [
8+
"missing-global-doc"
9+
]
10+
},
611
"workspace": {
712
"library": [
813
"$VIMRUNTIME",

lua/opencode/ui/session_picker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ end
3131
---@param session Session|GlobalSession object
3232
---@param width? integer
3333
---@return PickerItem
34-
function format_session_item(session, width)
34+
local function format_session_item(session, width)
3535
local project = (session --[[@as GlobalSession]]).project
3636
local title = session.title or 'N/A'
3737
if project then

lua/opencode/ui/timeline_picker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local base_picker = require('opencode.ui.base_picker')
66
---Format message parts for timeline picker
77
---@param msg OpencodeMessage Message object
88
---@return PickerItem
9-
function format_message_item(msg, width)
9+
local function format_message_item(msg, width)
1010
local preview = msg.parts and msg.parts[1] and msg.parts[1].text or ''
1111

1212
local debug_text = 'ID: ' .. (msg.info.id or 'N/A')

0 commit comments

Comments
 (0)