A Neovim plugin enabling you to solve LeetCode problems.
| 1 | ---@class lc.Sessions |
| 2 | local Sessions = {} |
| 3 | |
| 4 | Sessions.default = "anonymous" |
| 5 | Sessions.names = {} |
| 6 | Sessions.all = {} |
| 7 | |
| 8 | ---@param sessions lc.res.session[] |
| 9 | -- |
| 10 | Sessions.all = sessions |
| 11 | |
| 12 | while #Sessions.names > 0 do |
| 13 | table.remove(Sessions.names) |
| 14 | end |
| 15 | |
| 16 | for _, session in ipairs(sessions) do |
| 17 | local name = session.name == "" and Sessions.default or session.name |
| 18 | table.insert(Sessions.names, name:lower()) |
| 19 | end |
| 20 | end |
| 21 | |
| 22 | return Sessions |