@hisham_hm question: given a source and position within it (e.g. row, column) can the compiler tell the type of item (e.g. variable) at the given position? I'm thinking of "code assist/completion" for Teal/Lua

@michal Yes, all AST nodes are annotated with row and column position! So a tree walk should be able to find the node at a given position

I've been thinking we could add a command which produces a full dump of the annotated tree for consumption by tools!

@michal one challenge with interactive tools is producing completions on incomplete source code (ie, when you haven't finished typing a function yet, etc -- technically the code is at a "syntax error" stage). But even if you can process the data only when the file is at a "stable" stage (e.g. at save time) it would already be very helpful!

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!