Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add see tag support #39760
Add see tag support #39760
Conversation
|
Friendly ping @sandersn . I'm not sure what is the expected of |
|
Couple of quick comments -- I've only glanced at the code, haven't really read it yet.
|
|
Hoops. Seems not my fault. |
|
UP ↑ |
…' function name (#39684)
|
I'm sorry, but I don't know how to And I'm not sure what is the expected behavior in below case: function foo (a: string) {
/**
* @see {a}
*/
function bar (a: string) {
}
}When we apply goto-def at see tag, It should be linked to function |
|
The class-method question is a variant of the function-parameter question: class K {
m { }
/**
* Here's how to use C:
* First, construct it, then call m
* @see m
*/
class C {
m() { }
}
}I'm not sure what to do there either. Probably we should resolve to the outer declaration. (foo:a and K.m) I'll ask the team to see if anybody else has opinions. |
|
@sandersn Is that a valid syntax?... I'm not sure what are you expected... @typescript-bot pack this. |
|
Hey @Kingwl, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build. |
|
Based on my comment on the original bug, here are some more test cases that need to be added. They don't have to pass, but I want to make sure they don't crash:
I'm going to do a bit more looking to see how well we'll be able to resolve module references in things like lodash. I think a lot of uses just make up a name for the module they are inside, even though it's never declared inside the module itself. |
|
The only question I have left before merging this is how to resolve /** @param x @see x */
function f(x) { }Right now, But I don't actually think people write this. I'm going to figure out if that's the case. Either way, I think the best thing is to resolve starting from the parameter list of a function declaration. |
|
Maybe we could peek the parameters first if jsdoc attached on a function like declaration. |
|
If we resolveName starting from the parameter list, I think you can get it to resolve to just the parameter. So |
|
My suggestion fixes the parameter name resolution, still need a test like const x = 1
/** @see x */
function f(x) { }To make sure that |
Fixes a part of #35524