简体   繁体   中英

VS Code “Go To Definition” does not exist - Javascript

I am using VScode version 1.57.

The issue is that it Simply cant not navigate to the definition, "Go To definition" not working.

as you can see in an image it does not exists.

What I have tried:

  • clearing settings.json
  • deleting all extentions
  • resinstallign VS Code
  • changing Key F12 to Shift + `

simply need to navigate to definition, I searched through documentation of VSCode it must read Javascrit files, I even added jsx and js next to ts, tsx but in this simple example below it still does not work.

open image

Your import is importing the entire ./test.js file as the variable sum thus there is no single method definition as you are expecting.

If you want sum to be your actual function called sum you need to change your import statement to:

import { sum } from './test'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM