@@ -5,7 +5,7 @@ import { showQuickPick } from '@zardoy/vscode-utils/build/quickPick'
55import _ from 'lodash'
66import { compact } from '@zardoy/utils'
77import { offsetPosition } from '@zardoy/vscode-utils/build/position'
8- import { RequestOptionsTypes , RequestResponseTypes } from '../typescript/src/ipcTypes'
8+ import { RequestInputTypes , RequestOutputTypes } from '../typescript/src/ipcTypes'
99import { sendCommand } from './sendCommand'
1010import { tsRangeToVscode , tsRangeToVscodeSelection } from './util'
1111import { onCompletionAcceptedOverride } from './onCompletionAccepted'
@@ -15,10 +15,7 @@ export default () => {
1515 const editor = getActiveRegularEditor ( )
1616 if ( ! editor ) return
1717 const { selection, document } = editor
18- const response = await sendCommand <
19- RequestResponseTypes [ 'removeFunctionArgumentsTypesInSelection' ] ,
20- RequestOptionsTypes [ 'removeFunctionArgumentsTypesInSelection' ]
21- > ( 'removeFunctionArgumentsTypesInSelection' , {
18+ const response = await sendCommand ( 'removeFunctionArgumentsTypesInSelection' , {
2219 document,
2320 position : selection . start ,
2421 inputOptions : {
@@ -37,7 +34,7 @@ export default () => {
3734 const getCurrentValueRange = async ( ) => {
3835 const editor = getActiveRegularEditor ( )
3936 if ( ! editor ) return
40- const result = await sendCommand < RequestResponseTypes [ 'getRangeOfSpecialValue' ] > ( 'getRangeOfSpecialValue' )
37+ const result = await sendCommand ( 'getRangeOfSpecialValue' )
4138 if ( ! result ) return
4239 const range = tsRangeToVscode ( editor . document , result . range )
4340 return range . with ( { start : range . start . translate ( 0 , / * { ? / . exec ( editor . document . lineAt ( range . start ) . text . slice ( range . start . character ) ) ! [ 0 ] ! . length ) } )
@@ -121,7 +118,7 @@ export default () => {
121118 registerExtensionCommand ( 'pickAndInsertFunctionArguments' , async ( ) => {
122119 const editor = getActiveRegularEditor ( )
123120 if ( ! editor ) return
124- const result = await sendCommand < RequestResponseTypes [ 'pickAndInsertFunctionArguments' ] > ( 'pickAndInsertFunctionArguments' )
121+ const result = await sendCommand ( 'pickAndInsertFunctionArguments' )
125122 if ( ! result ) return
126123
127124 const renderArgs = ( args : Array < [ name : string , type : string ] > ) => `${ args . map ( ( [ name , type ] ) => ( type ? `${ name } : ${ type } ` : name ) ) . join ( ', ' ) } `
@@ -165,7 +162,7 @@ export default () => {
165162 const editor = vscode . window . activeTextEditor
166163 if ( ! editor ) return
167164 const { document } = editor
168- const result = await sendCommand < RequestResponseTypes [ 'filterBySyntaxKind' ] > ( 'filterBySyntaxKind' )
165+ const result = await sendCommand ( 'filterBySyntaxKind' )
169166 if ( ! result ) return
170167 // todo optimize
171168 if ( filterWithSelection ) {
@@ -228,14 +225,14 @@ export default () => {
228225 document,
229226 selection : { active : position } ,
230227 } = editor
231- await sendCommand < RequestOptionsTypes [ 'acceptRenameWithParams' ] > ( 'acceptRenameWithParams' , {
228+ await sendCommand ( 'acceptRenameWithParams' , {
232229 document,
233230 position,
234231 inputOptions : {
235232 alias,
236233 comments,
237234 strings,
238- } satisfies RequestOptionsTypes [ 'acceptRenameWithParams' ] ,
235+ } satisfies RequestInputTypes [ 'acceptRenameWithParams' ] ,
239236 } )
240237 await vscode . commands . executeCommand ( preview ? 'acceptRenameInputWithPreview' : 'acceptRenameInput' )
241238 } )
@@ -244,7 +241,7 @@ export default () => {
244241 const editor = vscode . window . activeTextEditor
245242 if ( ! editor ) return
246243 if ( ! getExtensionSetting ( 'experiments.enableInsertNameOfSuggestionFix' ) && editor . document . languageId !== 'vue' ) {
247- const result = await sendCommand < RequestResponseTypes [ 'getLastResolvedCompletion' ] > ( 'getLastResolvedCompletion' )
244+ const result = await sendCommand ( 'getLastResolvedCompletion' )
248245 if ( ! result ) return
249246 const position = editor . selection . active
250247 const range = result . range ? tsRangeToVscode ( editor . document , result . range ) : editor . document . getWordRangeAtPosition ( position )
@@ -283,14 +280,14 @@ export default () => {
283280 } )
284281
285282 registerExtensionCommand ( 'copyFullType' , async ( ) => {
286- const response = await sendCommand < RequestResponseTypes [ 'getFullType' ] > ( 'getFullType' )
283+ const response = await sendCommand ( 'getFullType' )
287284 if ( ! response ) return
288285 const { text } = response
289286 await vscode . env . clipboard . writeText ( text )
290287 } )
291288
292289 registerExtensionCommand ( 'getArgumentReferencesFromCurrentParameter' , async ( ) => {
293- const result = await sendCommand < RequestResponseTypes [ 'getArgumentReferencesFromCurrentParameter' ] > ( 'getArgumentReferencesFromCurrentParameter' )
290+ const result = await sendCommand ( 'getArgumentReferencesFromCurrentParameter' )
294291 if ( ! result ) return
295292 const editor = vscode . window . activeTextEditor !
296293 const { uri } = editor . document
0 commit comments