Skip to content

load taskProviders after folder is ready #387

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api> {
// listen for workspace folder changes and active text editor changes
workspaceContext.setupEventListeners();

// Register task provider.
const taskProvider = vscode.tasks.registerTaskProvider(
"swift",
new SwiftTaskProvider(workspaceContext)
);
// Register swift plugin task provider.
const pluginTaskProvider = vscode.tasks.registerTaskProvider(
"swift-plugin",
new SwiftPluginTaskProvider(workspaceContext)
);
commands.register(workspaceContext);

const commentCompletionProvider = commentCompletion.register();

const languageStatusItem = new LanguageStatusItems(workspaceContext);
Expand Down Expand Up @@ -106,7 +94,19 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api> {
const testExplorerObserver = TestExplorer.observeFolders(workspaceContext);

// setup workspace context with initial workspace folders
workspaceContext.addWorkspaceFolders();
await workspaceContext.addWorkspaceFolders();

// Register task provider.
const taskProvider = vscode.tasks.registerTaskProvider(
"swift",
new SwiftTaskProvider(workspaceContext)
);
// Register swift plugin task provider.
const pluginTaskProvider = vscode.tasks.registerTaskProvider(
"swift-plugin",
new SwiftPluginTaskProvider(workspaceContext)
);
commands.register(workspaceContext);

// Register any disposables for cleanup when the extension deactivates.
context.subscriptions.push(
Expand Down