Supporting multiple languages in a single document

David Nolden zwabel at
Tue Jun 15 15:11:04 UTC 2010

The big question is whether we should create one TopDUContext for each
contained language, or whether we should create separate top-contexts for
the languaged.

The simpler approach would probably be to create multipe, which is guess is
what you're doing.

In general, after my porting to MovingRange is done, it will be possible for
multipe languages to highlight the same document through separate

To make code-completion etc. work, we could simply add a cursor argument to
standardContextForUrl, and pick the correct context for the cursor.

Just fixing the outline might be more complicated (probably ugly), it would
be simplest to either only show the "master" language in the outline, or to
pick the language depending on the context.

Greetings, David

Am 07.06.2010 13:22 schrieb "Milian Wolff" <mail at>:

Jonathan Schmidt-Dominé - Developer, 07.06.2010:

> Okay, that is right.
> So hints are definitely needed, but wouldn't it be still the best way to
This is what I was talking about, look also at my patches ;-)

PHP e.g. already create a single token for the stuff outside it's <?php ...
tokens. The PHP parsejob (either a designated visitor or inside one of the
existing visitors) would then create a parsejob for these tokens with the
method I added. The question is _again_: how to decide what language /
mimetype to use for the sourrounding stuff. I so far only hacked it in for
HTML since it's easy there:

<style type="text/css">

So you directly have the mimetype. Same for JavaScript.


Milian Wolff
mail at

KDevelop-devel mailing list
KDevelop-devel at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the KDevelop-devel mailing list