Open gavr123456789 opened 4 years ago
Just curious, but could you post the source code for this example? I want to test it on our language server as well.
Thanks for the hard work @philippejer by the way!
@Prince781 oh, ofc ^^
Minimal example:
class Sequence {
int data = 0;
public Sequence add (int a){
this.data += a;
return this;
}
}
void main(){
var test = new Sequence();
test.add(5)
. //here no autocompletion
.add(2);
}
Hello!
Yes, the problem with this type of scenario is that my approach is quite basic, it assumes that the lines under the cursor are valid code (well, at least parse-able). So it does not grok this type of complex multi-line fluent style code unless you're editing the end of the expression (and then again, not always).
@Prince781 I guess this is the type of code where the modifications you have made on the parser must be useful :)
But even from inside the parser, it does not seem so easy to say "ignore everything after that point until you get back to regular programming" (or something like that).
Maybe, a pragmatic approach could be to compute a diff with the last "good" version of the current file, and in most cases it should be easy to:
@philippejer yes, FYI this issue is handled fine in VLS for the reasons you mentioned.
Nice! (I just saw your PR in Vala ;) )
It seems it does not work if there is already something after(I assume that because of an error)
1 2