Redefining modules in VS Code

That’s an unfortunate bug. We determine the module we’re going to evaluate the file in by looking at the (0,1) position in the text document (which is a hacky fix for other issues), so in this case

m|odule A

This obviously returns A as the containing module, instead of e.g. Main. The first time around A doesn’t exist, so we fall back to Main. The second time (and every time after that) we just replace A.A. AFAICT looking at (0,0) instead has the same issue.

A quick hack around this is to insert something before the module statement, e.g. a new line or a comment or whatever.
I’ll look into fixing that soon(-ish) though.

1 Like