Javascript Project - Unable to find references/defintions and navigate around source files

Davies, Myles 1 Reputation point
2021-02-10T12:12:14.137+00:00

I am hoping someone can point me in the right direction please.
I have a set of existing folders containing Javascript and CSS, I want to be able to load these into Visual Studio Pro 2019 and simply edit and navigate these source files. They are part of a larger project, so I do not need or wish to compile them within Visual Studio. I have created various projects and added the relevant directories, however when trying to find the references/definitions of methods that exist outside of the current files I have open I get no results returned. So I am unable to jump to files containing definitions etc... I have to search all files then choose which result to look at. How do I enable the "find all references" which returns "Search found no results" or "Go to definition" which returns "Cannot navigate to symbol under Caret" .

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2021-02-11T03:37:04.873+00:00

    Hello @Davies, Myles ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    I think we need to check from following three aspects:

    1). If the code elements are referenced in other folders(“really exist outside of the current files” as you mentioned).

    2). If there are some settings or options that may not choose or set well when using “Find all references” and “Go to definition” features.

    3). If VS IDE or some of VS settings are broken on your side.

    Firstly, you should make sure that the codes are really referenced in other files, folders or projects. You can try to “Find all references” for other codes or if possible, I think create two files in different folders, with some JS codes to make sure the references really exist maybe a better way.

    Secondly, you need to check if you have selected the “Entire Solution” scope for “Find all references” feature.

    66729-findallreferences1.png

    Thirdly, If you didn’t perform some other operations and the codes, files and the folders were added into your solution by following the standard add process, then you can check the third aspect, please follow steps below.

    1). Try to Build > Clean Solution and then restart VS and use “Find all references” feature again.

    2). Close all VS instances and go to solution folder then delete the “bin”, “obj” and the hidden “.vs” folder, restart VS and check again.

    3). Repair and update VS to the latest version.

    4). Try to reset settings of VS. Follow this document: Reset settings and remember to select “General” at step 4.(If needed, please export your current settings and then reset it)

    Besides, if you try to create some new projects and test in a new solution, if this issue appears again, you can share us the reproducible steps and related codes(screenshots). And this will be useful for us to check and narrow down your issue.

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.