Closed mymikemiller closed 3 years ago
In general we only support go-to-definition for top-level module identifiers at this point in time. For example it should work for Option.map
from the base library, but it won't for local bindings or methods on objects. Can you come up with a minimal reproducible example, or were you talking about one of the not-yet-supported cases?
I'll close this for now. Feel free to re-open if you have more information.
Sorry, this fell off my radar. To use your example of Option.map:
import Option "mo:base/Option";
actor MyCanister {
public func myFunc() {
assert(Option.map<Nat, Nat>(?(42), func x = x+1) == ?(43));
};
}
Should I expect CMD+clicking on ".map" to take me to the code implementing the map function? It doesn't. It just behaves as though I normal-clicked on it, and I stay in the same code file.
White that would be nice, it isn't the case I'm most interested in. I use CMD+click to navigate around my own code from function call to function definition, or from variable use to variable definition. It would be nice if these cases were supported.
Other language extensions allow me to CMD+Click on a function call, for example, to jump to the definition of that function. This does not work for Motoko when using this extension. I'd expect jumping like this to work for other situations too, like jumping from a variable's usage to its declaration, or from an import to the file being imported.