-
Notifications
You must be signed in to change notification settings - Fork 216
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
I should be able to create an API Plugin when opening the VS Code in a new window #4852
Comments
I would suggets ~/kiota just to make it simpler. |
For context, this is where the exception comes from. We could set the default to the path Seb suggested instead. And maybe show a warning? kiota/vscode/microsoft-kiota/src/extension.ts Line 311 in 21ba633
|
Not sure we need a warning, but I'm ok with the folder ~/kiota folder. |
@maisarissi so, the issue here is that the |
Are you saying that the issue here is after generation is done and we are opening the VS Code in the output folder? If so, can we open the VS Code instance in the parent folder of .kiota? |
I still have a few concerns:
|
How we determine where to create .kiota? Can't we use that logic to know the parent folder to open the right thing? |
right now the behaviour is driven by vscode. Whatever folder is opened in vscode is the workspace (independent from kiota, bottom bar is blue, not purple). We then use that folder as the current working directory for kiota's engine. That means when anything needs to be accessed/generated, it'll be relative to this directory. I honestly do not see any value in generating to a random location (plugins/clients), the workspace notion seems to be well understood by vscode users, and they'd have to find whatever random place we generated things into and move it to the right place. (VS used to do that, and probably still does to this day with the "new project" wizard, and this has caused so much annoyance.) Now, I understand that we don't want to be greeted by an error message when we open vscode without a workspace opened. This didn't use to be the case with the "mainline" extension version. My guess is this error message is getting triggered by the "my workspace" panel trying to query for state. I think the only thing we need to fix here is to avoid querying for status whenever a workspace is NOT opened so we don't trigger this error message. Thoughts? |
In fact I think I have solved this issue with #4963, it remains to be tested though. |
in fact I just tested my suggested fix, works like a charm. The behaviour is:
|
@baywet so what happens when a user generates the code without any workspace open? does vs code open the home directory as the workspace? |
The generation is the only scenario I have not tested yet. What works now with my pull request is opening vs code with no error message and opening the workspace file with no error message. I think that your PR from briefly looking at it has what it needs for the generation part. I noticed your PR after I pushed mine. If you don't mind merging the 2 and taking it from there? |
Sure thing |
Fixed in #4958 |
<user>
/KiotaGeneration (we can come up with a better folder name too )The text was updated successfully, but these errors were encountered: