Expronicon.jl icon indicating copy to clipboard operation
Expronicon.jl copied to clipboard

ADT cannot be navigated in VS Code

Open nandoconde opened this issue 1 year ago • 2 comments

I actually cannot think why this happens.

If I define a @config (from Configurations.jl) in a file, I can include the file and navigate to the definition from anywhere. However, this does not happen with ADTs generated with Expronicon.ADT. Any idea why?

@Roger-luo

nandoconde avatar Jul 18 '23 10:07 nandoconde

I guess this is because we are mangling things by overloading getproperty so the instance of ADT does not directly points to the type, which is why it confuses the IDE. I don't think there will be a good solution to this until we have native ADT support in the language.

I might change the ADT implementation to a module based implementation with more explicit generated type in the future due to some issues caused by 1.9 and 1.10 changes tho, which might make vscode happier

Roger-luo avatar Jul 18 '23 23:07 Roger-luo

Glad to hear about it! I figured it had to do with something like propertynames, yeah. A pity not to have it for now, but well, it works like a charm for now.

What are the 1.9/1.10 changes I have to look out for? Performance drops?

nandoconde avatar Jul 19 '23 06:07 nandoconde

I think https://github.com/Roger-luo/Moshi.jl/ should fix this problem but please feel free to open a new issue under Moshi if it happens.

Roger-luo avatar Aug 12 '24 22:08 Roger-luo