Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate codelens fails on Windows #1738

Closed
janpio opened this issue May 23, 2024 · 2 comments · Fixed by #1740
Closed

Generate codelens fails on Windows #1738

janpio opened this issue May 23, 2024 · 2 comments · Fixed by #1740
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: codelens topic: windows
Milestone

Comments

@janpio
Copy link
Contributor

janpio commented May 23, 2024

Using the new Generate thing over generator client leads to this for me:

Running prisma generate:
- /C:/Users/Jan/Documents/throwaway/19963
- (cd /C:/Users/Jan/Documents/throwaway/19963 && npx prisma generate)
Command failed: (cd /C:/Users/Jan/Documents/throwaway/19963 && npx prisma generate)
The filename, directory name, or volume label syntax is incorrect.

image

@janpio janpio added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: windows labels May 23, 2024
@janpio janpio changed the title Generate thing fails on Windows Generate codelens fails on Windows May 23, 2024
@janpio
Copy link
Contributor Author

janpio commented May 23, 2024

Quick look at the code:

  1. const rootPath = vscode.workspace.workspaceFolders?.[0].uri.path
    seems to include that leading slash, which will cd fail.
  2. https://github.com/prisma/language-tools/blob/9fef22bbe9994e898c54ce6ac7e083b4d445086a/packages/vscode/src/CodeLensProvider.ts#L86C32-L86C34 uses &&, which does not exist on Windows+PowerShell:
> cd C:/Users/Jan/Documents/throwaway/19963 && npx prisma generate  
At line:1 char:43
+ cd C:/Users/Jan/Documents/throwaway/19963 && npx prisma generate
+                                           ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

So I guess we need a better way to get the path for Windows, and then to run both commands consecutively.

@Druue Druue added this to the 5.15.0 milestone May 27, 2024
@Druue Druue self-assigned this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: codelens topic: windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants