more work

This commit is contained in:
Benjamin Pasero
2017-09-05 15:29:36 +02:00
parent 4c382387ee
commit dee88267e8
3 changed files with 8 additions and 6 deletions

View File

@ -6,6 +6,8 @@ This extension adds an entry to the status bar that shows the name of the curren
- updates when there are changes to the number of `WorkspaceFolder` via the `workspace.onDidChangeWorkspaceFolders()` API
- registers a setting `multiRootSample.statusColor` with a scope of `resource` to configure a color per `WorkspaceFolder` to use for the status bar item
![Show the folder of the active file](https://raw.githubusercontent.com/Microsoft/vscode-extension-samples/master/basic-multi-root-sample/preview.gif)
## Running the example
- Open this example in VS Code

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 KiB

View File

@ -61,13 +61,13 @@ function getEditorInfo(): { text: string; tooltip: string; color: string; } {
const folder = workspace.getWorkspaceFolder(resource);
if (!folder) {
text = `$(alert) <outside workspace> → ${basename(resource.fsPath)}`;
} else {
text = `$(file-submodule) ${basename(folder.uri.fsPath)}$(file-code) ${basename(resource.fsPath)}`;
tooltip = resource.fsPath;
const multiRootConfigForResource = workspace.getConfiguration('multiRootSample', resource);
color = multiRootConfigForResource.get('statusColor');
}
text = `$(file-submodule) ${basename(folder.uri.fsPath)}$(file-code) ${basename(resource.fsPath)}`;
tooltip = resource.fsPath;
const multiRootConfigForResource = workspace.getConfiguration('multiRootSample', resource);
color = multiRootConfigForResource.get('statusColor');
}
return { text, tooltip, color };