atom-ide-cpp icon indicating copy to clipboard operation
atom-ide-cpp copied to clipboard

Uncaught Error: Connection is closed.

Open beriberikix opened this issue 8 years ago • 8 comments

Step to repro

  1. Grabbed pre-compiled binary from http://releases.llvm.org/download.html
  2. Place clangd in accessible location and add path to package settings
  3. right-click in .cpp file, execute "format code"

Atom: 1.21.0-beta2 x64 Electron: 1.6.9 OS: Mac OS X 10.12.6 Thrown From: ide-cpp package 0.0.2

Stack Trace

Uncaught Error: Connection is closed.

At /Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:960

Error: Connection is closed.
    at /packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:129:28)
    at throwIfClosedOrDisposed (/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:604:19)
    at Object.sendNotification (/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:658:13)
    at LanguageClientConnection._sendNotification (/packages/ide-cpp/node_modules/atom-languageclient/build/lib/languageclient.js:244:15)
    at LanguageClientConnection.didChangeTextDocument (/packages/ide-cpp/node_modules/atom-languageclient/build/lib/languageclient.js:133:10)
    at TextEditorSyncAdapter.sendFullChanges (/packages/ide-cpp/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:183:22)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:626:38
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:141:34)
    at DisplayLayer.emitDidChangeSyncEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:823:24)
    at /Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:781:35
    at Map.forEach (native)
    at TextBuffer.module.exports.TextBuffer.emitDidChangeEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:780:47)
    at TextBuffer.module.exports.TextBuffer.applyChange (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:763:18)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1002:22)
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:956:20)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1673:32)
    at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1234:30
    at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2621:24)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2583:41)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1232:25)
    at TextEditor.module.exports.TextEditor.backspace (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1223:25)
    at TextEditor.object.(anonymous function) [as backspace] (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at TextEditor.core:backspace (/Applications/Atom Beta.app/Contents/Resources/app/src/register-default-commands.js:436:27)
    at /Applications/Atom Beta.app/Contents/Resources/app/src/register-default-commands.js:677:40
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:953:24)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1673:32)
    at HTMLElement.newCommandListeners.(anonymous function) (/Applications/Atom Beta.app/Contents/Resources/app/src/register-default-commands.js:676:28)
    at CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:381:36)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:3:65)

Commands

     -0:19.1.0 core:paste (input.hidden-input)
  2x -0:18.3.0 core:backspace (input.hidden-input)
     -0:14.5.0 core:save (input.hidden-input)
     -0:05.6.0 core:backspace (input.hidden-input)

Non-Core Packages

atom-gdb-debugger 0.2.2 
atom-ide-ui 0.4.0 
ide-clangd 0.1.2 
ide-cpp 0.0.2 
ide-php 0.6.9 
nuclide 0.257.0 

beriberikix avatar Oct 03 '17 05:10 beriberikix

Very likely that there's a conflict between this package and ide-clangd. You'll probably have to choose one of them. If you're willing and interested, try disabling ide-clangd to see if the error goes away :bowing_man:

thomasjo avatar Oct 25 '17 10:10 thomasjo

ide-clangd is was actually disable. I tried uninstalling it and restarting but same error. Any other suggestions I can try that might help to debug?

beriberikix avatar Oct 25 '17 23:10 beriberikix

I'll see if I can reproduce when I get home; running Linux at work.

If you don't mind, try enabling LSP debugging in Atom-IDE; this is an undocumented feature, and must be set either directly in your config.cson file, or via the Developer Tools console;

atom.config.set('core.debugLSP', true)

Once you've enabled debugging, reload Atom and see if any more useful/detailed messages are printed in the console.

thomasjo avatar Oct 27 '17 06:10 thomasjo

> atom.config.set('core.debugLSP', true)
< true

