Skip to content

Regression from Strada: IntelliSense does not work properly inside {} following @throws #2958

@tats-u

Description

@tats-u

Steps to reproduce

Prepare:

interface ApiResponse {
  downloads: number;
  start: string;
  end: string;
  package: string;
}

/**
 * Fetch the number of downloads for a given npm package in the last month.
 * @param packageName The name of the npm package to fetch download data for.
 * @returns A promise that resolves to the number of downloads in the last month.
 * @throws {TypeError} If the fetch request fails or returns a non-OK status.
 */
export async function fetchDownloadsLastMonth(packageName: string): Promise<number> {
  const response = await fetch(`https://api.npmjs.org/downloads/point/last-month/${packageName}`);
  if (!response.ok) {
    throw new TypeError(`Failed to fetch data: ${response.status} ${response.statusText}`);
  }
  return (await response.json() as ApiResponse).downloads;
}

Almost all of the above code is generated by Copilot inline completion (slop).

  1. Remove TypeError in the brackets after @throws
  2. Type "Ty" at the same place

Behavior with typescript@6.0

"TypeError" appears in the IntelliSense and you can select it.

Image

Behavior with tsgo

"TypeError" does not appear in the IntelliSense.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions