TypeStrong / atom-typescript

The only TypeScript package you will ever need

Home Page:https://atom.io/packages/atom-typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript tooltips

brettz9 opened this issue · comments

Hi,

Is the experimental JavaScript support supposed to work with tooltips? If not, just filing as a request.

If so, I'm not sure what I'm doing wrong as not getting any (e.g., hovering over the call to a locally imported function).

Remember that atom-ts only activates on TypeScript grammar by default. See https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#i-want-to-use-atom-typescript-with-javascript-too, or manually run typescript:activate command from the command palette.

Yes, thanks, I did that too... But not working...

Maybe I've disabled something somewhere? For atom-ide-datatip, I have "Show datatip automatically on 'mouse' hover" checked.

"Prefer built-in type tooltips" didn't help with a restart either.

Not sure what's going wrong there. It's not that easy to disable tooltips actually. Perhaps you're using a non-standard js grammar or file extension? Check javascript file extensions and javascript syntax scopes in Atom-TypeScript settings. To get editor's syntax scope, run editor:log-cursor-scope in the editor with a JS file open, you're interested in the first scope shown.

If that doesn't help, make sure you're running the latest Atom version (1.55.0 at the time of writing). Try checking developer console (window:toggle-dev-tools, then open console tab) for relevant error messages (be warned, there almost definitely will be some irrelevant ones).

If the issue persists with no obvious cause, you can run window.atom_typescript_debug = 1 in the developer console, that will enable verbose logging of communications with tsserver -- for the purpose of datatips you're interested in seeing sending request { ..., command: "quickinfo", ...} and (perhaps more importantly) received response for quickinfo in ... ms with data { ... }. At least with this we'll know where the issue originates:

  1. If no new log messages of either sending... or recieved ... appear in the dev console after enabling atom_typescript_debug and messing about in the editor (hovering mouse, opening/closing text editors, etc), this means atom-ts didn't actually activate, or is failing to recognize the current editor as relevant (most probably due to unexpected file extension or unknown grammar name).
  2. If there are no sending request { ..., command: "quickinfo", ...}, that means datatip isn't initiated.
  3. If there are no received response for quickinfo ... that means tsserver fails to find anything relevant
  4. If both are there, it means that atom-ts does what it's supposed to, but tooltips are somehow suppressed.

Ah, fixed it, thanks so much... Your suggestions prompted me to look in the config file for my extensions, and in core -> customFileTypes -> source.js I did not have "js" and adding it brought tooltips! Wonderful!

However, I don't think this has caused for other programs, so don't know if you want to add that one by default. But this is great, thanks!

This issue has been marked as stale because it did not have any activity for the last 90 days or more. Remove the stale label or comment or this will be closed in 14 days