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 #583385] Thu, 30 September 2004 14:21
Edoardo Comar is currently offline Edoardo ComarFriend
Messages: 28
Registered: July 2009
Junior Member
[Reposting on the right group to get traction.
First answer to the thread below.]
---------------------------------------------
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 i"java"
sources file extensions hardcodedn 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.

============================================================ ======================
Subject:Re: "java" sources file extensions hardcoded
From:"Sian January" <sjanuary@uk.ibm.com>
Date:Thu, 30 Sep 2004 14:43:41 +0100
Newsgroups:eclipse.technology.ajdt

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
Previous Topic:"java" sources file extensions hardcoded
Next Topic:"java" sources file extensions hardcoded
Goto Forum:
  


Current Time: Thu Apr 25 06:40:24 GMT 2024

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

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

Back to the top