import * as vscode from 'vscode' ; export interface ParameterPosition { namedValue ? : string ; expression : { line : number ; character : number ; } ; key : number ; start : { line : number ; character : number ; } ; end : { line : number ; character : number ; } ; } export interface LanguageDriver { getParameterName ( editor , position , key , namedValue ? ) : any ; parse ( code ) : ParameterPosition [ ] ; } export function removeShebang ( sourceCode ) { const sourceCodeArr = sourceCode . split ( "\n" ) ; if ( sourceCodeArr [ 0 ] . substr ( 0 , 2 ) === "#!" ) { sourceCodeArr [ 0 ] = "" ; } return sourceCodeArr . join ( "\n" ) ; } export function showVariadicNumbers ( str , number ) { const showVariadicNumbers = vscode . workspace . getConfiguration ( 'inline-parameters' ) . get ( 'showVariadicNumbers' ) ; if ( showVariadicNumbers ) { return `${ str }[${ number }]` ; } return str ; }