Skip to content
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

No provider error when adding a folder with updateWorkspaceFolders #42658

Closed
octref opened this issue Jan 31, 2018 · 1 comment
Closed

No provider error when adding a folder with updateWorkspaceFolders #42658

octref opened this issue Jan 31, 2018 · 1 comment
Assignees
Labels
api workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@octref
Copy link
Contributor

octref commented Jan 31, 2018

Testing #42195

Tried adding two folders one by one, each operation errored out.
When I add those exact folders by Right Click -> Add Folder to Workspace there was no error.

image

Code

const folders = [
  { uri: Uri.parse('/Users/octref/Code/fiddle/repro') },
  { uri: Uri.parse('/Users/octref/Code/fiddle/ve') },
  { uri: Uri.parse('/Users/octref/Code/repo/postcss-safe-parser') },
  { uri: Uri.parse('/Users/octref/Code/work/tedious') },
]

export const activate = (context: vscode.ExtensionContext) => {
  vscode.workspace.onDidChangeWorkspaceFolders(e => {
    console.log(`Added ${e.added.length} folders`)
    e.added.forEach(f => {
      logFolder(f)
    })
    console.log(`Removed ${e.removed.length} folders`)
    e.removed.forEach(f => {
      logFolder(f)
    })
  })
  function addFolder(n) {
    try {
      vscode.workspace.updateWorkspaceFolders(1, 0, folders[n])
    } catch (e) {
      console.error(e.message)
    }
  }

  vscode.commands.registerCommand('addFolder1', () => addFolder(0))
  vscode.commands.registerCommand('addFolder2', () => addFolder(1))
  vscode.commands.registerCommand('addFolder3', () => addFolder(2))
  vscode.commands.registerCommand('addFolder4', () => addFolder(3))
  vscode.commands.registerCommand('removeFolder', () => {
    try {
      vscode.workspace.updateWorkspaceFolders(1, 2)
    } catch (e) {
      console.error(e.message)
    }
    //vscode.workspace.updateWorkspaceFolders(0, null, { uri: vscode.Uri.parse('/Users/octref/Code/fiddle/repro') })
  })
}

Log

/private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/9…nsiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2924 no provider for /Users/octref/Code/work/tedious: ENOPRO: no provider for /Users/octref/Code/work/tedious
    at file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2805:679
    at n.Class.define.cancel.then (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:147:398)
    at t._withProvider (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2805:618)
    at t._doResolveFiles (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2806:666)
    at t.resolveFile (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2806:78)
    at e.getChildren (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4401:83)
    at a (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:303:466)
    at e.refreshChildren (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:304:265)
    at e.doRefresh (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:304:544)
    at file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:304:126
e.doShow @ /private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/9…nsiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2924
/private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/9…nsiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2924 no provider for /Users/octref/Code/repo/postcss-safe-parser: ENOPRO: no provider for /Users/octref/Code/repo/postcss-safe-parser
    at file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2805:679
    at n.Class.define.cancel.then (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:147:398)
    at t._withProvider (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2805:618)
    at t._doResolveFiles (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2806:666)
    at t.resolveFile (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2806:78)
    at e.getChildren (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4401:83)
    at a (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:303:466)
    at e.refreshChildren (file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:304:265)
    at file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:301:857
    at file:///private/var/folders/31/2hth7q4n4bl4kyntrvbyg66h0000gn/T/AppTranslocation/910CB87F-A114-460D-8CD8-5E149B164864/d/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:296:715
@octref octref added api workbench-multiroot Multi-root (multiple folders) issues labels Jan 31, 2018
@bpasero bpasero added this to the January 2018 milestone Feb 1, 2018
@bpasero
Copy link
Member

bpasero commented Feb 1, 2018

@octref you are not passing in correct URIs, use URI.file() instead of URI.parse().

@bpasero bpasero closed this as completed Feb 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

2 participants