Re: [cedet-semantic] How to support for Annotations in Semantic function tags in java
Brought to you by:
zappo
From: Eric L. <er...@si...> - 2018-07-01 02:37:39
|
Hi Andreas, It is certainly possible to make the CEDET/Semantic infrastructure do what you are asking, but several pieces are missing. I don't believe that annotations are supported by the parser. I don't know enough about annotations or Java to be sure, but a short test on my part indicates it isn't part of the method tag. Someone will need to update semantic/wisent/java-tags.wy (and probably java.wy which is a parallel full language parser) to add annotations. Once it is part of the parser, adding a keybinding, probably in the ede java support to run the test would probably be pretty easy as long as there is an EDE wrapper around whichever build system you are using. If there isn't a build system, you can probably create an EDE wrapper based on the existing java flavors like ede/maven2.el or the like. There is existing android ede support in the CEDET version on sourceforge which I don't think made it into emacs proper. I've had a hard time keeping up with it as Android dev has moved forward faster than my occasional android development. That ede wrapper has a few custom key bindings for build / upload that might make a reasonable model for what you want to do. If possible, I would recommend you do your development against the Emacs build. The version in cedet/git has gotten stale since the eieio update in Emacs and I have no way to promote changes to there anymore. Thanks Eric On 06/29/2018 09:02 AM, Andreas Marschke wrote: > Hi everyone! > > I'm looking for a way to find java annotations on methods/classes and > detect them as attribute on methods found in a file. > So for example, in a class like this: > > package com.example.app; > > public class Example > { > public Example() { /* ... */ } > @Test > public void exampleTest() { /* ... */ } > > @SuppressWarnings("static-access") > public void exampleMethod() { /* ... */ } > } > > In a class like the above, I'd love to have the ability to do something > like: > (semantic-tags-java-get-annotations (semantic-current-tag)) > ;; ("Test"), for `exampleTest()' > (semantic-tags-java-get-annotations (semantic-current-tag)) > ;; ("SuppressWarnings" . "static-access"), for `exampleMethod()' > > Is something like this possible with semantic? Is there another > tool/library that I could use to get at the annotations? > > The goal is to do something akin to the way Android Studio for example > can kick off a test with only a single test selected. I know the > commandline param to do it but would like to automate it down to a key > chord that would execute the test based on the test method my pointer is in. > > Any suggestions tips or pointers would be appreciated. > > Kind regards, > > Andreas Marschke. > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > cedet-semantic mailing list > ced...@li... > https://lists.sourceforge.net/lists/listinfo/cedet-semantic > |