Go to Definition following alias redirections.

Overview

vscode-goto-alias

Go to Definition following alias redirections.

Visual Studio Marketplace Version


Motivation

For example, in Nuxt 3 or Vitesse projects, we provide auto import for APIs and components. To provide types for these auto imports, the tools will generate a .d.ts file to declare those APIs as "global" type.

// generated.d.ts
declare global {
  const autoImported: typeof import('foobar')['autoImported'] // alias to provide type from package 'foobar'
  // ...
}

With this declaration file, we could have type safety using autoImported in our code without importing it.

// no need to import
const foo = autoImported()

The only small downside is that when you use "Go to definition" in the code, the IDE will redirect you the the definition file we generated instead of the real definition source.

So, this extension is built to solve this. With this extension installed, when the "Go to definition" command hits the definition file, it will then redirect again to the definition source.

Working with Vue Components

If you find trouble redirecting auto-registed components by Nuxt 3 or unplugin-vue-components, you might want to enable the Takeover mode of Volar.

Sponsors

License

MIT License © 2022 Anthony Fu

You might also like...

🌈 GitHub following, followers, only-following, only-follower tracker 🌈

🌈 GitHub following, followers, only-following, only-follower tracker 🌈

github-following-tracker GitHub following, followers, only-following, only-follower tracker 👀 Just enter your GitHub name and track your followings!

Jun 15, 2022

Generate HTML redirections from json file

Generate HTML redirections from json file

Jan 6, 2022

⭐️ Auto create alias map for vite config

vite-plugin-tspaths2alias This plugin is create alias map for vite config, default use project root tsconfig.json file compilerOptions.paths value Ins

Mar 26, 2022

Obsidian plugin: Implicitly add an alias matching the first heading in a document.

Alias from heading Aliases in Obsidian make it convenient to provide display names to document links. However, there are a few pain points: Aliases ar

Dec 17, 2022

The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

