I have a long and growing list of API function declarations. Most of the functions have many parameters. I’m getting annoyed with constantly copying/pasting/editing and switching between code files whenever I use a function.
From IntelliSense or keystroke… I want the parameters to be auto-filled like so:
FUNCTION DEFINITION:
''' <summary>
''' This function simplifies arming the trigger. It supports only the LEVEL trigger types and does not allow
''' more than one channel To have a trigger applied To it. Any previous pulse width qualifier Is canceled.
''' </summary>
''' <param name="handle">the device identifier returned by ps6000aOpenUnit()</param>
''' <param name="enable">disable (0) or enable (1) the trigger.</param>
''' <param name="source">the channel on which to trigger. This can be any of the input channels listed under ps6000aSetChannelOn().</param>
''' <param name="threshold">the ADC count at which the trigger will fire.</param>
''' <param name="direction">the direction in which the signal must move to cause a trigger. The following directions are
''' supported: ABOVE, BELOW, RISING, FALLING and RISING_OR_FALLING.</param>
''' <param name="delay">the time between the trigger occurring and the first sample being taken.</param>
''' <param name="autoTriggerMicroSeconds">the number of microseconds the device will wait if no trigger occurs.</param>
''' <returns>
''' </returns>
Declare Function ps6000aSetSimpleTrigger Lib "ps6000a.dll" (ByVal handle As Int16,
ByVal enable As Int16,
ByVal source As PICO_CHANNEL,
ByVal threshold As Int16,
ByVal direction As PICO_THRESHOLD_DIRECTION,
ByVal delay As UInt64,
ByVal autoTriggerMicroSeconds As UInt32) As PICO_STATUS
CODE ENTERED:
ps6000aSetSimpleTrigger|
POST AUTOFILL PARAMS:
ps6000aSetSimpleTrigger(
handle:=handle,
enable:=enable,
source:=source,
threshold:=threshold,
direction:=direction,
delay:=delay,
autoTriggerMicroSeconds:=autoTriggerMicroSeconds)|
The above behavior would make coding x10 easier for me.
I can’t find anything with XML Comments that does this. The closest thing I found was <completionlist cref=""/>
, very little info on this though I’m still investigating (Hidden Features of VB.NET?).
I looked at Code Snippets
(Walkthrough: Create a code snippet in Visual Studio), which worked. However I realized you cannot define more than one <CodeSnippet>
per “.snippet” file… This means I would need hundreds of snippet files created, imported and maintained; This is not a doable solution.
Is there a way to define a Function’s (auto)completion that is easy, copy/paste able, and takes minutes to add?
Thanks!
0