Closed AnotherCodeArtist closed 1 year ago
hey @AnotherCodeArtist , sorry I hadn't noticed this issue before. My bad.
It does support generics in functions, as in:
func identity[T any](x T) T {
return x
}
%%
fmt.Println(identity("Hello"))
fmt.Println(identity(math.Pi))
Let me fix it. ETA tomorrow.
I think I found the issue and fixed it -- again apologies I missed that, now I added the case to the parsing test.
I went ahead and created a new release (v0.6.2), but pls test it out if it works for you. If not, pls let me know.
cheers
Hi Jan!
First tests show that it works like a charm! Thanx for the brilliant support.
BTW: I'm also longing for improved code completion.
Btw, the code completion improved some recently (v0.6.1), but there are case where it still doesn't work.
Would you remember specific code-completion cases that don't work for you ? I'm looking for examples of cases that need work.
Of course, we are now somehow in the wrong issue, but here's a simple case where code-completion does not work at all:
import "fmt"
type Person struct {
Firstname, Lastname string
}
%%
john := Person{"John", "Doe"}
fmt.Println(john.Fi...
When I type jo
nothing gets completed. The same with john.Fi
.
I gues none of the local variables is recognized.
Would we really cool if you could do something about it.
Thanks for the example.
Interesting this is another instance of the cell not being parseable ... notice that is you close the parenthesis the auto-complete starts working. But ideally I have to find a way to deal with this ...
Btw, if you don't mind I'll close this issue, since it's about the generics on structs. There is #22 , I'll follow up there.
cheers
Btw, I managed to figure out a relatively simple way to handle unparseable cell content. So code-completion in the example you provided now works (in the v0.6.3 release)! I think this will help in many cases. If you notice any other cases, pls let me know :)
Hi Jan!
Just came across another problem connected with generic structs. The following code ...
results in
Any workaround or quick fix available?