ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Add Context #91

Closed dirkk closed 10 years ago

dirkk commented 10 years ago

I was adding some live templates and noticed that there is no context like XQuery in the list. Would be nice if this could be added as I currently apply it to Other.

By the way, if anyone is interested the live templates are located at https://gist.github.com/dirkk/2fd14096038c1a6c6ea2. Maybe at least some of them could also be included as default in the plugin? Some of them are quite common I would guess

arnostv commented 10 years ago

@dirkk - you can check code from pull request #92, it adds some basic support for live templates, defines one context XQUERY_CODE. Would it work for your templates? (Note that this only targets Intellij13)

I think it may be useful to define some additional more specific contexts - e.g. some templates can be applicable only within function declaration (declare variable), other only on the top level of xquery module (namespace declaration)...

ligasgr commented 10 years ago

Hi, thanks for raising the issue. I'll have a look at the templates. If I decide to use some of them would you like to contribute them by yourself? Or should I just copy and/or modify them?

ligasgr commented 10 years ago

I decided to include some as they were, skip some of them, modify some and add some new. I also added you as a contributor to this issue. Additionally I added two sub-contexts (prolog and expression) which should allow for better scoping of live templates.

ligasgr commented 10 years ago

I'm closing the issue (the current theme is implemented). Additional live templates will get added when full text and update facility are implemented.