Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Can't get auto completion to work #358

Closed
andretf opened this issue Jun 22, 2018 · 5 comments
Closed

Can't get auto completion to work #358

andretf opened this issue Jun 22, 2018 · 5 comments
Labels

Comments

@andretf
Copy link

andretf commented Jun 22, 2018

Your environment

  • vscode-ruby version: 0.18.0
  • Ruby version: 2.5.1
  • VS Code version: 1.24.1
  • Operating System: Linux Manjaro
  • Hardware (optional):

Make sure you have ruby, ruby-debug-ide and ruby-debug-basex19 installed before submitting your issue -- thank you !

Expected behavior

Auto completion to work

Actual behavior

Got this almost same console logged error from #229:

  ERR Cannot read property 'then' of undefined: TypeError: Cannot read property 'then' of undefined
    at Locate.listInFile (/home/afigueiredo/.vscode/extensions/rebornix.ruby-0.18.0/out/locate/locate.js:68:28)
    at Object.provideDocumentSymbols (/home/afigueiredo/.vscode/extensions/rebornix.ruby-0.18.0/out/providers/intellisense.js:49:35)
    at /opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:686:997
    at /opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:103:887
    at new n.Class.derive._oncancel (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:83:776)
    at Object.t.asWinJsPromise (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:103:850)
    at e.provideDocumentSymbols (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:686:951)
    at /opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:701:861
    at e._withAdapter (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:701:385)
    at e.$provideDocumentSymbols (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:701:823)
    at e._doInvokeHandler (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:636:832)
    at e._invokeHandler (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:636:550)
    at e._receiveRequest (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:635:631)
    at e._receiveOneMessage (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:635:400)
    at /opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:634:315
    at /opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:637:395
    at /opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:95:432
    at e.fire (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:96:764)
    at Socket.<anonymous> (/opt/visual-studio-code/resources/app/out/vs/workbench/node/extensionHostProcess.js:154:338)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)

tracking down and the error is thrown by this file:line:
https://github.com/rubyide/vscode-ruby/blob/master/src/locate/locate.js#L74
waitForParse is undefined when absPath in this.tree is false because #parse method returns undefined from previous line in ternary if:

https://github.com/rubyide/vscode-ruby/blob/master/src/locate/locate.js#L122:

    parse(absPath) {
        this.parseQueue.push(() => this._parseAsync(absPath));
        // <------ should return a Promise
    }

Steps to reproduce the problem

@opes
Copy link

opes commented Aug 28, 2018

Apologies for commenting/resurrecting an old issue, but I've continually had this problem whenever I set:

"ruby.intellisense": "rubyLocate"

#229 mentions opening Code via the terminal, but that resulted in the same error as above:

 ERR Cannot read property 'then' of undefined: TypeError: Cannot read property 'then' of undefined
	at Locate.listInFile (/Users/admin/.vscode-insiders/extensions/rebornix.ruby-0.20.0/out/locate/locate.js:69:29)

@andretf, did you ever figure out a way to resolve this on your end? I'm attempting to debug and hoping to contribute a fix/workaround to the extension (unless there's already a fix in the works).

Environment:

  • vscode-ruby version: 0.20.0
  • Ruby version: 2.5.1
  • VS Code version: 1.27.0 - Insiders
  • Operating System: macOS 10.13.6
  • Hardware (optional): 2016 MacBook Pro

@andrewmcodes
Copy link

I can confirm that I am getting the exact same issue, except I am on VS code 1.27.2.

@dshefchik
Copy link

Yep. I am getting the same issue as well.

@andretf
Copy link
Author

andretf commented Jan 19, 2019

@opes It seems the using rubyLocate isn't working yet, I'm using Solargraph now.

@github-actions
Copy link

This issue has not had activity for 30 days. It will be automatically closed in 7 days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants