Skip to content

Commit

Permalink
- Updated to the latest version of Groovy Console
Browse files Browse the repository at this point in the history
- Added support for "distribute" method in code completion
  • Loading branch information
bobi committed Aug 20, 2023
1 parent f64806a commit 965e092
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# aem-groovyconsole-plugin Changelog

## [Unreleased]
- Updated to the latest version of Groovy Console
- Added support for "distribute" method in code completion

## [0.8.2] - 2023-07-10
- Added AEMaaCS authentication options
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = com.github.bobi.aemgroovyconsoleplugin
pluginName = aem-groovyconsole-plugin
pluginRepositoryUrl = https://github.com/bobi/aem-groovyconsole-plugin
# SemVer format -> https://semver.org
pluginVersion = 0.8.2
pluginVersion = 0.8.3

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 231
Expand Down
24 changes: 20 additions & 4 deletions src/main/resources/standardDsls/aem.gdsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package standardDsls


import com.intellij.psi.PsiMember
import groovy.transform.Field

def gdslScriptContext = context(scope: scriptScope(), filetypes: ['gdsl'])
def gdslScriptContext = context(scope: scriptScope(null), filetypes: ['gdsl'])

contributor([gdslScriptContext]) {
method name: 'field',
Expand Down Expand Up @@ -33,11 +35,11 @@ contributor([gdslScriptContext]) {

@Field static final String TABLE_CLASS = 'be.orbinson.aem.groovy.console.table.Table'

def aemContext(final Map props) {
def aemContext(final Map props = null) {
final Map contextProps = props ?: [:]

contextProps.scriptType = 'aemconsole'
contextProps.scope = contextProps.scope ?: scriptScope()
contextProps.scope = contextProps.scope ?: scriptScope(null)

return context(contextProps)
}
Expand Down Expand Up @@ -157,6 +159,19 @@ contributor(aemContext()) {
type: void,
doc: doc('Invalidate the node at the given path with supplied options. (Only applicable on AEMaaCS)')

method name: 'distribute',
params: [path: String.name],
type: void,
doc: doc('Distribute the node at the given path with supplied options. (Only applicable on AEMaaCS)')
method name: 'distribute',
params: [path: String.name, agentId: String.name],
type: void,
doc: doc('Distribute the node at the given path with supplied options. (Only applicable on AEMaaCS)')
method name: 'distribute',
params: [path: String.name, agentId: String.name, isDeep: boolean.name],
type: void,
doc: doc('Distribute the node at the given path with supplied options. (Only applicable on AEMaaCS)')

method name: 'createQuery',
params: [predicates: Map.name],
type: 'javax.jcr.query.Query',
Expand Down Expand Up @@ -265,7 +280,8 @@ contributor(aemContext(ctype: 'javax.jcr.Binary')) {
contributor(aemContext(scope: closureScope(methodName: 'table', isArg: true))) {
def tableCall = enclosingCall('table')
if (tableCall) {
def clazz = tableCall.bind()?.containingClass
final def psiMember = tableCall.bind() as PsiMember
final def clazz = psiMember?.containingClass
if (TABLE_CLASS == clazz?.qualifiedName) {
delegatesTo(clazz)
}
Expand Down

0 comments on commit 965e092

Please sign in to comment.