Skip to content
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

Typescript doc visible for aliased imports, but not for single ones. #11099

Closed
waderyan opened this issue Sep 23, 2016 · 9 comments
Closed

Typescript doc visible for aliased imports, but not for single ones. #11099

waderyan opened this issue Sep 23, 2016 · 9 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this VS Code Tracked There is a VS Code equivalent to this issue
Milestone

Comments

@waderyan
Copy link

From @Elarcis on September 21, 2016 7:35

  • VSCode Version: 1.5.2
  • OS Version: Windows 7 Service Pack 1
  • Typescript version: 2.0.2

Steps to Reproduce:

  1. have a myClass.ts file exporting a MyClass class. Write some /** */ doc for that class.
  2. In another file, try the following two ways of importing identifiers:
import { MyClass } from 'myModule';
MyClass // When hovering MyClass, the written doc is not visible.
import * as myModule from 'myModule';
myModule.MyClass // When hovering MyClass, the written doc appears.

It seems logical that the doc should appear in both cases, is this due to Typescript 2?

Copied from original issue: microsoft/vscode#12360

@waderyan waderyan self-assigned this Sep 23, 2016
@waderyan waderyan added Bug A bug in TypeScript typescript labels Sep 23, 2016
@waderyan
Copy link
Author

From @chrmarti on September 21, 2016 16:42

Can reproduce with the given example and TypeScript 1.8 in todays insider build.

@waderyan
Copy link
Author

Repro'd with latest TypeScript release bits - release-2.0.5 branch.

Here is code to copy and paste.

test.ts

import { MyClass } from './myModule';
MyClass // When hovering MyClass, the written doc is not visible.

import * as myModule from './myModule';
myModule.MyClass // When hovering MyClass, the written doc appears.

myModule.ts

/**
 * Some documentation
 */
export class MyClass {

}

sending to TypeScript language service repo.

@waderyan waderyan added VS Code Tracked There is a VS Code equivalent to this issue and removed typescript labels Sep 23, 2016
@waderyan waderyan removed their assignment Sep 23, 2016
@aluanhaddad
Copy link
Contributor

This is currently a huge painpoint. Improving this would be a very big win.

@rozzzly
Copy link

rozzzly commented Sep 25, 2016

I'd also like to point out that default imports don't get the (js)doc for that export either.

import SomeDefaultExport from './FooBar';

Hovering over SomeDefaultExport in both the import declaration as well as it's uses in code will just show "import SomeDefaultExport".

I'm not at my desktop at the moment, so I haven't tested this, but imagine the same problem would exist with imports like this:

import { Foo as Bar } from './FooBar';

I'll update this post when I'm able to test that.

My experience with this bug are in typescript, but I would imagine there would be the issue with javascript (that uses es2015 imports). I'll test that out too.

Edit

the same issues also appears with JavaScript.
In addition, this syntax also has the same problem.

import { Foo as Bar } from './FooBar';

@dasilvacontin
Copy link

I've lost quite some time thinking I was doing type exports / imports wrong due to not seeing the docs on hover. 😅

What's the status on this? Waiting for someone from the community to work on it?

@ambroselittle
Copy link

ambroselittle commented Jun 15, 2017

I'm the one who reported microsoft/vscode#28753. You can see the repro easily there.

This seems like something basic that should just work, especially considering that props work fine (and that seems like it'd be harder to support). :D But anyways, please fix/include the class/component-level docs inclusion soon!

@DanielRosenwasser
Copy link
Member

Is this a duplicate of #5515?

@DanielRosenwasser DanielRosenwasser modified the milestones: TypeScript 2.5.1, TypeScript 2.5 Aug 4, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.6, TypeScript 2.5.1 Aug 16, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.6, TypeScript 2.7 Oct 9, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.7, TypeScript 2.8 Jan 9, 2018
@mhegazy mhegazy modified the milestones: TypeScript 2.8, TypeScript 2.9, Community Mar 9, 2018
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@Andarist
Copy link
Contributor

The reported code works OK today - the documentation is displayed. cc @jakebailey

@jakebailey
Copy link
Member

Yeah, this was a dupe of #5515; fixed in #19489.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests