Supporting multiple languages in a single document

Nicolás Alvarez nicolas.alvarez at
Tue Jun 15 15:47:46 UTC 2010

On 6/15/10, David Nolden <zwabel at> wrote:
> 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
> top-contexts.
> 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.

Does having separate TopDUContexts imply you can't have duchain stuff
that crosses languages? (I have little clue about duchain internals)

I think someone may reasonably want to share declarations across
languages. For example, document.getElementById("foo") could be a use
of <div id="foo">. Similarly, document.getElementById(<Ctrl-Space>
could list elements in the container HTML document.


More information about the KDevelop-devel mailing list