Supporting multiple languages in a single document

Milian Wolff mail at milianw.de
Mon Jun 7 09:56:32 UTC 2010


Ruan Strydom, 07.06.2010:
> Hi Milian,
> 
> I am just throwing this out there, not sure how everything stitches
> together, plus I have a very simple understanding of the DUChain...  I am
> not sure, if you are using mime types to separate the languages (if not
> then ignore this), but the xml/sgml plug-in uses several different mime's.
> So does Cpp now that I think of it... ;)

Yep, we use the mimetype.

> Would it not be possible to group languages by there names ie: Sgml, Php or
> Css?
> 
> TopDUContext * top = DUChain::self()->chainForDocument(url, language);
> 
> And when creating a top context for the same URL create a SubDocument for
> the language.

Yeah, something like this I thought as well. If there is already a topcontext 
with the given languagesupport plugin in a document, reuse that, just create 
another context or similar - depending if it's required.

Anyhow, the current limitation is _afaik_:

No support for "split" documents. Esp. considering on what contextForCursor 
should return or similar, we should think about adding something like that. I 
mean, language ranges don't have to overlap, and it might be nice if they 
wouldn't.

> ps: I wanted to send this to the list, but then thought: 'this may be a
> very stupid question', so if this has some value/weight feel free to reply
> to the list.

No, not stupid. The DUChain is complex and I think I finally know a few things 
here and there, but this is definitely not the level of everyone. Hence 
relocating to the list again.

> On Sunday 06 June 2010 18:03:25 Milian Wolff wrote:
> > On Sunday 06 June 2010 17:59:58 Milian Wolff wrote:
> > 
> > here the patches if anyone is interested in my current approach


-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100607/e86ef973/attachment.sig>


More information about the KDevelop-devel mailing list