mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
more work
This commit is contained in:
@ -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
|
||||
|
||||

|
||||
|
||||
## Running the example
|
||||
|
||||
- Open this example in VS Code
|
||||
|
||||
BIN
basic-multi-root-sample/preview.gif
Normal file
BIN
basic-multi-root-sample/preview.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 491 KiB |
@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user