javascript - 让 vscode 理解 p5js
问题描述
我最近开始使用 P5JS,我使用 VSCode 作为编辑器。
VSCode 不知道 P5JS,因为我猜它是一个库,并且会自动完成所有错误的操作。
有没有办法将 P5JS 语言文件导入 VSCode,因为这真的很痛苦。
预先感谢您的帮助。
解决方案
As far as Intellisense for P5.js in Visual Studio Code is concerned, there is currently no official build of p5.js typescript definition files, hence it cannot be done with npm install
. I have attached a link to a zip file (as stack overflow doesn't support file attachment):
https://www.filehosting.org/file/details/795689/p5.d.zip
After download, put them in your project directory somewhere and add a reference to them in your sketch.js file.
E.g:
< reference path="./p5.global-mode.d.ts" / >
After that you will be able to get autocomplete & docs:
推荐阅读
- php - 未捕获的错误:在 null 上调用成员函数 userDetails()
- c - 为什么代码“x++ && y++;” 在没有控制运算符的情况下在 C 中工作?
- sql-server - SQL Server:将两行相加并创建一行,然后删除重复项
- netlogo - 将求和的补丁变量分配给代理或补丁集
- sql - Oracle SQL - 返回具有基于第二个字段中的多个值的值的行
- go - 未找到类型 InteractionCallback,并且 atom 正在删除 import 语句
- angularjs - AngularJS - 从父控制器运行子控制器的功能
- python - Python Eve,如何为多个端点启用嵌入?
- angular - 使用 FormControl.setValue() 时多次调用 ControlValueAccessor.writeValue()
- rust - 将内部引用传递给泛型闭包时的关联类型生存期