Hi, I'm writing a script interface for my game engine, and I was wondering if I could create opaque definition of the functions and classes I've defined, similar to TypeScript's declare
statements (https://www.typescriptlang.org/docs/handbook/declaration-files/by-example.html), where the interpreter effectively ignores the declaration, but it's still there for the IDE to know what types and functions have been created.
Opaque definitions of classes / functions / etc
I noticed you tagged your post with AngelCode but posted in Programming. Did you intend to post this in AngelCode and AngelScript support area?
In general, “is it possible for the IDE”, sure, if you can control your IDE you can build something that works.
It would be up to your IDE and your language, but sure, it's possible for your tools. In C and C++, “extern” works for variables and declarations work for functions to declare their existence without creating the instance. AngelScript has an external
keyword that might do what you're looking for, declaring that something exists without telling the tools to generate them, merely link the name to existing functionality.
If you're looking for something specific to an editor, there are tools that parse comments looking for special keywords, which they interpret in various ways. Some languages include statements designated for editors, like the #region / #endregion keywords in C#, and various #pragma statements in C and C++, ignored by the code but used by editors. Unreal has some macros that don't themselves expand to code, but UFUNCTION and UPROPERTY are picked up by tools and are used to generate other code and trigger tool behavior. You could similarly create comments with special meanings for your own editors.