vermut/intellij-ansible

IntelliJ IDEA 2016.3.3: Don't see a way to add Ansible support to existing project

jFrenetic opened this issue · 16 comments

Preconditions:

  • IntelliJ IDEA 2016.3.3;
  • YAML/Ansible support plugin v.0.9.4;
  • YAML support v. 163.11103.6

Steps to reproduce:

  • Open existing project containing Ansible YAML sources;

Expected result:

  • YAML/Ansible support is added and some basic features are activated, such as a) quick documentation; b) go to declaration; 3) other features, shown in README

Actual result:

  • No YAML/Ansible support is added;
  • Project Structure shows 1 problem: "Project X: project SDK is not defined" (not sure if I need any SDK, since the project only contains Ansible YAML files.

What I've tried:

  • went to Project Structure and tried to add an Ansible Facet, but couldn't find any;

Looks like Ansible support is not activated, because *.yml and *.yaml file types are already registered to be opened with YAML plugin. I think the proper way to fix this would be to add Ansible Facet, which could either be added manually or detected automatically, based on the root directory name.

Would you like to help me with that?

@vermut I guess, depending on which kind of help you need. Not too experienced with IntelliJ plugin API.

Is it possible to use IJ's YAML plugin if it is available? It is possible to inject anything you need to existing language too via the API

BTW. I was really missing a warning message from the plugin that I was having standard YAML plugin enabled. It was unclear to me why the Ansible support was disabled. Could you please consider showing a warning with the link to the bug

Also 2017.1. I just removed the non-Ansible Yaml plugin for now but would love to see this come along. At the very least warn people when they have the conflicting plugin installed.

It would be great to have it resolved - the non-Ansible YAML plugin is required by Python plugin, so it seems no way to have Python and Ansible support at the same time. (2017.1)

Is it possible to use IJ's YAML plugin if it is available? It is possible to inject anything you need to existing language too via the API

@jonnyzzz I see you working at JetBrains. I've been struggling for years to find a way to "inject anything" from mere Jinja to Ansible Vault values.

Can point me to a good example which demonstrates this feature? For example, I want to "extend" HTML so "A" tags would be processed separately by my plugin.

I'm not IJ developer, but I asked them for samples, you may consider
https://github.com/zalando/intellij-swagger
or
https://github.com/shalupov/idea-cloudformation

Wow. That could seriously change things. Thank you.

(Are there any other insider benefits you can get me? Like private dinner with TemplateLanguage class dev? :) )

But wait. I just realized - the main problem is Jinja. Adding features to existing language is not a big deal, it's Jinja templating which makes things bad.

My idea is multi-layer parser like this:

  1. Jinja - Vars and statements are pre-parsed with lorem ipsum values to generate some code
  2. PGP - attempt to decode encoded blocks
  3. Yaml - just Yaml, maybe even built-in
  4. Ansible - ref/validation

Can you get me in touch with someone who can give me pointers? IRC/Skype/Phone/RL?

Unfortunately, I have no experience on the topic. It may also be helpful to check the forum
https://intellij-support.jetbrains.com/hc/en-us/community/topics/200366979-IntelliJ-IDEA-Open-API-and-Plugin-Development
Theoretically, you may have an (optional?) dependency on Python plugin / PyCharm to have Jinja supported.

I tried with Intellij 2017.2. yaml files are not still being parsed although I disabled the internal yaml plugin. It seems this issue has been hanging for quite a long time.

any updates ?

yes. any updates?