The Wayback Machine - https://web.archive.org/web/20221217212807/https://github.com/microsoft/TypeScript/issues/290
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

JSDoc support for object literal fields #290

Open
johnnyreilly opened this issue Jul 29, 2014 · 8 comments
Open

JSDoc support for object literal fields #290

johnnyreilly opened this issue Jul 29, 2014 · 8 comments
Labels
Bug A bug in TypeScript Has Repro This issue has compiler-backed repros: https://aka.ms/ts-repros Help Wanted You can do this
Milestone

Comments

@johnnyreilly
Copy link

johnnyreilly commented Jul 29, 2014

When inside a definition file (eg jquery.d.ts) and hovering over an interface member which has been JSDoc'd then intellisense is presented to the user in Visual Studio.

However, when in a different file which is making use of those definitions the same rich interface intellisense is not presented. Just the type and name - none of the JSDoc stuff flows through.

It would be good if it did.

Migrated from http://typescript.codeplex.com/workitem/2463

@jntrnr jntrnr added this to the TypeScript 2.0 milestone Jul 31, 2014
@jntrnr jntrnr assigned mhegazy and unassigned billti Jul 31, 2014
@jntrnr
Copy link
Contributor

jntrnr commented Jul 31, 2014

It seems this is related to getting JSDoc for contextually-typed object literals. This should likely work just as you'd expect.

@jntrnr jntrnr modified the milestones: TypeScript 2.0, TypeScript 1.2, Community, TypeScript 1.3 Sep 2, 2014
@jntrnr jntrnr removed the Visual Studio Integration with Visual Studio label Sep 8, 2014
@mhegazy mhegazy removed their assignment Oct 9, 2014
@mhegazy mhegazy added the Help Wanted You can do this label Feb 20, 2016
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@orta
Copy link
Contributor

orta commented Jan 4, 2021

Pretty sure that this issue is what I'm hitting with this type of code:

const someFunc = () => {
    return {
        /** This JSDoc comment doesn't leave the function */
        one: "1",
        /** Neither does this */
        two: "2"
    }
}

const a = someFunc()

a.one
// ^?

type A = ReturnType<typeof someFunc>
//   ^?

Both

Workbench Repro

@typescript-bot typescript-bot added the Has Repro This issue has compiler-backed repros: https://aka.ms/ts-repros label Jan 4, 2021
@orta
Copy link
Contributor

orta commented Jan 5, 2021

I realize now that the // ^? doesn't show JSDoc anyway, so the repro is useless 🍡

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Feb 23, 2021

@johnnyreilly do you remember what this was about? I would imagine this:

interface Foo {
    /**
     * Hallo this is JSDoc
     */
    yadda(): void
}

let x: Foo = {
    yadda() {

    }
}

which seems to be fixed.

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Feb 23, 2021

@orta if I hover on that in the playground, that seems to work.

@johnnyreilly
Copy link
Author

johnnyreilly commented Feb 23, 2021

Wow - this an old issue! I do vaguely remember raising it - but not more than that. The way intellisense is powered in Visual Studio has radically changed now I understand. I should say I haven't used VS in about four years though. Apologies

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 14, 2022

👋 Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of this repro running against the nightly TypeScript.


Comment by @orta

⚠️ Assertions:

  • (property) one: string
  • type A = { one: string; two: string; }

Historical Information
Version Reproduction Outputs
4.2.2, 4.3.2, 4.4.2, 4.5.2, 4.6.2

⚠️ Assertions:

  • (property) one: string
  • type A = { one: string; two: string; }

@Andarist
Copy link
Contributor

Andarist commented Dec 16, 2022

@DanielRosenwasser @johnnyreilly I've tried a couple of things in VS Code and all basic cases seem to work just fine nowadays. It's probably best to close this issue as it was most likely fixed along the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Has Repro This issue has compiler-backed repros: https://aka.ms/ts-repros Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

10 participants