Skip to content

Commit 345c950

Browse files
committed
no chat
1 parent 8d7ed98 commit 345c950

3 files changed

Lines changed: 1 addition & 91 deletions

File tree

lua/fittencode/api.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ API函数列表:
99
]]
1010

1111
local Inline = require('fittencode.inline')
12-
local Chat = require('fittencode.chat')
1312

1413
---@class FittenCode.API
1514
---@field has_completions fun():boolean
@@ -38,7 +37,6 @@ end
3837
function M.get_status()
3938
return {
4039
inline = Inline:get_status(),
41-
chat = Chat:get_status()
4240
}
4341
end
4442

lua/fittencode/commands.lua

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -44,94 +44,7 @@ local INLINE = {
4444
}
4545
}
4646

47-
local CHAT = {
48-
show_chat = {
49-
execute = function()
50-
local controller = require('fittencode.chat')
51-
if controller:view_visible() then
52-
return
53-
end
54-
controller:update_view({ force = true })
55-
controller:show_view()
56-
end
57-
},
58-
hide_chat = {
59-
execute = function()
60-
local controller = require('fittencode.chat')
61-
if not controller:view_visible() then
62-
return
63-
end
64-
controller:hide_view()
65-
end
66-
},
67-
toggle_chat = {
68-
execute = function()
69-
local controller = require('fittencode.chat')
70-
if controller:view_visible() then
71-
controller:hide_view()
72-
else
73-
controller:show_view()
74-
end
75-
end
76-
},
77-
add_selection_context_to_input = {
78-
execute = function()
79-
local controller = require('fittencode.chat')
80-
controller:add_selection_context_to_input()
81-
end
82-
},
83-
document_code = {
84-
execute = function()
85-
local controller = require('fittencode.chat')
86-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
87-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.DOCUMENT_CODE)
88-
end
89-
},
90-
edit_code = {
91-
execute = function()
92-
local controller = require('fittencode.chat')
93-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
94-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.EDIT_CODE)
95-
end
96-
},
97-
explain_code = {
98-
execute = function()
99-
local controller = require('fittencode.chat')
100-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
101-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.EXPLAIN_CODE)
102-
end
103-
},
104-
find_bugs = {
105-
execute = function()
106-
local controller = require('fittencode.chat')
107-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
108-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.FIND_BUGS)
109-
end
110-
},
111-
generate_unit_test = {
112-
execute = function()
113-
local controller = require('fittencode.chat')
114-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
115-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.GENERATE_UNIT_TEST)
116-
end
117-
},
118-
optimize_code = {
119-
execute = function()
120-
local controller = require('fittencode.chat')
121-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
122-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.OPTIMIZE_CODE)
123-
end
124-
},
125-
start_chat = {
126-
execute = function()
127-
local controller = require('fittencode.chat')
128-
local TEMPLATE_CATEGORIES = require('fittencode.chat.builtin_templates').TEMPLATE_CATEGORIES
129-
controller:from_builtin_template_with_selection(TEMPLATE_CATEGORIES.CHAT)
130-
end
131-
}
132-
}
133-
134-
local commands = vim.tbl_deep_extend('error', {}, BASE, INLINE, CHAT)
47+
local commands = vim.tbl_deep_extend('error', {}, BASE, INLINE)
13548

13649
local function execute(input)
13750
if not commands[input.fargs[1]] then

lua/fittencode/init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ function M.setup(options)
1616
require('fittencode.commands')
1717

1818
local function _loading()
19-
require('fittencode.chat')
2019
require('fittencode.inline')
2120
require('fittencode.integrations')
2221
end

0 commit comments

Comments
 (0)