I don't have a documentation for this entire thing, so I need to ask a question about this #1088
karl-police
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't have a lot of C++ yet, though there's the debugger. And probably even with C++ knowledge, I'd still be in the same "debug to figure out what is going on" situation anyways.
I was like, testing with this at
Autocomplete.test.cpp
:I was trying to modify something, so that
self
which apparently in this case is a "generic self" I guess. Basically turningself
intothis
.so
self
should point towards "AmongUs", but not necessarily. Because if we'd haveself:
instead ofAmongUs:
the otherself
should inherit fromself
... and yeah, though that would be a limit, because if Autocomplete doesn't Parse as much as the Compiler would, then it can't even know what the members of a constructed class are.But I think here it can at least. I don't really know what
check()
goes exactly through. If it's the same as the Parser or not. But if it would be, then I do not know why it doesn't haveself
.My issue is, I can't find the appropriate place to add a modification. I don't entirely understand what is going on.
luau/Ast/src/Parser.cpp
Lines 1043 to 1044 in 1a9159d
I tried by commenting this out. Which successfully broke
self
for the Compiler.Apparently, the
check()
function goes through this part as well, but it's not working.This entire AST (abstract syntax tree) stuff gets a bit complex.
I figured out that this part:
luau/Analysis/src/Autocomplete.cpp
Lines 1595 to 1599 in 1a9159d
That
*it
pointer thing. Would have the properties of that type that it's trying to autocomplete of. But I don't really know "how" or from where it picks that from.I know that there's this line
luau/Analysis/src/Autocomplete.cpp
Line 1577 in 1a9159d
Which gets all the ancestors until it reaches the part at where it has to autocomplete.
I yet do not know, where I can input something like
self
so that the autocomplete knows about it.This is why I created this
a123: typeof({a ="value"}
. So that I could figure out where thisa123
is being stored at. But I didn't figure really out where it gets stored at. I only know thata123
breaks if I comment out this line:luau/Ast/src/Parser.cpp
Line 1630 in 1a9159d
Problem is that this type parser, is something that works with something that "is on-going when parsing"_. It has this
lexer()
thing. So, I didn't figure out a way to somehow add something without writing it in the Lua script.Thing is, I didn't figure out where the types at the end get stored at. Because at the location on where they get stored at, I can add in
self
. At least I believe so.But I don't know where.
I only have seen
allocator.alloc
, but I am not sure if that is the responsible thing so thata123
even gets autocompleted.Beta Was this translation helpful? Give feedback.
All reactions