perl-language-server icon indicating copy to clipboard operation
perl-language-server copied to clipboard

Support completion for keys of a hash table

Open gzqx opened this issue 11 months ago • 1 comments

Thank you for this wonderful project. I enjoy using it for quite some time.

However, I noticed that it seems to lack the ability to do semantic completion for:

If I have a hash table

%b={
	"apple"=>"good",
	"orange"=> "bad",
}
$a=\%b

It seems that it cannot auto-complete for neither $a->{ nor %b{, which IMHO is possible and would be really helpful.

I have not fully checked the document and code, so if the feature is already included I sincerely apologize in advance.

gzqx avatar Mar 17 '24 08:03 gzqx

This is difficult to do for the same reason it's difficult to know what methods are available on a variable.

We could collect all hash keys found in the document and offer those for auto complete but it's impossible to know what the keys are across files.

FractalBoy avatar Mar 17 '24 15:03 FractalBoy