> /Users/jberi/.atom/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:129 Uncaught Error: Connection is closed.
    at new ConnectionError (/Users/jberi/.atom/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:129:28)
    at throwIfClosedOrDisposed (/Users/jberi/.atom/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:604:19)
    at Object.sendNotification (/Users/jberi/.atom/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:658:13)
    at LanguageClientConnection._sendNotification (/Users/jberi/.atom/packages/ide-cpp/node_modules/atom-languageclient/build/lib/languageclient.js:244:15)
    at LanguageClientConnection.didCloseTextDocument (/Users/jberi/.atom/packages/ide-cpp/node_modules/atom-languageclient/build/lib/languageclient.js:137:10)
    at TextEditorSyncAdapter.didClose (/Users/jberi/.atom/packages/ide-cpp/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:266:22)
    at wrapped (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:101:22)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at TextEditor.module.exports.TextEditor.destroyed (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:661:26)
    at TextEditor.module.exports.Model.destroy (/Applications/Atom.app/Contents/Resources/app/src/model.js:31:64)
    at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:708:24)
    at TabBarView.module.exports.TabBarView.closeTab (/Applications/Atom.app/Contents/Resources/app/node_modules/tabs/lib/tab-bar-view.js:341:32)
    at HTMLDivElement.TabView.didClickCloseIcon (/Applications/Atom.app/Contents/Resources/app/node_modules/tabs/lib/tab-bar-view.js:229:25)

beriberikix avatar Oct 28 '17 22:10 beriberikix

I have managed to reproduce the problem, although not 100% reliably yet. Still trying to figure out what is going wrong, and if it is something that can/should be handled on this end or if it is something that needs to be resolved in atom-languageclient (or elsewhere in the dependency chain).

thomasjo avatar Nov 02 '17 11:11 thomasjo

Let me know how I can help diagnosis!

beriberikix avatar Nov 02 '17 21:11 beriberikix

[Enter steps to reproduce:]

  1. delete .atom directory (fresh config)
  2. install atom-ide-ui and ide-typescript, restart Atom
  3. edit any .js file

mitigation: disable ide-typescript

I got a similar error (the same error?) a few days ago and it linked to a different issue. I haven't had time to look into it on my system yet.

Atom: 1.21.1 x64 Electron: 1.6.15 OS: Ubuntu 17.04 Thrown From: ide-cpp package 0.0.3

Stack Trace

Uncaught Error: Connection is closed.

At /home/user/.atom/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:613

Error: Connection is closed.
    at /packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:138:28)
    at throwIfClosedOrDisposed (/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:613:19)
    at Object.sendNotification (/packages/ide-cpp/node_modules/vscode-jsonrpc/lib/main.js:667:13)
    at LanguageClientConnection._sendNotification (/packages/ide-typescript/node_modules/atom-languageclient/build/lib/languageclient.js:242:15)
    at LanguageClientConnection.didChangeTextDocument (/packages/ide-typescript/node_modules/atom-languageclient/build/lib/languageclient.js:131:10)
    at TextEditorSyncAdapter.sendFullChanges (/packages/ide-typescript/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:181:22)
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at /usr/share/atom/resources/app/src/text-editor.js:626:38
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:141:34)
    at DisplayLayer.emitDidChangeSyncEvent (/usr/share/atom/resources/app/node_modules/text-buffer/lib/display-layer.js:825:24)
    at decorationLayerDisposable.textDecorationLayer.onDidInvalidateRange (/usr/share/atom/resources/app/node_modules/text-buffer/lib/display-layer.js:161:20)
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (/usr/share/atom/resources/app/src/tokenized-buffer.js:241:28)
    at /usr/share/atom/resources/app/src/tokenized-buffer.js:206:32
    at /usr/share/atom/resources/app/node_modules/underscore/underscore.js:666:53

Commands

Non-Core Packages

atom-ide-ui 0.5.4 
atom-runner 2.7.1 
ide-cpp 0.0.3 
ide-python 0.3.0 
ide-typescript 0.7.0 

mvirts avatar Nov 11 '17 13:11 mvirts

experiencing the same when editing js files. will trigger the same error as above on UI actions (click, type).

nlhcky avatar Mar 07 '18 14:03 nlhcky