gdelmas / IntelliJDashPlugin

A smart and simple plugin that provides keyboard shortcut access for Dash, Velocity or Zeal in IntelliJ IDEA, RubyMine, WebStorm, PhpStorm, PyCharm and Android Studio.
MIT License
1.09k stars 73 forks source link

Search hits should be ordered according to file's context #49

Closed lusitania closed 8 years ago

lusitania commented 8 years ago

Hi

When searching for a word in PyCharm, i.e. FROM in a Dockerfile, I'm correctly being sent to Zeal. The first result however is from Python's include statement from module include name. Only the second result is about Docker.

I've reported this in zeal issue 441, @trollixx thinks this is closer to your domain.

Best

gdelmas commented 8 years ago

i released a new version with a definition for the dockerfile context. i also included bash and manpages keywords (docs) in this case. i do not get details about the elements inside the dockerfile and suppose some cli tools might be used within the dockerfile. the docker docset is marked with highest priority. i don't know if zeal respects this. it looks like dash does not.

please also install the docker plugin from the jetbrains repository for this mapping to work.

Kapeli commented 8 years ago

it looks like dash does not.

What dash-plugin URL do you call and Dash doesn't respect the order?

gdelmas commented 8 years ago

i am not sure, if you prioritize the search results by keyword order. i think to remember that you once told me dash didn't.

for example: i would assume this query shows the manpage entry first

open -g dash-plugin://keys=manpages,php\&query=from

whereas this query would show the php documentation entry first

open -g dash-plugin://keys=php,manpages\&query=from

however dash shows the php result first in both cases.

Kapeli commented 8 years ago

Ah. I see. Type ordering takes precedence over docset ordering. So PHP Methods show up above Man Pages which are indexed as Functions, regardless of the docset order.

Type ordering works great when the docsets you search over are similar in types, but fails when not. Kind of working as intended.

gdelmas commented 8 years ago

i see. this explains the same behavior when searching in docker and man pages. the docker entry is marked as section, whereas the man entry is marked as function. i guess additionally the docker entry also just qualifies as partial match.

for example:

open -g dash-plugin://keys=docker,bash,manpages\&query=from

thanks for clarifying @Kapeli

lusitania commented 8 years ago

Already done? Wow you are fast!

There are two Docker plugins available for PyCharm:

I've installed both, not knowing if I'll be breaking anything. Do you recommend one over the other?

Edit: The new version isn't in the Jetbrains repo just yet. How long does it take for a release to propagate into their repositories, on average?

gdelmas commented 8 years ago

hi peter,

i just tired the jetbrains docker plugin. i guess this is the latter one. it would be interesting to know if it also just works with the former one installed.

if you do try and it does not work, please tell me what the status bar states when you invoke the dash lookup.

i just need the plugin to recognize the language of the file (context). apart from that i can not say anything about there features.