jdaugherty opened a new issue, #379:
URL: https://github.com/apache/grails-intellij-plugin/issues/379

   ***What steps will reproduce the issue?***
   1\. Create a Grails Gorm for Mongo domain class
   2\. Try to use any of the Mongo specific methods (e.g. `collection` or 
`aggregate`)
   3\. Methods are unavailable for autocomplete, but compilation/running the 
code works.
   
   ***What is the expected result?***
   
   The `MongoEntityTraitProvider `provides Mongo specific methods ([such as 
these](https://gorm.grails.org/5.0.x/mongodb/api/grails/mongodb/MongoEntity.html))
 as a trait `MongoEntity` for Grails GORM MongoDB Domain classes. This is in 
via an AST transform `GormEntityTransformation` - [specifically 
here](https://github.com/grails/grails-data-mapping/blob/7.3.x/grails-datastore-gorm/src/main/groovy/org/grails/compiler/gorm/GormEntityTransformation.groovy#L378-L418).
   
   These methods should be available for autocomplete, but are not.
   
   ***What happens instead?***
   
   The Mongo specific methods are not added, however **the code still compiles 
and tests pass** - meaning the transform is being applied and used.
   
   If I explicitly change my domain to implement `MongoEntity` then 
autocomplete is then available.
   
   ***Example Repository***
   
   <https://github.com/andrewcanby-finocomp/mongo-ast-check>
   
   * See `AuthorService` for usage/missing type completion
   * Domain is `Author.groovy`
   
   (Without `MongoEntity`)
   
   _⚠️ attachment `image.png` was not included in the export_
   
   (With `MongoEntity`)
   
   _⚠️ attachment `image1.png` was not included in the export_
   ```
   IntelliJ IDEA 2022.2.2 (Ultimate Edition)
   Build #IU-222.4167.29, built on September 13, 2022
   Subscription is active until December 15, 2022.
   Runtime version: 17.0.4+7-b469.53 x86_64
   VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
   macOS 12.6
   GC: G1 Young Generation, G1 Old Generation
   Memory: 6100M
   Cores: 12
   Metal Rendering is ON
   Non-Bundled Plugins:
       org.jetbrains.plugins.go-template (222.4167.21)
       org.intellij.plugins.hcl (222.4167.21)
       net.sf.opk.avro-schema-support (213.2.1)
       org.sonarlint.idea (7.0.0.52289)
       mobi.hsz.idea.gitignore (4.4.2)
       org.jetbrains.plugins.ruby (222.4167.21)
       com.intellij.javaee.batch (222.4167.21)
       Karma (222.4167.21)
       org.asciidoctor.intellij.asciidoc (0.37.49)
       Pythonid (222.4167.37)
       com.intellij.kubernetes (222.4167.21)
       org.intellij.grails (222.4167.21)
   
   Kotlin: 222-1.7.10-release-334-IJ4167.29
   ```
   
   ---
   
   *2 attachment(s) referenced here (`image.png`, `image1.png`) are not part of 
the CSV export.*
   *Imported from 
[IDEA-302660](https://youtrack.jetbrains.com/issue/IDEA-302660) · Type: Bug · 
Votes: 0*
   *Comments, attachments, dates and reporter are not part of the export — 
follow the link above for the full history.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to