@@ -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
13649local function execute (input )
13750 if not commands [input .fargs [1 ]] then
0 commit comments