epics-extensions / vscode-epics

VS Code colorization for EPICS database, templates and substitution files
MIT License
14 stars 6 forks source link

Add macro to records snippets #55

Open agaget opened 3 years ago

agaget commented 3 years ago

It can be interesting for macros standard to add standard macro: Ex: For the ao for now we have

record(ao, "record_name") {
    field(DESC, "description")
    field(PREC, "3")
    field(EGU,  "Volts")
    field(DRVL, "-10")
    field(DRVH, "+10")
    field(VAL,  "0.000")
}

we could have :

record(ao, "record_name") {
    field(DESC, "description")
    field(PREC, "$(PREC=3)")
    field(EGU,  "$(EGU=Volts)")
    field(DRVL, "$(DRVL=-10)")
    field(DRVH, "$(DRVH=+10)")
    field(VAL,  "$(VAL=0)")
}

Note that following macro could also work. The record can be used directly but less an example than the previous proposition field(DRVH, "$(DRVH=")

(can work for other records)