Ajv JSON schema validator The fastest JSON validator for Node.js and browser. Supports JSON Schema draft-06/07/2019-09/2020-12 (draft-04 is supported

Jan 4, 2023

A cli tool to generate random mock data from OpenAPI definition for msw.

msw-auto-mock A cli tool to generate random mock data from OpenAPI descriptions for msw. Why We already have all the type definitions from OpenAPI spe

Dec 15, 2022

Generate a Node.js command line tool from an OpenAPI definition

OpenAPI Commander Generate a Node.js command line tool from an OpenAPI definition using the commander library. Example usage Usage: Subcommands groupe

Jan 3, 2023

A VSCode extension that implements outline view and go to definition for Coq files.

A VSCode extension that implements outline view and go to definition for Coq files.

Coq Outline A VSCode extension that provides outline view for Coq files. Features Provide outline views for Coq files. Provide go to definition functi

Oct 29, 2022

A set of effects for mouse-following image trails that show a random series of images.

A set of effects for mouse-following image trails that show a random series of images.

Image Trail Effects A set of effects for mouse-following image trails that show a random series of images. Inspired by the effect seen on VLNC Studio.

Dec 28, 2022

A MERN boilerplate repository with RBAC feature, following all production best practices.

A MERN boilerplate repository with RBAC feature, following all production best practices.

Welcome to the RBAC MERN Boilerplate project A MERN boilerplate repository with RBAC feature, following all production best practices. In this reposit

Dec 27, 2022

Gh-action-dotnet-bump - Automatic bump version of .NET solution by following semantic release

gh-action-dotnet-bump GitHub action which bumps the library version that follows Semantic Versioning. NOTICE: Pre-release functionality for type=assem

Oct 21, 2022

This simple tic-tac-toe game is created by following the react documentation. and there's some modifications on it.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Dec 29, 2022

InstantClick makes following links in your website instant.

InstantClick All the informations you need to use InstantClick are on the link above. This ReadMe’s purpose is about how to use and contribute to a de

Jan 5, 2023

Web UI kit following simply superb.'s design system, based on Tailwind CSS.

ui-kit TailwindCSS powered UI kit following simply superb.'s design system. ➡️ Demo available here Why I am building few applications (iOS / Android /

Mar 4, 2022

Application built following the Udemy course "React Front To Back 2022"

Application built following the Udemy course

Github finder app This project was built based on "React Front To Back 2022" course on Udemy. General information The "Github finder" application uses

Feb 19, 2022

Following the project from Nabendu Biswas's MERN Projects book

mern-dating-app-project Following the project from Nabendu Biswas's MERN Projects book All the codes here are followed based on the book in this link:

Jun 8, 2022

Algorithms and Data Structures implemented in TypeScript for beginners, following best practices.

Algorithms and Data Structures implemented in TypeScript for beginners, following best practices.

The Algorithms - TypeScript TypeScript Repository of TheAlgorithms, which implements various algorithms and data structures in TypeScript. These imple

Dec 31, 2022
Comments
  • Publish to OpenVSX

    Publish to OpenVSX

    Clear and concise description of the problem

    You got many extensions on open-vsx.org, but apparently not this one.

    Suggested solution

    I think you know how to publish there as you already have some extensions there

    Alternative

    No response

    Additional context

    No response

    Validations

    • [X] Follow our Code of Conduct
    • [X] Read the Contributing Guide.
    • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
    enhancement 
    opened by tennox 0
  • Ends up to (最终停在了) shims.d.ts

    Ends up to (最终停在了) shims.d.ts

    Describe the bug

    I created a project based on Vitesse Lite, installed this extension and it worked well. But recently, after I updated Volar (which is 1.0.3) and all NPM packages, this extension on longer works as expected. Now, if I alt+click a component in a .vue SFC, VS Code opens a tab for "components.d.ts" and immediatly opens another for "shims.d.ts" and ends up there.


    I read https://github.com/antfu/unplugin-vue-components/issues/177 So I checked ".npmrc", "shamefully-hoist=true" remains as it was. I also added @vue/runtime-core to devDependencies. No luck. I disabled this extension, or moved "shims.d.ts", either way, clicks ended up to "components.d.ts". So, the two are still necessary. I don't know what else I could try.


    the minimal reproduction

    I just use Vitesse Lite template on GitHub to create one repo. Then, I updated all NPM packages. I tried clicking

    in App.vue. This issue can be reproduced.

    Reproduction

    https://github.com/grandsong/reproduction

    System Info

    System:
        OS: Windows 10 10.0.19044
        CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
        Memory: 1.65 GB / 15.84 GB
      Binaries:
        Node: 16.17.0 - C:\Env\node\node.EXE
        npm: 7.9.0 - C:\Env\node\npm.CMD
      Browsers:
        Edge: Spartan (44.19041.1266.0), Chromium (106.0.1370.42)
        Internet Explorer: 11.0.19041.1566
    

    Used Package Manager

    pnpm

    Validations

    • [X] Follow our Code of Conduct
    • [X] Read the Contributing Guide.
    • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
    • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
    • [X] The provided reproduction is a minimal reproducible of the bug.
    opened by grandsong 3
  • The extension is slow with the latest version of Vitesse

    The extension is slow with the latest version of Vitesse

    Describe the bug

    Video: https://share.cleanshot.com/HOKnbI

    Reproduction

    Reproduction

    System Info

    System:
        OS: macOS 12.4
        CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
        Memory: 349.25 MB / 16.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
        Yarn: 1.22.17 - /usr/local/bin/yarn
        npm: 8.15.0 - ~/.nvm/versions/node/v14.18.2/bin/npm
      Browsers:
        Chrome: 105.0.5195.52
        Chrome Canary: 107.0.5275.0
        Firefox: 100.0
        Firefox Developer Edition: 103.0
        Safari: 15.5
    

    Used Package Manager

    yarn

    Validations

    • [X] Follow our Code of Conduct
    • [X] Read the Contributing Guide.
    • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
    • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
    • [X] The provided reproduction is a minimal reproducible of the bug.
    opened by AxelBriche 0
  • Relation to Declaration Maps?

    Relation to Declaration Maps?

    How does this relate to the Declaration Map / declarationMap feature?

    By reading the TS docs it seems to be the preferred solution for having Go to Definition go to the actual source code. Is this built on top of that or is this an alternative solution?

    Excerpt from the docs, emphasis mine:

    Generates a source map for .d.ts files which map back to the original .ts source file. This will allow editors such as VS Code to go to the original .ts file when using features like Go to Definition.

    You should strongly consider turning this on if you’re using project references.

    opened by voxpelli 0
Releases(v0.1.0)
Owner
Anthony Fu
A ship in harbor is safe, but that is not what ships are built for.
Anthony Fu
Obsidian plugin: Implicitly add an alias matching the first heading in a document.

Alias from heading Aliases in Obsidian make it convenient to provide display names to document links. However, there are a few pain points: Aliases ar

Chris Basham 6 Dec 17, 2022
InstantClick makes following links in your website instant.

InstantClick All the informations you need to use InstantClick are on the link above. This ReadMe’s purpose is about how to use and contribute to a de

Alexandre Dieulot 5.5k Jan 5, 2023
Web UI kit following simply superb.'s design system, based on Tailwind CSS.

ui-kit TailwindCSS powered UI kit following simply superb.'s design system. ➡️ Demo available here Why I am building few applications (iOS / Android /

simply superb. 8 Mar 4, 2022
Application built following the Udemy course "React Front To Back 2022"

Github finder app This project was built based on "React Front To Back 2022" course on Udemy. General information The "Github finder" application uses

null 7 Feb 19, 2022
Following the project from Nabendu Biswas's MERN Projects book

mern-dating-app-project Following the project from Nabendu Biswas's MERN Projects book All the codes here are followed based on the book in this link:

null 1 Jun 8, 2022
Algorithms and Data Structures implemented in TypeScript for beginners, following best practices.

The Algorithms - TypeScript TypeScript Repository of TheAlgorithms, which implements various algorithms and data structures in TypeScript. These imple

The Algorithms 166 Dec 31, 2022
Easy view and filter all follows and following. Auto update by GitHub Action.

?? List All Followers And Following Easy view and filter all follows and following. Auto update by GitHub Action. Since GitHub's default follows and f

Yuri 10 Dec 28, 2022