fujidana / vscode-igorpro

Igor Pro extension for Visual Studio Code
MIT License
8 stars 0 forks source link

Upgrade code hint database #1

Open fujidana opened 1 year ago

fujidana commented 1 year ago

Code hint feature of the current extension is poor. Only constants and variables (for example, Pi, and DateTime) have descriptive message but other symbols such as functions and operations (for example, abs and ModifyGraph) do not.

The database of this code hint is in src/igorpro.apiReference.yaml. Filling descriptive messages in the file will improve user experience. Contribution to the point is very welcome.

t-b commented 1 year ago

How do you currently fill the apiReference.yaml? By hand? This does not scale and also needs revisiting on every Igor Pro update.

fujidana commented 1 year ago

Yes. I prepared the list by hand, from the PDF manual and in-app help browser contents.

The extension loads the file (after converting it to JSON) as a dictionary-like object. If WaveMetrics provided the API references in a structured text format such as JSON or XML, it would not be difficult to write a converter. Then, as you wrote, the extension could easily follow Igor Pro updates. Unfortunately, I don't know where such a file is available. The contents of the in-app command help might be found in some binary form in Igor Pro folder, but I don't know either where it is placed or how it should be parsed.

Garados007 commented 1 week ago

So far I do only know of a way to get a list of all build in functions and operations. There isn't a way to get the signature or detailed information of the required arguments, which is a bit unfortunate. At least you can use this list to check if any new functions or operations are added to Igor.

Get a list of build in functions:

print FunctionList("*", ";", "KIND:1")

Get a list of build in operations:

print OperationList("*", ";", "internal")