feat(vscode): Add codelens provider w/ generate client command#1710
feat(vscode): Add codelens provider w/ generate client command#1710
Conversation
🤖 Pull request artifactsempty string
|
|
I just tried it out, and it only works for the first Also, it looks like it only runs "... prisma generate", which breaks if the Prisma schema filename is custom like see screenshot from GitPod (using the comment above) Also, it looks like it gets stuck if Prisma CLI is not installed, but maybe this instance of GitPod is broken because "npm -v" gets stuck too in the terminal 😓 : |
|
Hmm, I didn't have the same problem with npm in codespaces @Jolg42 Screen.Recording.2024-04-29.at.17.17.44.mov |
|
@Druue Nice, then that's probably my instance that was broken, I'll try again later. |
|
✨ I'm not keen on adding further regex to check if the generator is Screen.Recording.2024-05-01.at.11.13.14.mov |
Jolg42
left a comment
There was a problem hiding this comment.
Nice PR!
I'm curious to see people noticing this ✨
Add script runner config setting Register prisma generate client codelens Add event tracking to update script runner for codelens Use script runner as arg for gen client command
- this lets users set a custom schema path for codelenses Removed scriptRunner as prop on codelens provider - see comment for more info - now directly accessingthe config from within `generateClient()` Allow for generate lens to appear over all generators in the file, not just the first
ec0624b to
e037e3b
Compare



Added a codelens provider to our vscode extension with one codelens command to run
prisma generateThis uses new config to define which script runner to use, whether you want the codelens active or not, and setting a custom path
This shows the following clickable text above the generator block

Which opens up a new output window wherein we run
prisma generateusing the defined script runnerScreen.Recording.2024-04-24.at.18.42.23.mov
Alternatively it is possible to run this through both
{ "key": "shift+cmd+g shift+cmd+g", "command": "prisma.generate" }closes #1651