Hi Scarlett,
First, which syntax language are you using here? If it's one of our premium add-ons, we do have syntax error reporting but we don't do any sort of compilation that would discover undefined functions.
That being said, one way you could achieve such a feature is to:
- Alter your IParser language service to call its normal parsing code first that generates parse data with an AST and syntax errors list.
- Recursively examine the AST and find the various function declarations in it, building a list of their names as you go.
- You could also build up a list of InvocationExpressions that were located as you examine the AST.
- After you've gone through the entire AST, enumerate the list of InvocationExpressions and see if any make calls to identifiers that aren't declared function names.
- When this situation occurs, add a new parse error to the parse data's list of syntax errors.
- Note that you may need to make a new parse data object that returns the AST, snapshot used, and combined syntax/parse errors list. Use the same parse data object Type that the original parser used.
At that point, SyntaxEditor should now have parse errors for unclared functions and will show the squiggle lines by them, and support quick info tips when hovering over the parse errors.
I hope that helps!