You need to sign in to do that
Don't have an account?
Scott Wells
Maintaining an up-to-date symbol table using the Tooling API
I'm thinking about putting together a simple plugin for IntelliJ IDEA for Force.com development that uses the Tooling API to provide Apex code completion and symbol navigation. I've explored the API a bit and understand that you can build a pretty comprehensive symbol table for the code deployed into an using a combination of completions for platform APIs and Apex class symbol tables. That symbol table represents what's been deployed into the org at that point, but of course in an IDE the user is actively creating/changing code.
Any decent modern IDE provides completion against this work-in-progress code, but I don't see how I can provide this with the Tooling API since the symbol tables are returned as part of the saved ApexClass definition. Is there a way to get the Tooling API to provide a symbol table for a transient Apex class without actually saving it? If so, does that work even if the Apex class isn't currently 100% valid?
The documentation for the Tooling API states very clearly that it should be used in place of a custom lexer/parser for Apex, but this seems to be one of a few places I've found where it doesn't seem to provide everything needed to avoid at least a simple understanding of the language locally, another being code formatting.
Any thoughts on this? I guess that minimally being able to perform completion against the known symbols as of the last successful save is more valuable than absolutely nothing, but this really seems required to provide the expected coding experience.
Any decent modern IDE provides completion against this work-in-progress code, but I don't see how I can provide this with the Tooling API since the symbol tables are returned as part of the saved ApexClass definition. Is there a way to get the Tooling API to provide a symbol table for a transient Apex class without actually saving it? If so, does that work even if the Apex class isn't currently 100% valid?
The documentation for the Tooling API states very clearly that it should be used in place of a custom lexer/parser for Apex, but this seems to be one of a few places I've found where it doesn't seem to provide everything needed to avoid at least a simple understanding of the language locally, another being code formatting.
Any thoughts on this? I guess that minimally being able to perform completion against the known symbols as of the last successful save is more valuable than absolutely nothing, but this really seems required to provide the expected coding experience.
All Answers