Creating Language Plugin not used for new language

Roland Plüss roland at rptd.ch
Fri Aug 10 23:55:30 BST 2018


I'm trying to get the DUChain stuff working. I'm using the python plugin
as example. I've done now the following:
- parsed the test-source into an AST (Flex + KDevelop-PG-QT)
- created DUContext for namespaces/classes/interface to get a first
working example
- assigned the DUContext in ParseJob::run() using setDuChain()
- called highlightDUChain() after setDuChain()
- notified KDevelop using DUChain::self()->emitUpdateReady(document(),
duChain());

Nevertheless I'm seeing no syntax highlighting in the document nor does
the code browser show any namespaces, classes nor interfaces I've created.

I used the DumpChain from PythonPlugin to verify the chain I set up so
far is correct (well, except for the column output in the debug code is
off... the real values are correct):

KDevDScript: createParseJob
KDevDScript: ParseJob::run: Already up to date "/opt/testing/dragonscript/kdev_lang_dscript/tests/accept.ds"
Invalid return type in method "core"
KDevDScript: createParseJob
KDevDScript: ParseJob::run: Already up to date "/opt/testing/dragonscript/kdev_lang_dscript/tests/accept.ds"
KDevDScript: createParseJob
KDevDScript: ParseJob::run: parsing "/opt/testing/dragonscript/kdev_lang_dscript/tests/accept.ds"
KDevDScript: ParseSession::parse Successfully parsed
KDevDScript: DeclarationBuilder::build
KDevDScript: ContextBuilder::build: rebuilding duchain for "/opt/testing/dragonscript/kdev_lang_dscript/tests/accept.ds" (was built before)
KDevDScript: ContextBuilder::startVisiting
KDevDScript: ContextBuilder::visitNamespace
KDevDScript: ContextBuilder::closeNamespaceContexts 0
KDevDScript: ContextBuilder::visitNamespace
KDevDScript: ContextBuilder::closeNamespaceContexts 1
KDevDScript: ContextBuilder::visitNamespace
KDevDScript: ContextBuilder::closeNamespaceContexts 6
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitInterface
KDevDScript: ContextBuilder::visitInterface
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitClass
KDevDScript: ContextBuilder::visitInterface
KDevDScript: ContextBuilder::visitEnumeration
KDevDScript: ContextBuilder::closeNamespaceContexts 2
KDevDScript: ContextBuilder::startVisiting finished
KDevDScript: DumpChain "" New Context  "" [ (0, 0)  ->  (2147483647, 2147483647) ]   0x564d7e7d8290   top-context
KDevDScript: DumpChain "  " New Context  "Dragengine" [ (19, 26)  ->  (19, 36) ]   0x564d7e917fa0 
KDevDScript: DumpChain "  " New Context  "Dragengine" [ (19, 47)  ->  (19, 57) ]   0x564d7e8ef270 
KDevDScript: DumpChain "    " New Context  "Dragengine::Elements" [ (19, 56)  ->  (19, 64) ]   0x564d7e89c8a0 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::Front" [ (19, 64)  ->  (19, 69) ]   0x564d7ebbfc10 
KDevDScript: DumpChain "        " New Context  "Dragengine::Elements::Front::Back" [ (19, 69)  ->  (19, 73) ]   0x564d7ebbfcb0 
KDevDScript: DumpChain "          " New Context  "Dragengine::Elements::Front::Back::Both" [ (19, 87)  ->  (19, 91) ]   0x564d7ebbfd50 
KDevDScript: DumpChain "            " New Context  "Dragengine::Elements::Front::Back::Both::Last" [ (19, 95)  ->  (19, 99) ]   0x564d7ebbfdf0 
KDevDScript: DumpChain "  " New Context  "Dragengine" [ (19, 118)  ->  (19, 128) ]   0x564d7ebbfe60 
KDevDScript: DumpChain "    " New Context  "Dragengine::Elements" [ (19, 127)  ->  (19, 135) ]   0x564d7ebbff00 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::EmptyClass" [ (21, 101)  ->  (21, 103) ]   0x564d7ebbff70 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::ClassExtend" [ (21, 147)  ->  (21, 149) ]   0x564d7ebbffe0 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::ClassImplement" [ (21, 199)  ->  (21, 201) ]   0x564d7ebc0050 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::ClassExtendImplement" [ (21, 298)  ->  (21, 300) ]   0x564d7ebc00c0 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::ClassExtendImplement2" [ (21, 421)  ->  (21, 424) ]   0x564d7ebc0130 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::InterfaceEmpty" [ (21, 454)  ->  (21, 456) ]   0x564d7e94ea00 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::InterfaceExtend" [ (21, 529)  ->  (21, 531) ]   0x564d7e94ea70 
KDevDScript: DumpChain "      " New Context  "Dragengine::Elements::OuterClass" [ (21, 558)  ->  (21, 2013) ]   0x564d7e94eae0 
KDevDScript: DumpChain "        " New Context  "Dragengine::Elements::OuterClass::InnerClass" [ (21, 586)  ->  (21, 589) ]   0x564d7e94eb90 
KDevDScript: DumpChain "        " New Context  "Dragengine::Elements::OuterClass::InnerInterface" [ (21, 626)  ->  (21, 629) ]   0x564d7e94ec00 
KDevDScript: DumpChain "        " New Context  "Dragengine::Elements::OuterClass::SimpleEnum" [ (21, 658)  ->  (21, 745) ]   0x564d7e94ec70 
KDevDScript: ParseJob::run: Parsing succeeded "/opt/testing/dragonscript/kdev_lang_dscript/tests/accept.ds"
KDevDScript: Destructor
MathString literalregister count: 0, destroy count 0:
*** Finished ***

What could I be missing? Is there something special I need to do in a
language plugin to make DUChain I've created for a document to be used
by KDevelop? I've no idea where to look since I think I've done it
similar to how the python plugin is doing it.

-- 
Mit freundlichen Grüssen
Plüss Roland

Leader und Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Sowie verschiedene Blender Export-Skripts und Game-Tools

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180811/1136d118/attachment.sig>


More information about the KDevelop-devel mailing list