Closed jonboiser closed 4 years ago
Hi, as said in the other issue, it's a good point, only items with definition should be highlighted and clickable.
You are right about getSuggestionForWord
, it shouldn't return universal handler. We can first check if definition is available (on cmd
+ hover), base return on that.
:tada: This issue has been resolved in version 0.3.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I reported this as a side note in atom-ide-community/atom-ide-vue#13, but the relevant code appears to be in this repository.
When I install
atom-ide-definitions
,atom-ide-vue
, andhyperclick
, together, every word in my.vue
files becomes underlined and hyperclick-able. Here's a screenshot, where thescoped
attribute is underlined (the cursor isn't captured by the screenshot, but it over the word), even though it will not have a definition anywhere in a typical Vue codebase.Looking at https://github.com/atom-ide-community/atom-ide-definitions/blob/master/lib/clickProvider.js#L11, the implementation of
ClickProvider::getSuggestionForWord
seems to return an object for every word that is sent to it, whencmd-hovering
(for Mac) over code. Hyperclick will treat every symbol as clickable ifgetSuggestionForWord
always returns a truthy object result, hence the behavior I'm seeing.My assumption is that the click callback is provided (in the Vue example) but
atom-ide-vue
viaoptions.clickHandler
, but that the return value of thegetSuggestionForWord
function is not controllable by the Vue package. To me, it seems that the language-level atom-ide plugins need to be able to determine whether or not a token has a definition and only return an truthy result if it does.