ranjitjhala / hover-tooltips-hdevtools

Atom package displaying types on hover using hdevtools
MIT License
1 stars 1 forks source link

Uncaught TypeError: editor.displayBuffer.getScrollTop is not a function #3

Open notcome opened 9 years ago

notcome commented 9 years ago

[Enter steps to reproduce below:]

  1. Open any file, .hs and others
  2. Bang!

Seems to be a upstream API broken? I can find some similar issue, like this and this.

A useful comment from the later:

Submitted a pull request that fixes this. Apparently getScrollTop() and getScrollLeft() was moved to the editor.

Atom Version: 1.1.0 System: Mac OS X 10.11 Thrown From: hover-tooltips-hdevtools package, v0.8.0

Stack Trace

Uncaught TypeError: editor.displayBuffer.getScrollTop is not a function

At /Users/Liu.MS/.atom/packages/hover-tooltips-hdevtools/node_modules/hover-tooltips/lib/hover-tooltips.js:53

TypeError: editor.displayBuffer.getScrollTop is not a function
    at showExpressionType (/Users/Liu.MS/.atom/packages/hover-tooltips-hdevtools/node_modules/hover-tooltips/lib/hover-tooltips.js:53:49)
    at /Users/Liu.MS/.atom/packages/hover-tooltips-hdevtools/node_modules/hover-tooltips/lib/hover-tooltips.js:40:63

Commands

Config

{
  "core": {},
  "hover-tooltips-hdevtools": {}
}

Installed Packages

# User
hex, v0.6.2
hover-tooltips-hdevtools, v0.8.0
language-haskell, v1.4.12
language-latex, v0.6.1
linter, v1.10.0
linter-hdevtools, v1.6.0

# Dev
No dev packages
notcome commented 9 years ago

Should be the problem of hover-tooltips.

notcome commented 9 years ago

So, in hover-tooltips.js

Changing it to the following solves the issue:

//pixelPt.top += editor.displayBuffer.getScrollTop();
pixelPt.top += editor.getScrollTop();
//pixelPt.left += editor.displayBuffer.getScrollLeft();
pixelPt.left += editor.getScrollLeft();

I don't have a TypeScript development environment at hand and am a bit unfamiliar with it, so unfortunately I couldn't send a pull request.

ranjitjhala commented 9 years ago

Thanks for pointing out, I believe this is fixed by https://github.com/ranjitjhala/hover-tooltips/pull/3 ?

Can you just upgrade the package -- apm install hover-tooltips-hdevtools -- and let me know if this is fixed? Thanks!

ericmdantas commented 9 years ago

@ranjitjhala that worked for me, thanks!