-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hover information over export default
#2736
Comments
why not |
Cool. It was just a copy paste. "function" would be best ❤️ |
I began on working on this. Shouldn't it be all reserved words related to a declaration? |
@tinganho I'm not entirely sure; if we do this, then anonymous class expressions certainly should get the same behavior for |
@DanielRosenwasser with the exception of declarations lists with a length bigger than 1. /*1*/var a: string = 1, b: string; // doens't get hover info on marker 1 |
So we should clarify what we want to see; if we're just going to show the word If, however, we're going to show type information for a contextually typed function expression, that might be very useful. For instance: declare f(g: (x: number) => number);
f(/**/function (x) {
}); Quick info at that position should show something like
I'm not really big on how it looks, but it'd be worth discussing a bit. Similarly, for the |
@DanielRosenwasser just another clarification. Should the
Don't you think it should be:
because the current non-anonymous is:
|
@DanielRosenwasser I have practically finished this issue but before I send a PR. There are some weird namings currently in the language service. /// <reference path='fourslash.ts' />
//// interface IFunction{
//// (g: (a: string, b: string) => void): any;
//// }
////
//// declare var f: IFunction;
////
//// f(/*contextualType*/function(a, b) { });
////
//// /*namedFunction*/function functionName1() {}
////
//// /*exportAnonymousFunction*/export /*defaultAnonymousFunction*/default /*anonymousFunction*/function(a: string, b: string) {}
goTo.marker("contextualType");
verify.quickInfoIs("(local function) __function(a: string, b: string): void");
goTo.marker("namedFunction");
verify.quickInfoIs("function functionName1(): void");
goTo.marker("exportAnonymousFunction");
verify.quickInfoIs("function default(a: string, b: string): void");
goTo.marker("defaultAnonymousFunction");
verify.quickInfoIs("function default(a: string, b: string): void");
goTo.marker("anonymousFunction");
verify.quickInfoIs("function default(a: string, b: string): void"); |
I need someone to wear their end-user hat and help decide what is best to show in these cases (@RyanCavanaugh @danquirk). Clearly we should not be showing the symbol name for an anonymous function. I think that We keep running into situations where we resolve the symbol as |
Seeing a dunder name (i.e. Also, as an aside, i see no purpose in labeling something a |
I vote for just How about just keeping it simple?
|
👍 |
If you have a file with the following contents:
Then there is no way to see function signature through hovering. Basically, because it has no name? It would be nice to get the hover information over the
export
ordefault
keyword :-)Original request : TypeStrong/atom-typescript#251
The text was updated successfully, but these errors were encountered: