vscode: "Cannot read property 'adapter' of undefined"

I saw this previously in #66322 in provideCodeActions which was fixed, but I’ve just seen the same thing on stable in provideDocumentSymbols:

ERR Cannot read property 'adapter' of undefined: TypeError: Cannot read property 'adapter' of undefined
	at e._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:553:140)
	at e.$provideDocumentSymbols (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:554:184)
	at t._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:644:118)
	at t._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:643:744)
	at t._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:642:256)
	at t._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:641:155)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:638:960
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:38:994
	at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:113)
	at a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170:213)
	at Socket.f._socketDataListener (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170:434)
	at Socket.emit (events.js:182:13)
	at addChunk (_stream_readable.js:279:12)
	at readableAddChunk (_stream_readable.js:264:11)
	at Socket.Readable.push (_stream_readable.js:219:10)
	at Pipe.onread (net.js:636:20)

I guess it should have the same fix (and based on the comments in that issue, Hovers may also need it?).

I was more aware of what I was doing to repro it this time… The Dart extension has code to restart itself when certain config changes (for example, the path to the Dart SDK). We run through all of the providers we created and dispose them, and then re-create them using the new SDK server client.

Based on @jrieken’s comment at https://github.com/Microsoft/vscode/issues/66322#issuecomment-453110213 I guess that if this happens while there are outstanding requests, this error could occur.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (18 by maintainers)

Commits related to this issue

Most upvoted comments

The “no adapter found” message from Code Actions is the only error I seem to be able to repro today in Insiders. I’ll do some more testing once that’s fixed to see if I can find any more. Thanks!