What is reference path in vscode

。_饼干妹妹 提交于 2020-08-05 05:54:42

问题


I have downloaded Visual Studio Code for linux, and I am playing around with it. I wanted to use jQuery intellisense with it, and found a way to do it on the internet. Once I did it some sort of directive was added to my js file.

/// <reference path="typings/jquery/jquery.d.ts"/>

what does /// mean to pure javascript? it's not a comment, so how does javascript interpreter deal with this. also I am unable to find the path typings/jquery/jquery.d.ts in the local vscode folder. (although there is a typings folder there is no folder or file named jquery). So from where is this file linked to my js file?


回答1:


Vscode will see :

/// <reference path="typings/jquery/jquery.d.ts"/>

and know it must use intellisense jQuery.

Intellisense is a vscode feature that provides instant context-aware help when writing code. It has nothing to do with your own sourcecode.

Here a really good explanation : vscode intellisense



来源:https://stackoverflow.com/questions/30136319/what-is-reference-path-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!