Supporting multiple languages in a single document
David Nolden
zwabel at googlemail.com
Thu Jun 17 14:46:44 UTC 2010
Yes, that code looks good, it could work like that. Although maybe it
would be more "logical" to add the API to ParseJob, and do something
like:
backgroundParser->createParseJob(file,
language)->buildEmbeddedContext(parentContext, range).
We shouldn't add an additional member to DUContext for this, because a
DUContext is created for every single function-declaration, and we
cannot blow up the duchain like that.
However you can consider either subclass DUContext by a new
"LanguageDUContext" (which TopDUContext could be based on), or you
could add "Language Declarations" into the context to make clear the
language. Such language declarations could then also be searched
through findDeclarations directly, which might help with your
searching problem.
Greetings, David
More information about the KDevelop-devel
mailing list