@@ -23,10 +23,11 @@ export function activate(context: vscode.ExtensionContext) {
23
23
}
24
24
}
25
25
26
- vscode . window . showInformationMessage ( 'goose agent starting, this may take a minute.. ⏰' ) ;
26
+
27
27
28
28
let getTerminal = ( ) => {
29
29
if ( ! gooseTerminal || gooseTerminal . exitStatus !== undefined ) {
30
+ vscode . window . showInformationMessage ( 'goose agent starting, this may take a minute.. ⏰' ) ;
30
31
gooseTerminal = vscode . window . createTerminal ( {
31
32
name : terminalName ,
32
33
message : 'Loading Goose Session...' , // Add a message to make it clear what terminal is for
@@ -46,8 +47,8 @@ export function activate(context: vscode.ExtensionContext) {
46
47
} ) ;
47
48
context . subscriptions . push ( openTerminalDisposable ) ;
48
49
49
- // Automatically open the terminal when the extension activates
50
- vscode . commands . executeCommand ( 'extension.openGooseTerminal' ) ;
50
+ // Automatically open the terminal when the extension activates
51
+ // vscode.commands.executeCommand('extension.openGooseTerminal');
51
52
52
53
53
54
let sendToGooseDisposable = vscode . commands . registerCommand ( 'extension.sendToGoose' , async ( ) => {
@@ -101,23 +102,8 @@ export function activate(context: vscode.ExtensionContext) {
101
102
102
103
context . subscriptions . push ( sendToGooseDisposable ) ;
103
104
104
- // Completion suggestion: ask goose (general) d
105
- vscode . languages . registerCodeActionsProvider ( '*' , {
106
- provideCodeActions ( document : vscode . TextDocument , range : vscode . Range , context : vscode . CodeActionContext , token : vscode . CancellationToken ) {
107
- const codeAction = new vscode . CodeAction ( 'Ask goose to edit' , vscode . CodeActionKind . QuickFix ) ;
108
- codeAction . command = { command : 'extension.sendToGoose' , title : 'Ask goose to edit it' } ;
109
- return [ codeAction ] ;
110
- }
111
- } ) ;
112
105
113
- // Completion suggestion: ask Goose to explain it
114
- vscode . languages . registerCodeActionsProvider ( '*' , {
115
- provideCodeActions ( document : vscode . TextDocument , range : vscode . Range , context : vscode . CodeActionContext , token : vscode . CancellationToken ) {
116
- const codeAction = new vscode . CodeAction ( 'Ask goose to explain it' , vscode . CodeActionKind . QuickFix ) ;
117
- codeAction . command = { command : 'extension.askGooseToExplainIt' , title : 'Ask goose to explain it' } ;
118
- return [ codeAction ] ;
119
- }
120
- } ) ;
106
+
121
107
122
108
123
109
@@ -130,70 +116,16 @@ export function activate(context: vscode.ExtensionContext) {
130
116
}
131
117
} ) ;
132
118
133
-
134
-
135
- // Register inline completion provider
136
- vscode . languages . registerInlineCompletionItemProvider ( '*' , {
137
- provideInlineCompletionItems ( document : vscode . TextDocument , position : vscode . Position ) {
138
- const editor = vscode . window . activeTextEditor ;
139
- if ( ! editor ) {
140
- return ;
141
- }
142
-
143
- const completionItem = new vscode . InlineCompletionItem ( 'complete with goose' ) ;
144
- completionItem . insertText = '' ;
145
- completionItem . command = { command : 'extension.askGooseToFinishIt' , title : 'complete with goose' } ;
146
- return [ completionItem ] ;
147
- }
148
- } ) ;
149
-
150
- // Register content completion extension
151
- vscode . languages . registerCompletionItemProvider ( '*' , {
152
- provideCompletionItems ( document : vscode . TextDocument , position : vscode . Position ) {
153
- const completionItem = new vscode . CompletionItem ( 'Ask Goose to finish this code' , vscode . CompletionItemKind . Text ) ;
154
- completionItem . insertText = '' ;
155
- completionItem . command = { command : 'extension.askGooseToFinishIt' , title : 'Ask Goose to finish this code' } ;
156
- return [ completionItem ] ;
157
- }
158
- } , '.' ) ;
159
-
160
-
161
-
162
- const askGooseToFinishItCommand = vscode . commands . registerCommand ( 'extension.askGooseToFinishIt' , async ( ) => {
163
- const editor = vscode . window . activeTextEditor ;
164
- if ( ! editor ) {
165
- return ;
119
+ // Completion suggestion: ask goose (general)
120
+ vscode . languages . registerCodeActionsProvider ( '*' , {
121
+ provideCodeActions ( document : vscode . TextDocument , range : vscode . Range , context : vscode . CodeActionContext , token : vscode . CancellationToken ) {
122
+ const codeAction = new vscode . CodeAction ( 'Ask goose' , vscode . CodeActionKind . QuickFix ) ;
123
+ codeAction . command = { command : 'extension.sendToGoose' , title : 'Ask goose' } ;
124
+ return [ codeAction ] ;
166
125
}
167
-
168
- const document = editor . document ;
169
- const selection = editor . selection ;
170
- const filePath = document . uri . fsPath ;
171
- const startLine = selection . start . line + 1 ;
172
-
173
- document . save ( ) ;
174
-
175
- getTerminal ( ) . sendText ( `There is some unfinished code at line: ${ startLine } in file: ${ filePath } . ` +
176
- `Complete the code based on the context, from that line onwards. Do not delete content.` ) ;
177
126
} ) ;
178
- context . subscriptions . push ( askGooseToFinishItCommand ) ;
179
-
180
- const askGooseToExplainItCommand = vscode . commands . registerCommand ( 'extension.askGooseToExplainIt' , async ( ) => {
181
- const editor = vscode . window . activeTextEditor ;
182
- if ( ! editor ) {
183
- return ;
184
- }
185
-
186
- const document = editor . document ;
187
- const selection = editor . selection ;
188
- const filePath = document . uri . fsPath ;
189
- const startLine = selection . start . line + 1 ;
190
-
191
- document . save ( ) ;
127
+
192
128
193
- getTerminal ( ) . sendText ( `Explain the code on line: ${ startLine } in file: ${ filePath } . ` ) ;
194
-
195
- } ) ;
196
- context . subscriptions . push ( askGooseToExplainItCommand ) ;
197
129
198
130
const askGooseToFix = vscode . commands . registerCommand ( 'extension.askGooseToFix' , async ( ) => {
199
131
const editor = vscode . window . activeTextEditor ;
0 commit comments