<div class="gmail_quote">On Tue, Feb 2, 2010 at 10:35 PM, Niko Sams <span dir="ltr"><<a href="mailto:niko.sams@gmail.com">niko.sams@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue, Feb 2, 2010 at 17:45, Fabian Schmitthenner<br>
<<a href="mailto:fabian1024@googlemail.com">fabian1024@googlemail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I tried to create a simple language plugin to test and try to learn how this<br>
> works in KDevelop 4. What I did is roughly the following:<br>
><br>
> - extending my own class from ILanguageSupport and IPlugin, and making it<br>
> accessible through KDevelop due to a .desktop-file.<br>
> - add a class which extends from ParseJob and which is constructed in the<br>
> createParseJob-method.<br>
><br>
> So far, so good. After a bit of experimenting, the language is now loaded in<br>
> KDevelop, when I load the first file with my extension. Then, a parse job is<br>
> created and the run method is called.<br>
> But when I open the same file a second time, or when I simply change the file by<br>
> editing it, nothing happens (so neither a parse job is created nor the run<br>
> method is called).<br>
</div>Hmm... No idea what's wrong here.<br>
<div class="im"><br>
> Also, after having opened a file, which was alredy loaded in a previous<br>
> instance of KDevelop, no parse job is created, and the file cannot be edited<br>
> (it seems to be read-only).<br>
</div>read only? that's really strange. kdevelop can't do that.<br>
<div class="im"><br></div></blockquote><div>Maybe the view you see here is a PartDocument instead of a TextDocument.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">
> So, my question is, what do I do wrong? Do I have to say anything to the<br>
> DuChain or an other instance, when I parse the file; and this parsing required<br>
> for other things like code completion? I always thought, the DuCHain is "only"<br>
> for serializing definitions and uses; so it wouldn't be a must-have ??<br>
</div>Codecompletion is duchain independet. Basically it's KTextEditor only,<br>
just the way<br>
how the CodeCompletionModel is registered to kate is kdevelop specific.<br>
<br>
When parsing the file you most probably want a TopDuContext where you can add<br>
problems (eg. parse errors) and an ParsingEnvironmentFile to track if<br>
the file was modified.<br>
The css (you looked at already) does have a very simple implementation<br>
of all this.<br>
<div class="im"><br>
> Second question: How can I enable code completion? I tried to extend a class<br>
> from KTextEditor::CodeCompletionModel2, and construct an instance of<br>
> KDevelop::CodeCompletion in the constructor of my language support, as I saw<br>
> it in the Css-language-plugin. But the<br>
> CodeCompletionModel2::completionInvoked-method is also never called.<br>
</div>hmm.. add some debug output in KDevelop::CodeCompletion, to check if the model<br>
is registered to the view.<br>
<div class="im"><br>
> Also, is there any good documentation about this stuff, because I didn't really<br>
> find anything useful.<br>
</div>Unfortunately there is only a bit of api docs avaliable. But that's<br>
still better than nothing.<br>
<font color="#888888"><br>
<br>
Niko<br>
</font><div><div></div><div class="h5"><br>
--<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</div></div></blockquote></div><br>