Closed myroslavarm closed 5 years ago
My Theory is that what is wrong is the method that we call on the AST that gives us the node at the cursor offset.
this means that maybe #bestNodeFor: in this case returns the return node and not the message node inside of the return node as it should.
What we could do is to write a test just for #bestNodeFor: to test exactly this scenario
The DNU on visitReturnNode should be fixed here : https://github.com/pharo-project/pharo/pull/4062. In the same PR we also fix a more serious problem, the actual cause of the error in the code provided above. In the case of incorrect syntax, ParseErrorNode should be the one triggered and there should be no completion. Because of the incorrect implementation of the start of the error node, it didn't discover it. We have now fixed that. TL;DR : the error in this particular case was fixed by updating the AST implementation, and then we added a fallback visitReturnNode just in case (for other situations).
Cyril got it in
trying to write self generatedTraits asSet
maybe can be fixed by creating
because i don't think returning an empty string makes sense at this point because we do want a completion