File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 116116 "title" : " Apply Context from Clipboard" ,
117117 "category" : " Code Web Chat"
118118 },
119+ {
120+ "command" : " codeWebChat.openRepository" ,
121+ "title" : " Repository" ,
122+ "category" : " Code Web Chat" ,
123+ "icon" : " $(github-alt)"
124+ },
125+ {
126+ "command" : " codeWebChat.rate" ,
127+ "title" : " Rate" ,
128+ "category" : " Code Web Chat" ,
129+ "icon" : " $(star)"
130+ },
119131 {
120132 "command" : " codeWebChat.applyContext" ,
121133 "title" : " Apply Context" ,
328340 "command" : " codeWebChat.clearChecks" ,
329341 "when" : " false"
330342 },
343+ {
344+ "command" : " codeWebChat.rate" ,
345+ "when" : " false"
346+ },
331347 {
332348 "command" : " codeWebChat.clearChecksOpenEditors" ,
333349 "when" : " false"
480496 "group" : " navigation@1"
481497 },
482498 {
483- "command" : " codeWebChat.settings " ,
499+ "command" : " codeWebChat.rate " ,
484500 "when" : " view == codeWebChatView" ,
485501 "group" : " navigation@2"
502+ },
503+ {
504+ "command" : " codeWebChat.settings" ,
505+ "when" : " view == codeWebChatView" ,
506+ "group" : " navigation@3"
486507 }
487508 ],
488509 "view/item/context" : [
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export * from './open-file-from-workspace-command'
1414export * from './open-url-command'
1515export * from './open-settings-command'
1616export * from './reference-in-chat-command'
17+ export * from './rate-command'
1718export * from './rename-command'
1819export * from './revert-command'
1920export * from './save-all-command'
Original file line number Diff line number Diff line change 11import * as vscode from 'vscode'
22
3- export const handle_review = async ( ) : Promise < void > => {
3+ const rate = async ( ) : Promise < void > => {
44 const options = [
55 {
66 label : 'Visual Studio Marketplace' ,
@@ -24,3 +24,6 @@ export const handle_review = async (): Promise<void> => {
2424 vscode . env . openExternal ( vscode . Uri . parse ( selected_option . url ) )
2525 }
2626}
27+
28+ export const rate_command = ( ) =>
29+ vscode . commands . registerCommand ( 'codeWebChat.rate' , rate )
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import {
3535 reference_in_chat_command ,
3636 open_settings_command ,
3737 open_url_command ,
38+ rate_command ,
3839 edit_context_commands ,
3940 apply_context_from_clipboard_command
4041} from './commands'
@@ -158,6 +159,7 @@ export async function activate(context: vscode.ExtensionContext) {
158159 command : 'codeWebChat.openRepository' ,
159160 url : 'https://github.com/robertpiosik/CodeWebChat'
160161 } ) ,
162+ rate_command ( ) ,
161163 open_settings_command ( context ) ,
162164 apply_context_from_clipboard_command ( workspace_provider )
163165 )
Original file line number Diff line number Diff line change @@ -11,16 +11,15 @@ export async function at_sign_quick_pick(
1111 const items = [
1212 {
1313 label : '@Selection' ,
14- description : 'Inject text selection of the active editor'
14+ description : 'Text selection of the active editor'
1515 } ,
1616 {
1717 label : '@Changes' ,
18- description :
19- 'Inject changes between the current branch and the selected branch'
18+ description : 'Changes between the current branch and the selected branch'
2019 } ,
2120 {
2221 label : '@SavedContext' ,
23- description : 'Inject files from a saved context'
22+ description : 'Files from a saved context'
2423 }
2524 ]
2625
Original file line number Diff line number Diff line change @@ -32,4 +32,3 @@ export * from './handle-get-mode-web'
3232export * from './handle-get-mode-api'
3333export * from './handle-save-mode-web'
3434export * from './handle-save-mode-api'
35- export * from './handle-review'
Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ import {
4646 handle_get_mode_api ,
4747 handle_save_mode_api ,
4848 handle_save_home_view_type ,
49- handle_get_home_view_type ,
50- handle_review
49+ handle_get_home_view_type
5150} from './message-handlers'
5251import {
5352 config_preset_to_ui_format ,
@@ -398,8 +397,6 @@ export class ViewProvider implements vscode.WebviewViewProvider {
398397 handle_get_home_view_type ( this )
399398 } else if ( message . command == 'SHOW_AT_SIGN_QUICK_PICK' ) {
400399 await handle_at_sign_quick_pick ( this , this . context )
401- } else if ( message . command == 'REVIEW' ) {
402- await handle_review ( )
403400 }
404401 } catch ( error : any ) {
405402 console . error ( 'Error handling message:' , message , error )
Original file line number Diff line number Diff line change @@ -390,12 +390,6 @@ export const Home: React.FC<Props> = (props) => {
390390 } as WebviewMessage )
391391 }
392392
393- const handle_review_click = ( ) => {
394- props . vscode . postMessage ( {
395- command : 'REVIEW'
396- } as WebviewMessage )
397- }
398-
399393 const handle_quick_action_click = ( command : string ) => {
400394 props . vscode . postMessage ( {
401395 command : 'EXECUTE_COMMAND' ,
@@ -499,7 +493,6 @@ export const Home: React.FC<Props> = (props) => {
499493 on_code_completion_with_quick_pick_click = {
500494 handle_code_completion_with_quick_pick_click
501495 }
502- on_review_click = { handle_review_click }
503496 />
504497 )
505498}
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ type Props = {
5353 on_edit_context_with_quick_pick_click : ( ) => void
5454 on_code_completion_click : ( ) => void
5555 on_code_completion_with_quick_pick_click : ( ) => void
56- on_review_click : ( ) => void
5756}
5857
5958const web_mode_labels : Record < WebMode , string > = {
Original file line number Diff line number Diff line change @@ -193,10 +193,6 @@ export interface SaveApiModeMessage extends BaseMessage {
193193 mode : ApiMode
194194}
195195
196- export interface ReviewMessage extends BaseMessage {
197- command : 'REVIEW'
198- }
199-
200196// Messages from extension to webview:
201197export interface InstructionsMessage extends BaseMessage {
202198 command : 'INSTRUCTIONS'
@@ -375,7 +371,6 @@ export type WebviewMessage =
375371 | GetWebModeMessage
376372 | GetApiModeMessage
377373 | SaveApiModeMessage
378- | ReviewMessage
379374
380375export type ExtensionMessage =
381376 | InstructionsMessage
You can’t perform that action at this time.
0 commit comments