Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Symbol by Name in Visual Studio Code does not work?

I'm working with .js files. It is a medium sized angular project. I want to goto a definition (a method on a service that i injected on the controller). It doesn't work - nothing happens when i hit F12 or ctrl+click. Even though this works in SublimeText i can't get it to work here. Perhaps the feature is not implemented.

So i check out John Papa's series on VSC http://johnpapa.net/getting-started-with-visual-studio-code/ And i notice that there is a feature to search for a symbol in "all files". This would solve my problem. It's not as great as goto (with F12) but i can still navigate relatively quickly to the symbol without knowing the name of the file it was declared in.

http://www.johnpapa.net/wp-content/uploads/2015/04/symbolsearch.png

When i type it, i get nothing. I hit ctrl+p and type # followed by a few letters. I get 'No symbols matching' nomatter what i type. It won't search my folder for some reason?

I do have one error: Error displayed in VSC and it refers to missing 'angular' element. That element is ofcourse defined in another file and i fail to see how this would break the functionality.

Using version 0.10.1

like image 814
Per Hornshøj-Schierbeck Avatar asked Nov 25 '15 10:11

Per Hornshøj-Schierbeck


1 Answers

You need to install typings for angular to get IntelliSense.

First install tsd:

npm install tsd -g

Next inside your project install angular typing

tsd install angular -rs

(s parameter will create tsd.json).

Alternatively install it from VSC itself

Download type definition angular.d.ts

Click on angular word and choose Download type definition angular.d.ts

Edit:
"Open symbol by name" works now only for C# and TypeScript. code.visualstudio.com/Docs/editor/editingevolved

like image 81
Dauren Akilbekov Avatar answered Oct 01 '22 07:10

Dauren Akilbekov