GithubHelp home page GithubHelp logo

sisisin / ts-type-expand Goto Github PK

View Code? Open in Web Editor NEW

This project forked from d-kimuson/ts-type-expand

0.0 1.0 0.0 9.25 MB

vscode extension for expand type of typescript

JavaScript 3.38% TypeScript 94.94% Shell 1.68%

ts-type-expand's Introduction

ts-type-expand for VSCode

VSCode extension that allows you to expand TypeScript type definitions.

  • Displays the type information of the selected node
  • This is especially useful for hard-to-read types, such as those automatically generated from GraphQL schemas.

Installation

You can install this extension from the ts-type-expand - Visual Studio Marketplace!

There is nothing additional that needs to be installed.

If tsconfig.json is not directly under your workspace, specify the path with the ts-type-expand.tsconfigPath option. See Configure for other valid options.

Supports

Expansion

The following types can be expanded

  • Properties
  • Array (T for Array<T>)
  • Candidate types for union type
  • Arguments and return values of functions or methods

Selection

The following are the destination nodes that support type expansion. More nodes will be added in the future.

Statements Support
TypeAlias declaration
Interface declaration
Varibale declaration
Varibale statement
Class declaration
Function declaration
Function call
Function argument
Method declaration
Enum Declaration
Enum statement

Types

Types are calculated by the CompilerAPI, so all types supported by TypeScript are supported in this extension.

Others

  • Vue is not supported (not tried)
  • React also works, but there can be problems with component types

Configure

Configure ts-type-expand.* to your vscode config to customize.

key value default
tsconfigPath Path for tsconfig.json tsconfig.json
compactOptionalType display T? for type T | undefined true
compactPropertyLength Omit when the type can be expanded and the number of characters of the type is longer than this length. 10
directExpandArray Directly expand T for Array<T> true

In order for these settings to take effect, you need to run ts-type-expand.restart or reload the VSCode after making the changes.

Commands

command effect
ts-type-expand.restart Update configuration and restart extension

License

MIT

ts-type-expand's People

Contributors

d-kimuson avatar dependabot[bot] avatar github-actions[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.