Skip to content

Commit

Permalink
updated multi-root support with a more native impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lonhutt committed Oct 7, 2024
1 parent be4c6d4 commit 2ee927d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 88 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@
{
"id": "bazelTaskOutline",
"name": "Bazel Run Targets"
},
{
"id": "rootFileViewer",
"name": "Project Root (Files)",
"when": "isMultiRoot"
}
]
},
Expand Down
5 changes: 0 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { registerLSClient } from './loggingTCPServer';
import { ProjectViewManager } from './projectViewManager';
import { BazelRunTargetProvider } from './provider/bazelRunTargetProvider';
import { BazelTaskProvider } from './provider/bazelTaskProvider';
import { RootFileViewProvider } from './provider/rootFileViewProvider';
import {
getWorkspaceRoot,
initBazelProjectFile,
Expand All @@ -46,10 +45,6 @@ export async function activate(context: ExtensionContext) {
BazelRunTargetProvider.instance
);
tasks.registerTaskProvider('bazel', new BazelTaskProvider());
window.registerTreeDataProvider(
'rootFileViewer',
RootFileViewProvider.instance
);

BazelLanguageServerTerminal.trace('extension activated');

Expand Down
7 changes: 5 additions & 2 deletions src/projectViewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export namespace ProjectViewManager {

async function getDisplayFolders(): Promise<string[]> {
let displayFolders = new Set<string>(['.eclipse']); // TODO bubble this out to a setting
if (isMultiRoot()) {
displayFolders.add('.');
}
try {
const bazelProjectFile = await getBazelProjectFile();
if (bazelProjectFile.directories.includes('.')) {
Expand Down Expand Up @@ -164,11 +167,11 @@ export namespace ProjectViewManager {
k.includes('.eclipse')
).length;

const viewAll = displayFolders.includes('.');
const viewAll = displayFolders.includes('.') && !isMultiRoot();

const fileWatcherExcludePattern = viewAll
? ''
: `**/!(${Array.from(displayFolders.sort()).join('|')})/**`;
: `**/!(${Array.from(displayFolders.filter((s) => s !== '.').sort()).join('|')})/**`;

if (viewAll) {
// if viewAll and existing config doesn't contain .eclipse return
Expand Down
76 changes: 0 additions & 76 deletions src/provider/rootFileViewProvider.ts

This file was deleted.

0 comments on commit 2ee927d

Please sign in to comment.