Java language support

Hamish Rodda rodda at kde.org
Thu Jul 30 03:37:23 UTC 2009


On Wed, 29 Jul 2009 02:19:02 am Stefan Valouch wrote:
> Hi everyone
>
> I just succeeded in making the java language plugin from
> playground-devtools/kdevelop4-extra-plugins/java compile. Mainly, I
> corrected the code to be compiled against trunk API and silent some g++
> warnings. The patch is here:
> http://valouch.info/patches/kde/playground-devtools/0001-
> Make-the-java-plugin-compile.patch
>
> (i think the csharp plugin is in a similar shape and can be made compilable
> with similar actions)

Probably, but its duchain support isn't as complete.

> Now I'm trying to make kdevelop recognize the plugin. I've installed it,
> run kbuildsycoca4 and wiped out all kdevelop related files in my .kde dir
> as well as the complete .kdevduchain folder.
> KDevelop itself does not show which language plugins are loaded, and when i
> create a new project (.kdev4 files based on some from another non-java
> project), KDevelop does only basic syntax highlighting (means to me: file
> not parsed by a language plugin).

I tried to enable the highlighting a while back, I don't think it worked but I 
didn't have time to find out why.

> What more is required to make it work?

At the moment the biggest thing is to make it parse files in the required 
order, so that declaration <==> use relationships across files are created 
properly.  Currently, void JavaLanguageSupport::scheduleInternalSources() sets 
up parse jobs for each java source file.  However, many of these files depend 
on others being parsed beforehand (some cyclicly), so in order to resolve all 
identifiers properly, we need to take care of parsing them in the right order.

The current plan was to create and execute new parse jobs in a recursive 
fashion as needed in  void ParseJob::run(), probably in the if 
(builder.identifiersRemainUnresolved()) { bracket.

> I plan to put some time into that plugin, but first, i need to know if it
> even works.

It has most of the basics done already: reliable parser, reasonable duchain 
builder, highlighting probably only has one or two tiny bugs which prevent it 
from working.

Cheers,
Hamish




More information about the KDevelop-devel mailing list