You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I reported this as a side note in atom-community/atom-ide-vue#13, but the relevant code appears to be in this repository.
When I install atom-ide-definitions, atom-ide-vue, and hyperclick, together, every word in my .vue files becomes underlined and hyperclick-able. Here's a screenshot, where the scoped 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.
My assumption is that the click callback is provided (in the Vue example) but atom-ide-vue via options.clickHandler, but that the return value of the getSuggestionForWord 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.
The text was updated successfully, but these errors were encountered:
jonboiser
changed the title
getSuggestionForWord method in ClickProvider seems to make every symbol hyperclick-ablegetSuggestionForWord method in ClickProvider seems to make every word hyperclick-able
Jan 6, 2020
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.
I reported this as a side note in atom-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.The text was updated successfully, but these errors were encountered: