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

Type & Hover Error #3

Closed
macjabeth opened this issue Nov 11, 2017 · 8 comments
Closed

Type & Hover Error #3

macjabeth opened this issue Nov 11, 2017 · 8 comments

Comments

@macjabeth
Copy link

macjabeth commented Nov 11, 2017

Opening a large lua file gave me this error:

[Info  - 7:33:33 PM] extension initialize status: false
[Error - 7:33:33 PM] Notification handler 'workspace/didChangeConfiguration' failed with message: path must be a string or Buffer
TypeError: Cannot read property 'parse' of undefined
    at SymbolManager.parseDocument (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/server/providers/lib/symbol-manager.js:30:27)
    at Coder.onDidChangeContent (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/server/coder.js:88:37)
    at documents.onDidChangeContent (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/server/server.js:50:11)
    at CallbackList.invoke (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/node_modules/vscode-jsonrpc/lib/events.js:71:39)
    at Emitter.fire (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/node_modules/vscode-jsonrpc/lib/events.js:135:36)
    at connection.onDidOpenTextDocument (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/node_modules/vscode-languageserver/lib/main.js:174:38)
    at handleNotification (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/node_modules/vscode-jsonrpc/lib/main.js:476:43)
    at processMessageQueue (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/node_modules/vscode-jsonrpc/lib/main.js:248:17)
    at Immediate.<anonymous> (/home/boonie/.vscode-insiders/extensions/liwangqian.luacoderassist-1.2.3/node_modules/vscode-jsonrpc/lib/main.js:235:13)
    at runCallback (timers.js:672:20)

And when I hover over any of the variables in the file, I'm getting this error:

[Error - 7:34:14 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'provideHover' of undefined
  Code: -32603 
[Error - 7:34:34 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'provideHover' of undefined
  Code: -32603 

Happy to provide any other information necessary to sort out this issue.

@liwangqian
Copy link
Owner

@macjabeth Did you open the file directly instead of open the folder containing the file ? In this case, the extension cannot initialized correctly, as your log shows:
[Info - 7:33:33 PM] extension initialize status: false

I known this problem, but i did not fix it, a little lazzy :)

liwangqian added a commit that referenced this issue Nov 12, 2017
liwangqian added a commit that referenced this issue Nov 12, 2017
- add ldoc command to insert document for function.
- add ldoc context menu '**Insert LDoc**'.
@liwangqian
Copy link
Owner

@macjabeth try Ver 1.2.5 please.

@macjabeth
Copy link
Author

@liwangqian Yes, I opened it directly instead of opening the folder containing the file. Sorry for the late reply, I fell asleep :)

And ok, I'm waiting for the update to come through in VSCode. Will let you know how it goes!

@macjabeth
Copy link
Author

@liwangqian I'm not getting the first error message anymore, but it seems like the ones showing up in the second image I posted still are.

This is after hovering over any of the variables there:
image

Also, the intellisense wasn't working on this file for some reason. Maybe because it was too large? I'm not sure - any insight would be appreciated!
image

@liwangqian
Copy link
Owner

@macjabeth From the description you give, I guess there is something failed while parsing the file, so document symbols did not generate, and so hover/intellisense did not work.

I need more information to figure out the problem. I guess is there any syntax error in your file? This can be check from the PROBLEMS panel.

@macjabeth
Copy link
Author

macjabeth commented Nov 13, 2017

@liwangqian One problem does show up:

image

When I change the file size limit in the settings, the error goes away and a new one presents itself in the OUTPUT panel:

[Info  - 2:59:25 PM] coder inited
[Info  - 2:59:25 PM] extension initialize status: true
(node:27103) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property 'split' of undefined
(node:27103) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[Error - 2:59:28 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'concat' of undefined
  Code: -32603 

However, when I look at the PROBLEMS panel, it says no problems have been detected.

That being said, I decided to do a little debugging and try and pinpoint the error in the script. It turns out that the error is only showing up when I take the .lua extension off the file name and manually set the language of the file to lua.

For example:
filename - manually set file language to lua: error shows up when hovering over any variables
filename.lua - error does not show up and hovering works as expected

liwangqian added a commit that referenced this issue Nov 13, 2017
2. add 'keepAfterClosed' option for luacheck diagnostics.
@liwangqian
Copy link
Owner

@macjabeth Thanks for your help to figure out this problem, I will fix it next day, have to go sleep.

@liwangqian
Copy link
Owner

@macjabeth try ver 1.2.7 please, review at a74f192

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

No branches or pull requests

2 participants