Skip to content

Error when hover above code #42

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

Closed
daimor opened this issue Jul 2, 2019 · 3 comments
Closed

Error when hover above code #42

daimor opened this issue Jul 2, 2019 · 3 comments
Assignees

Comments

@daimor
Copy link
Member

daimor commented Jul 2, 2019

Probably a separate bug, however when I hover above a command / intrinsic
function ($get etc.) I see the information display - nice work.
Hover over a non-word and the log shows
[2019-07-02 10:02:15.770] [exthost] [error] TypeError: Cannot read property
'end' of undefined
at ObjectScriptHoverProvider.dollars
(c:\Users\Administrator.vscode\extensions\daimor.vscode-objectscript-0.7.11\out\providers\ObjectScriptHoverProvider.js:25:133)

Reviewing the typescipt I see:
public dollars(document: vscode.TextDocument, position: vscode.Position):
vscode.ProviderResult<vscode.Hover> {
const word = document.getWordRangeAtPosition(position);
const text = document.getText(
new vscode.Range(new vscode.Position(position.line, 0), new
vscode.Position(position.line, word.end.character)),
);

Probably needs some defensive coding around the word object before it's
used.

On Tue, 2 Jul 2019 at 09:38, Dmitry Maslennikov [email protected]
wrote:

Closed #41 #41.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#41,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACWXRRXGB6ACXWYTMZEC3CDP5MHXNANCNFSM4H4UBGQA
.

Originally posted by @davbro63 in #41 (comment)

@daimor
Copy link
Member Author

daimor commented Jul 2, 2019

@davbro63 could you share the peace of code and place, hovering which you getting this error?

@daimor daimor self-assigned this Jul 2, 2019
@davbro63
Copy link

davbro63 commented Jul 2, 2019 via email

daimor added a commit that referenced this issue Jul 2, 2019
@daimor
Copy link
Member Author

daimor commented Jul 2, 2019

Thanks, fixed

@daimor daimor closed this as completed Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants