You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a big epic as it will require a lot of work on top of the AST to perform type resolutions. From a very high level point of view, this will require:
Allow to find the declaration node of a local variable/constant: It will require to traverse the local AST and all parent siblings until it finds the declaration variable/constant node.
Allow to extract the type from a declaration node: If type is explicit, we can use it as resolved type. If not, then we should look me able to look at the called function/property/expression and restart the type resolution from there
Index all code files from a project: When the expression/function/property found in 2 is from an outer file, we should be able to find it in a previously indexed list of project files and ASTs.
Include code from Foundation and other popular Swift modules to the type resolution index.
Number 1 and 2 are to some extent workable (although big work), but right now all others will require huge amounts of effort and big changes in the way the tool and the AST works. Nevertheless, if ever achieved, it could help to:
Add override keywords when implementing protocol methods (required in Kotlin)
Make proper translations of common foundation methods like count, first, etc over arrays, dictionaries,...
Prefix enum names to the enum case and match casing (ex: replace .present by Animation.PRESENT)
Fix primary constructors (Kotlin requires () pattern in the main constructor when using inheritance but only on those that are classes and not protocols, but currently the AST does not know if it is one or the other)
.... many other subtle improvements....
The text was updated successfully, but these errors were encountered:
Interesting @namanhams ! I have abandoned a little the project in last months (but not discontinued, I have plans to continue improving it), and I have not even started with this. Can you post your findings when your are done? Or even better if you also point me to your implementation! 👏
This is a big epic as it will require a lot of work on top of the AST to perform type resolutions. From a very high level point of view, this will require:
Number 1 and 2 are to some extent workable (although big work), but right now all others will require huge amounts of effort and big changes in the way the tool and the AST works. Nevertheless, if ever achieved, it could help to:
override
keywords when implementing protocol methods (required in Kotlin)count
,first
, etc over arrays, dictionaries,....present
byAnimation.PRESENT
)()
pattern in the main constructor when using inheritance but only on those that are classes and not protocols, but currently the AST does not know if it is one or the other)The text was updated successfully, but these errors were encountered: