Repository: TypeScript
Issue: Intellisense documentation lost for remaining properties in expanded Omit<> mapped type
Labels: Suggestion,Experience Enhancement

# Bug Report

I'm attempting to use mapped types over an interface and I want the documentation for the properties from the original interface to be preserved when the mapped interface is implemented by a class. This normally is fine unless the mapper removes some keys from the original interface. The example below actually shows that `Omit<>` and a 1-level expansion of `Omit<>` works fine to preserve documentation over the remaining properties. However, if I expand it one more time into a raw mapped type expression, then I suddenly lose documentation.

Unfortunately I can't use either of the first two options in the code I'm trying to write because I'm doing conditional typing on the value side of the map.

Thanks folks!

### 🔎 Search Terms

omit, exclude, mapped types, documentation, tsdoc, jsdoc, properties, implements, class, hover, intellisense, vscode, quick info

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about mapped types

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.8.0-beta#code/JYOwLgpgTgZghgYwgAgLIE8CS5rycgbwChlTkB6AKkpLOUuQBEB7BAVwFsJw4xhmQyGMyjIADlGZiAjLTKVyc8ZJkAuZCE4AjaAG4lVGnXpNWnbmF79Bw0RKkAmJfUV17Yh+oDOYKKADm+nSGzgws7Fw8fAJCIspSAMyhrmTuCepazMwANhBwIPoAvkRE5IplyNLqAPIcwGDKEF7QAG5NyAAmZpGW0SAAhMgAFACiAB5IYg22yAkAdPMJyHBeyLX1yADuKyAA5A1wHR0QHcsNYAAWvOLMoGAAlKWKYOhiKBiozB3AMMAn2JBYIgINIAPrhcxRawABSgTVaJ2QAF41nUwAAeDAA3DAgA0yF2aV2AD59EQENkVqsMABhSleLxgiE9KwCWHwqBtU7ADhiXI9anoT7fX7-HBApBM7oWVkgdnNTmI4huFTSZGVXQUcjIAASzDaoi6CHUzJlfVidlVSncDnVuzgu01FT1Bs6rBN0qhMRmNqIxSeT2QnmQAGVmG72hAxmJ8t8QP5UfV+gGXm80EKvj8-h1sRKIA5wZ7ejC4QquerocAEABrTFYcV4CD48YUtjHdHViDoZgwdO5xv4wkqBIk0klClU9N0qkF01euWlhHc3n8iyC4VZsWAxuzouy+VLwjW1Xq6RO7Uu6Bu42mCJm6wW+IyY+OO0O8+6-VXo0eu-zx++v6ZSBukyAAEJsA0UYxiAcYJpWNbIAgcBsM0qxGpClj1DEYDhjoyDZMwPjJsBqbvBmIrZv2wIJIWf7FgIAAyRENCiypkAA2tCyCgMgLbZG2EAdl2PZ9g2eIEkSxIALrqFi4lIFx0lFGSE4MlO9JeLRc4MSAzE+DxK4QAK6YbqKOYKRA2l7n0+kNOxpDuGqKJnlqn6ukayB1AyATJiqr4ovajpuZehqsF5wA+fGyZAeU2oACzqAA6iI1ZwJIbCwcgWjoMgqEBMgAAGnbdr26wYsShUpq85FmVRlnxXRmH7ouiqnGxShcTxgglaJ5V1tRSCDlJsliduwJKSp46aRpVKNTpLUcuWPJ8sZa6mZm5mDRA802SWS1Ki+Minh+oXXr+zXmj6Vr+R4b7Bc6X5hTeC1XXEgFEEAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
interface MyInterface {
    /**
     * Documentation for prop1
     */
    prop1: number;
    /**
     * Documentation for prop2
     */
    prop2: string;
    /**
     * Documentation for prop3
     */
    prop3: boolean;
}

//
// 1: Omit preserves documentation! (Except for 3.3.3 as Omit wasn't added at that point)
//
type MyModifiedInterface1_DocumentationPreserved = Omit<MyInterface, 'prop3'>;

class MyClass1_DocumentationPreserved implements MyModifiedInterface1_DocumentationPreserved {
    prop1 = 1; // Hover doc: Documentation for prop1
    prop2 = 'a'; // Hover doc: Documentation for prop2
}

//
// 2: So does expanding Omit!
//
type MyModifiedInterface2_DocumentationPreserved = Pick<MyInterface, Exclude<keyof MyInterface, 'prop3'>>;

class MyClass2_DocumentationPreserved implements MyModifiedInterface2_DocumentationPreserved {
    prop1 = 1; // Hover doc: Documentation for prop1
    prop2 = 'a'; // Hover doc: Documentation for prop2
}

//
// 3: But expanding Pick causes documentaiton to be lost!
//
type MyModifiedInterface3_DocumentationLost = {
    [P in Exclude<keyof MyInterface, 'prop3'>]: MyInterface[P];
};

class MyClass3_DocumentationLost implements MyModifiedInterface3_DocumentationLost {
    prop1 = 1; // Hover doc missing!
    prop2 = 'a'; // Hover doc missing!
}
```

### 🙁 Actual behavior

In VSCode, hovering over `prop1` and `prop2` in the MyClass3_DocumentationLost class result in none of the documentation from MyInterface showing.

### 🙂 Expected behavior

In VSCode, in the MyClass3_DocumentationLost class, hovering over the following props should so the corresponding documentation from MyInterface:
- `prop1` -> "Documentation for prop1"
- `prop2` -> "Documentation for prop2"