dsc-snippets README
Simplifie le développement en DSC
Explication
Cette extension permet d'ajouter des raccourcis spécifique au language DSC.
Une fois l'extension installée, il suffit de tapper n'importe quel snippet (précédé d'un # dans la catégorie Features) dans son dsc puis d'appuyer sur entrer.
Le curseur se placera automatiquement à la place du $1. Pour passer au $2, $3... il suffit d'appuyer sur tab
Features
NEWPAGE
#np
NEWPAGE()
$1
ENDPAGE()
#npa
NEWPAGE()
ASK($1)
ENDPAGE()
```bash
#npauto
NEWPAGE('pglayout=mode5')
ASK($1,'display=autogrid')
ENDPAGE()
#npm
NEWPAGE()
MESSAGE("$1")
ENDPAGE()
#npnote
NEWPAGE('javascript=module_note.js,jscript=note(false)')
BEGINCANVAS(c,'bclass=qbody qnote')
ASK($1,'highlight=no,transpose=yes')
ENDCANVAS(c)
FOR i=0 TO 10 DO {
SETBLOCK(c:0,i,0,i,'class=case-echelle case_'+i)
}
DISPLAYCANVAS(c)
ENDPAGE()
#npnotei
NEWPAGE("javascript=module_note.js,jscript=slimgrid(768:99):note(true)")
BEGINCANVAS(c,'bclass=qbody slimgrid qnote')
ASK($1,'highlight=no')
ENDCANVAS(c)
SETBLOCK(c:0,0,0,11,'class=colheading qhidden')
FOR i=0 TO 10 DO {
SETBLOCK(c:1,i+1,$2,i+1,'class=case-echelle case_'+i)
}
DISPLAYCANVAS(c)
ENDPAGE()
BEGINCANVAS
#bc
BEGINCANVAS(c)
$1
ENDCANVAS(c)
SETBLOCK(c:$2)
DISPLAYCANVAS(c)
FOR
#for
FOR $1=$2 TO $3 DO {
$4
}
#fore, foreach
FOREACH $1 IN lst_$2 DO {
$3
}
SETBLOCK
#sb
SETBLOCK($1)
CHECK
#check
CHECK: {
IF $1 THEN WARNING($2,"$3")
}
IF/ELSE
#if
IF $1 THEN {
$2
}
#elif, elseif, else
ELSE IF $1 THEN $2
#ift
IF test==1 THEN {
NEWPAGE()
MESSAGE('TEST ONLY','class=test')
ASK($1,'disabled=yes')
ENDPAGE()
}
FUNCTION
#function
FUNCTION $1 RETURNS ${2|INTEGER,STRING|}
DIVERS
#qnotes
qnotes='yes'
#anchor
anchor='yes'
#xchoice
xchoice="$1"
#warning
WARNING($2,"$3")
#shufflechoices
shufflechoices=yes
#shuffleitems
shuffleitems=yes
LIST
#lst_note_0_10
lst_note_0_10 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
#lst_yesno
lst_yesno = { 1 "Yes", 2 "No" }
#lst_ouinon
lst_ouinon = { 1 "Oui", 2 "Non" }