antiboredom / p5.vscode

A VS Code extension to generate new p5.js project files.
Other
61 stars 18 forks source link

Feature request: project-local types file #14

Open refactorized opened 3 years ago

refactorized commented 3 years ago

Currently creating a new project results in this generated jsconfig.json file

{
  "include": [
    "*.js",
    "libraries/*.js",
    "/Users/adam/.vscode/extensions/samplavigne.p5-vscode-1.2.4/p5types/global.d.ts"
  ]
}

Which references the types file by an absolute path that includes a user name. I will have to copy this to a local directory if I want to put it on git or share it with others. As there is already a libraries directory in a new project, could the types file be created there as well, and referenced with a relative path in the config file?

This could be a toggleable option, but I don't see too much problem in just having the file copied in by default.

Thanks

antiboredom commented 3 years ago

Good idea! When I made this I was trying to minimize how many files the project required, and at the time it seemed to make more sense to simply add the json file rather than the type definitions... Will definitely consider adding this in, and of course feel free to make a pull request if you are so inclined.