-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureDomain: LS: Inlay HintsSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Example ts file without inlay hints:
//No inlay hints
import { createContext, useContext } from "solid-js";
import type { Application } from "pixi.js";
export const PixiContext = createContext<Application>();
export const usePixi = () => useContext(PixiContext)!; Example ts file with all inlay hints:
//All inlay hints
import { createContext, useContext } from "solid-js";
import type { Application } from "pixi.js";
export const PixiContext /*: Context<Application<Renderer> | undefined>*/ = createContext<Application>();
export const usePixi /*: () => Application<Renderer>*/ = () /*: Application<...*/ => useContext(PixiContext)!; My suggestion is to extend the TypeScript › Inlay Hints › Variable Types: Suppress When Type Matches Name setting to also hide the inlay hint for a variable/constant when its value is an arrow function that already displays its own return type inlay hint.
Example ts file with my suggestion:
//Feature suggestion
import { createContext, useContext } from "solid-js";
import type { Application } from "pixi.js";
export const PixiContext /*: Context<Application<Renderer> | undefined>*/ = createContext<Application>();
export const usePixi = () /*: Application<Renderer>*/ => useContext(PixiContext)!; This would avoid redundant type information when the variable name and the function's return type provide sufficient context.
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureDomain: LS: Inlay HintsSuggestionAn idea for TypeScriptAn idea for TypeScript