One simple and possibly nice work arround to have the support of methods discoverability in Odin. #2732
joaocarvalhoopen
started this conversation in
Proposals
Replies: 2 comments
-
As far as I know this has been talked about with the ols creator on discord and he was working on it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you very much laytan for the rapid reply, Best regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I learned about Odin, yesterday, intensively from 1 PM or 2 PM until 5 AM in the next day and I'm really liking Odin, have seen many videos including theprimogen interview to gingerBill and many others, and like the nature of Odin and the principles and decisions made on Odin. I installed Odin and the ols, in Visual Studio Code, and I'm still trying to install the Odin mode in Emacs, all this in openSuse Linux.
But there are two things that I kind of miss in Odin, to replace C more yet C++, please bare with me :-)
The first one is no support for methods, that is kind of scary to have a global name space and not a contained local space of methods for each variable that we know that has it's own type.
But I taught that at least for the method discoverability advantage, that could be enormous mitigated with a simple ideia in the tool support, I will give a simple example:
I don't know what is the convention to call a method in Odin, for example for a Hashset variable class or structure, but imagine that we would have a convention that the first argument ou parameter of a procedure of a structure, would normally be a pointer to the object type that is the same or that is a derived type from the same type that is the variable, right?
Then with a small change to the ols LSP we could simply type the starting of the variable name "my_hashset" and it would complete with the hit of a tab, and then we would press "."" or other character like the "#"" symbol and it (code completion) would should all the functions / procedures that are in scope that have the first argument with the type of the variable or pointer to the variable and it would substitute the name of the variable by the name of the procedure, example.
you type this:
and it substitute after selection on the code completion box, with context help open in a context windows, it substitute by this, the _ marks where is the cursor :
Hashset.get_all_values_in_array( my_hashset, _ )
The second case would be for the equivalent of static methods that where in the same package Hashset and that started with "Hashset." that where from the same type of the variable or from a derived type of the variable.
With those 2 small changes we could have the best of two worlds :-)
What do all of you think of this small tool support for this feature, it could give Odin although it hasn't method support, the same advantage of context ed method discoverability that methods have, ny giving them context :-)
Thank you very much,
Best regards,
João Carvalho
Beta Was this translation helpful? Give feedback.
All reactions