Open samuelcolvin opened 4 years ago
I don't know how to work the function. I will research it.
@pauleveritt, shamelessly tagging you for help.
Pycharm is sometimes keen on prompting people to install things (I had to email you about a package called pydantic-stubs which was not official, but pycharm was prompting everyone to use it whenever they imported pydantic - I know that was a python package not a pycharm plugin, but still).
Is there anyway we can tell pycharm users that this plugin might be useful when they're using pydantic?
I built a jinja template highlight package for vscode (the enemy :gun:, :pray:) and I'm pretty sure 99.9% of installs come because users get prompted to install a plugin when they open a .jinja
or .jinja2
file. Hence why I'm advocating a prompt to spread the work about this great plugin.
Thanks for tagging. I saw the ticket but I'm in a PyCharm 2019.3 planning meeting and haven't replied yet. (Can't wait for dataclass support in the plugin.)
Yes, there are ways to trigger such things. We have them all over the place. I'll see if I can get the team to comment on this ticket on (a) where is the hook and (b) what is a good example in the IntelliJ repo.
great, thanks.
thank you for your help
@samuelcolvin I should have asked...on your vscode plugin example, either the platform or another plugin would have to detect that situation and do the suggesting. Are you saying vscode maintains a registry of some kind suggesting one plugin versus another?
Not exactly.
My plugin is providing highlighting for jinja code (and html jinja templates), the plugin has a list of file extensions it should work with, eg .jinja
, .jinja2
. When you open a file with an extension vscode doesn't natively support, it looks for plugins that do support than extensions and suggests them. I think pycharm does something similar in this situation.
@samuelcolvin That makes sense at a file extension level. This though is a package import. Does VS Code allow extensions to register support when an opened file imports something?
@samuelcolvin To answer the question though, this page explains how to register for a filename. Note that PyCharm reserves some extensions (e.g. jinja2) for its own support, meaning we won't prompt a suggestion if we already support it.
I think pycharm sometimes prompts me to install packages based on what I'm using.
Is it possible to get pycharm to prompt users to install this plugin whenever they import or install pydantic?