Skip to content

Feature/file watcher #50

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

Merged
merged 5 commits into from
Nov 10, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
load glob pattern
  • Loading branch information
ShMcK committed Nov 10, 2019
commit 7b0b7c058267dea7ce7b8c24684c278833faab62
8 changes: 7 additions & 1 deletion src/actions/setupActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ const setupActions = async (workspaceRoot: vscode.WorkspaceFolder, {commands, co
if (listeners) {
for (const listener of listeners) {
if (!watchers[listener]) {
watchers[listener] = vscode.workspace.createFileSystemWatcher(listener)
const pattern = new vscode.RelativePattern(
vscode.workspace.getWorkspaceFolder(workspaceRoot.uri)!,
listener
)
watchers[listener] = vscode.workspace.createFileSystemWatcher(
pattern
)
watchers[listener].onDidChange(() => {
// trigger save
vscode.commands.executeCommand('coderoad.run_test', null, () => {
Expand Down