ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

TernError: No type found at the given position. #138

Open max-mykhailenko opened 7 years ago

max-mykhailenko commented 7 years ago

Trying goto definition, but got this alert. Error happens when open definition already on definition

marijnh commented 7 years ago

Without context, there is no way I'm going to be able to say anything useful about this. What code were you on when you tried to go to definition?

max-mykhailenko commented 7 years ago

Source file https://github.com/max-mykhailenko/react-pure-modal/blob/master/src/react-pure-modal.js TernJS config file https://github.com/max-mykhailenko/react-pure-modal/blob/master/.tern-project

Cursor position right on handleEsc method

screen shot 2016-09-23 at 10 34 37 pm
marijnh commented 7 years ago

What did you expect to happen? That is its own definition, not an expression for which Tern can look up a definition. Try on .close two lines down, that should give more useful results.

max-mykhailenko commented 7 years ago

Plugin should just ignore pressing without alert if I'm already on definition. Maybe only with notification in status or message to console, but it's not necessary.

marijnh commented 7 years ago

Agreed -- that's what the Emacs plugin does. Want to write a patch to that effect?