fujidana / vscode-igorpro

Igor Pro extension for Visual Studio Code
MIT License
8 stars 0 forks source link
syntax-highlighting vscode-extension

Igor Pro Extension for Visual Studio Code

The extension helps you editing Igor procedure files (*.ipf).

The author of this extension is just a Igor Pro user and has no special relation with Wavemetrics, Inc., which develops Igor Pro itself. Use GitHub issues for bug reports and feature requests about this extension.

The textual contents of the IntelliSens code hints are cited from the official manual (manual revision: June 24, 2022 (9.01)) and command helps (application version: 9.01 (Build 39200)) in the in-app help browser.

Features

Currently IntelliSense features support user-defined constants, structure, macros, and functions, in addition to built-in keywords, functions and operations; it does not cover local parameters (variables, strings, wave references, etc.) inside user-defined functions.

Known Issues

Code Helps not complete

Code hinting database currently lacks descriptive messages of most symbols (See Issue #1). Contribution to the point is very welcome.

Restricted Behaviors of Indentation Adjustment

While Igor Pro procedure is case-insensitive, the indentation adjustment feature of VS Code works based on a case-insensitive pattern matching. Also, it does not work perfectly on switch and strswitch flow controls. They are due to the limitation of the indentation adjustment feature of VS Code. See Language Configuration Guide / Indentation Rules.

Limitations of Syntax Highlighting

While Igor Pro allows function declarations which span several lines, this extension can not colorize them properly, owing to the limitation of the syntax highlithing grammar of VS Code. It is recommended to declare functions in a single line.

// multi-line definition appeared in IgorMan.pdf, not colorized properly
Function Example2(
    Variable a, // The comma is optional
    [
        Variable b,
        double c
    ]
    )
    Print a,b,c
End

// single-line definition, colorized properly
Function Example2(Variable a, [Variable b, double c])
    Print a,b,c
End

Limitations of Diagnostics

The current syntax parser is far from perfect. If you find any problems, report it on GitHub issues.

In Igor Pro, several Operations such as FuncFit and MatrixOp have a special grammar that is different from the basic syntax used for arithmetic calculation, etc. To avoid lines of such an Operation being listed in "Problems" view of VS Code, currently the parser simply skips strict syntax check when the line starts with a built-in Operation name.