Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » "java" sources file extensions hardcoded
"java" sources file extensions hardcoded [message #41136] Thu, 30 September 2004 12:45 Go to next message
Eclipse UserFriend
Originally posted by: edoardoATenigmatecDOTnet.no.spam

Hi All,

would an enhancement request to JDT about opening up the set of file
extensions that the JDT editor consides as "java" sources get some
consideration ?

By looking in the JDT source code there semem to be plenty of calls to
org.eclipse.jdt.internal.compiler.util.Util.isJavaFileName(. ..)
where the expected file suffix is ".java" and it does not seem possible
to change that.

I was exploring a java editor customization so that say ".myjava" files,
containing only pure java sources would be opened by a "MyJavaEditor" (*).

I encountered similar problems to AJDT's editor when using ".aj" iles
instaed of ".java" files: a lot of the JDT niceties (it's reason d'etre)
get lost.

I know that AJDT's goals are : <quote>to bring the AJDT experience much
closer to that of Eclipse's JDT, including things like code completion,
formatting, and organise imports</quote>

In the case of AJDT in its current 1.1.12 form, if you write a plain
class inside an "aj" file, w.r.t. to the same class written in a "java"
file:
- no folding capability
- no enhanced syntax highlighting (eg field declarations, statics etc)
- no source menu actions (eg no refactorings)
- some code completions don't work - eg in the body of a class, type
"to" to override toString(..)
- etc

But, if you rename the "aj" file extension to "java" and force it to
open with the AspectJ editor, i.e. the same editor as before (!!!) those
problems all GO AWAY !

No surprise that's a preference to use aj/java as the default extension
for aspect source files.

so can the JDT get the file extensions recognized as java from an
extension point ?

Edo



PS - I appreciate that the JDT's CompilationUnitEditor is an internal
class ... so what ... both the VE project and the AJDT project extend it!


(*) MyJava sources could contain a mix of user code and generated code -
the custrom editor could provide some guards against messing up the
generated stuff.
Re: "java" sources file extensions hardcoded [message #41198 is a reply to message #41136] Thu, 30 September 2004 13:43 Go to previous message
Sian January is currently offline Sian JanuaryFriend
Messages: 83
Registered: July 2009
Member
Hi Edoardo,

Just wondering if you have seen bugzilla report 36939, which is along a
similar vein:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=36939.

We have encountered several problems where the JDT expects java files to
have .java file extensions, and so would welcome any of the changes you
suggested.

Unfortunately I imagine enabling and policing that kind of thing could be
difficult to implement, although I don't know the JDT plugins' structure in
very great detail. It might be a question best posed to the JDT team via
their newsgroup or in a bug report. (Their newsgroup is eclipse.tools.jdt,
not eclipse.technology.jdt.)

Hope this helps,

Sian January



"Edoardo Comar" <edoardoATenigmatecDOTnet@no.spam> wrote in message
news:cjgusj$ihi$1@eclipse.org...
> Hi All,
>
> would an enhancement request to JDT about opening up the set of file
> extensions that the JDT editor consides as "java" sources get some
> consideration ?
>
> By looking in the JDT source code there semem to be plenty of calls to
> org.eclipse.jdt.internal.compiler.util.Util.isJavaFileName(. ..)
> where the expected file suffix is ".java" and it does not seem possible
> to change that.
>
> I was exploring a java editor customization so that say ".myjava" files,
> containing only pure java sources would be opened by a "MyJavaEditor" (*).
>
> I encountered similar problems to AJDT's editor when using ".aj" iles
> instaed of ".java" files: a lot of the JDT niceties (it's reason d'etre)
> get lost.
>
> I know that AJDT's goals are : <quote>to bring the AJDT experience much
> closer to that of Eclipse's JDT, including things like code completion,
> formatting, and organise imports</quote>
>
> In the case of AJDT in its current 1.1.12 form, if you write a plain
> class inside an "aj" file, w.r.t. to the same class written in a "java"
> file:
> - no folding capability
> - no enhanced syntax highlighting (eg field declarations, statics etc)
> - no source menu actions (eg no refactorings)
> - some code completions don't work - eg in the body of a class, type
> "to" to override toString(..)
> - etc
>
> But, if you rename the "aj" file extension to "java" and force it to
> open with the AspectJ editor, i.e. the same editor as before (!!!) those
> problems all GO AWAY !
>
> No surprise that's a preference to use aj/java as the default extension
> for aspect source files.
>
> so can the JDT get the file extensions recognized as java from an
> extension point ?
>
> Edo
>
>
>
> PS - I appreciate that the JDT's CompilationUnitEditor is an internal
> class ... so what ... both the VE project and the AJDT project extend it!
>
>
> (*) MyJava sources could contain a mix of user code and generated code -
> the custrom editor could provide some guards against messing up the
> generated stuff.
Re: "java" sources file extensions hardcoded [message #583367 is a reply to message #41136] Thu, 30 September 2004 13:43 Go to previous message
Sian January is currently offline Sian JanuaryFriend
Messages: 83
Registered: July 2009
Member
Hi Edoardo,

Just wondering if you have seen bugzilla report 36939, which is along a
similar vein:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=36939

We have encountered several problems where the JDT expects java files to
have .java file extensions, and so would welcome any of the changes you
suggested.

Unfortunately I imagine enabling and policing that kind of thing could be
difficult to implement, although I don't know the JDT plugins' structure in
very great detail. It might be a question best posed to the JDT team via
their newsgroup or in a bug report. (Their newsgroup is eclipse.tools.jdt,
not eclipse.technology.jdt.)

Hope this helps,

Sian January



"Edoardo Comar" <edoardoATenigmatecDOTnet@no.spam> wrote in message
news:cjgusj$ihi$1@eclipse.org...
> Hi All,
>
> would an enhancement request to JDT about opening up the set of file
> extensions that the JDT editor consides as "java" sources get some
> consideration ?
>
> By looking in the JDT source code there semem to be plenty of calls to
> org.eclipse.jdt.internal.compiler.util.Util.isJavaFileName(. ..)
> where the expected file suffix is ".java" and it does not seem possible
> to change that.
>
> I was exploring a java editor customization so that say ".myjava" files,
> containing only pure java sources would be opened by a "MyJavaEditor" (*).
>
> I encountered similar problems to AJDT's editor when using ".aj" iles
> instaed of ".java" files: a lot of the JDT niceties (it's reason d'etre)
> get lost.
>
> I know that AJDT's goals are : <quote>to bring the AJDT experience much
> closer to that of Eclipse's JDT, including things like code completion,
> formatting, and organise imports</quote>
>
> In the case of AJDT in its current 1.1.12 form, if you write a plain
> class inside an "aj" file, w.r.t. to the same class written in a "java"
> file:
> - no folding capability
> - no enhanced syntax highlighting (eg field declarations, statics etc)
> - no source menu actions (eg no refactorings)
> - some code completions don't work - eg in the body of a class, type
> "to" to override toString(..)
> - etc
>
> But, if you rename the "aj" file extension to "java" and force it to
> open with the AspectJ editor, i.e. the same editor as before (!!!) those
> problems all GO AWAY !
>
> No surprise that's a preference to use aj/java as the default extension
> for aspect source files.
>
> so can the JDT get the file extensions recognized as java from an
> extension point ?
>
> Edo
>
>
>
> PS - I appreciate that the JDT's CompilationUnitEditor is an internal
> class ... so what ... both the VE project and the AJDT project extend it!
>
>
> (*) MyJava sources could contain a mix of user code and generated code -
> the custrom editor could provide some guards against messing up the
> generated stuff.
Previous Topic:"java" sources file extensions hardcoded
Next Topic:"java" sources file extensions hardcoded
Goto Forum:
  


Current Time: Tue Mar 19 04:09:49 GMT 2024

Powered by FUDForum. Page generated in 0.02876 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top