-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
API and extension host work for multi root #28526
Comments
…e context service from ext host, #28526
Open questions and Todos
|
@jrieken for now since we have the model of a main folder that has an associated setting, An alternative solution would be to simply set |
Yeah, for now I have no problems, but as soon as remove and add all folder I do. Also setting |
@jrieken good point, I forgot about the fact that we restart the extension host typically in that case. Maybe then it is better for now to just always have |
Unsure, it would bake the notion of a main folder into the API |
@jrieken that is true, but I see no way of setting |
Regarding I agree, the natural mapping of |
After talking to @jrieken today there are some ideas what to do with our current Set rootPath to master Set rootPath to null in multi-root Remove rootPath for extensions > 1.14 @Microsoft/vscode feedback welcome |
I am personally in favour of setting |
I'd set |
So, the very cut of multi-root API is small and just the list of folders and an event when that list changes. Also, I have changed export namespace workspace {
export const onDidChangeWorkspaceFolders: Event<Uri[] | undefined>;
export let workspaceFolders: Uri[] | undefined;
} |
After talking in todays multi-root sync we decided to go with the solution of Set rootPath to undefined in multi-root described in #28526 (comment) While the forward breaking is a compelling idea, it needs more infrastructure that we do not have currently. Once we have this, we would use it to remove any deprecated API actually that we have. For now we will deprecate Kai pointed out that we must reserve at least one sprint for extensions to adopt the new API. We should not make multi root broadly enabled without having a significant number of our top extensions having it adopted. Enabling multi-root only in insiders for now gives extension authors a chance to adopt the new APIs. |
Please stop saying |
|
I personally find a one sprint adoption period very short especially given the fact that this falls into the summer month and extension author might be on summer vacation. |
Also as a side note - even if you remove |
That is correct, we cannot enforce that an extension uses all workspace information that is available and if an extension only works on the first folder that's the way it works. I think that is just the nature of new, major features coming late to the party; like multi-root. The reverse is that it doesn't make much sense to set So, I think depicting the first folder as rootPath and restarting the extension host when that folder changes in the best compromise. The way how smart extensions work shouldn't change by that. And btw we did push those fixes already yesterday. |
Sure we do check
This sounds good, indeed. |
@egamma no mockups for this scenario yet because "Multi Root Light" was about keeping Giving extensions a longer period of time to adopt this change makes sense to me. I also agree that one sprint will not be enough, especially during summer. @jrieken regarding the |
After discussions with @weinand we decided to represent a workspace folder as dedicated object, for now like so. With that life is already a little easier and it also allows for future growth of the API. export interface WorkspaceFolder {
readonly uri: Uri;
readonly name: string;
readonly index: number;
} Also, we added a way to find a workspace folder given a certain uri. /cc @mjbvz - I believe you have a ghetto-style implementation of that. export function getContainingWorkspaceFolder(uri: Uri): WorkspaceFolder | undefined; |
Sounds good to me. @jrieken is the |
Yeah, the |
@jrieken I like the idea of
Where the user opens folder |
Sorry, how is getContainingWorkspaceFolder different from |
It's no different, just uses the API types and a more explicit name.
That is interesting. You might be able to call this n times... So |
It doesn't work today but we could make it work. Alternative could to let |
Pushed more tweaks and moved the API out of proposed. fyi @mjbvz The |
This is an umbrella item that track changes that are required for making the extension host and API multi-root aware.
The text was updated successfully, but these errors were encountered: