import { window } from 'vscode' ; import { setFontSizeStr } from '../../utils' ; import { getSettingValue } from '../getSettingValue' ; import { NUMBER_ARGUMENT , prefixFormat , stylesTransform , tempJoin } from '../index' ; export const joinStatement = data => { const { isShowSemi } = data ; return joinSemi ( isShowSemi , joinTemplateStr ( data ) ) ; } ; const joinSemi = ( isShowSemi , statement ) => { return isShowSemi ? `${ statement };` : `${ statement }` ; } ; const joinTemplateStr = ( { selectVariable , lineNumber } ) => { const numberArgument = getSettingValue ( 'Number Argument' ) ; const isShowLineCount = getSettingValue ( 'Show LineNumber' ) ; const selectFileName = getSettingValue ( 'Select FileName' ) ; const prefixLogo = getSettingValue ( 'Prefix Logo' ) ; const fontSize = getSettingValue ( 'Font Size' ) ; const fontSizeStr = setFontSizeStr ( fontSize ) ; const colorBg = getSettingValue ( 'Color Bg' ) ; const color = getSettingValue ( 'Color' ) ; const { fileName } = window . activeTextEditor . document ; const customStyles = { fontSize : fontSizeStr , colorBg , color } ; let statement = tempJoin ( '' , '' , selectVariable ) ; const temp = prefixFormat ( { isShowLineCount , selectFileName , fileName , lineNumber , selectVariable , prefixLogo , statement } ) ; if ( numberArgument === NUMBER_ARGUMENT . twoArgument ) { statement = tempJoin ( temp , '' , selectVariable ) ; } else if ( numberArgument === NUMBER_ARGUMENT . threeArgument ) { const styles = stylesTransform ( customStyles ) ; statement = tempJoin ( temp , styles , selectVariable ) ; } return statement ; } ;