<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 10, 2014 at 12:55 PM, Milian Wolff <span dir="ltr"><<a href="mailto:mail@milianw.de" target="_blank">mail@milianw.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sunday 10 August 2014 12:01:24 Pavel Petrushkov wrote:<br>
> Hello KDev developers!<br>
<br>
Hello,<br>
<br>
this sounds awesome!<br>
<div><br>
> For the past few weeks I've been working on Go language support for<br>
> KDevelop and I think it is time I share my work with everyone. So, here -<br>
> <a href="https://github.com/OneHundRedOf/kdev-go" target="_blank">https://github.com/OneHundRedOf/kdev-go</a>  is all that I have right now. I<br>
> have written a parser with KDevelop-PG-Qt, simple Declaration and Uses<br>
> Builders which currently support only part of all language features and<br>
> basic code completion support. Of course it's a long way to go to be<br>
> complete, but I've covered the basics like variable and function<br>
> declarations, type deduction with ExpressionVisitor and type members,<br>
> methods and imports code completion. Testing plugin with Go standart<br>
> library shows that it 'mostly works' right now and even can be useful<br>
> sometimes.<br>
<br>
</div>Did you hear about the KTextEditor based Go code completion plugin:<br>
<a href="https://bitbucket.org/lucashnegri/kgocode" target="_blank">https://bitbucket.org/lucashnegri/kgocode</a><br>
<br>
Generally, while I appreciate the work you did, our experience is that it is a<br>
tremendous amount of work to write, _and maintain_ a proper language plugin.<br>
The more you can use other libraries to do the work for you, the better. Esp.<br>
if you have to write the parser yourself, this will break sooner or later.<br>
Because of this reason, we are now working on a clang-based plugin for our C++<br>
language support. Is there really no Go library available that gives you at<br>
least the AST or something like that? Better yet, something like Clang gives<br>
you with types etc. already resolved.<br>
<br>
If not, then at least using gcode for code completion (or well, the plugin<br>
mentioned above) would be good instead of reinventing the wheel there. </blockquote><br></div><div class="gmail_quote">Originally I started this project just for fun and to learn about parsers and grammars, so I didn't think about using third party libraries. But now that I want to actually build a complete plugin I will definitely look into alternatives and see if I can use them. <br>
</div><div class="gmail_quote"> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
> I was wondering if someone here would like to review my code and give me<br>
> some feedback. I'm not an experienced KDE or KDevelop developer so any<br>
> constructive criticism and suggestions are welcome. Maybe somebody would<br>
> even join me in developing this plugin. Also if you think my code is ok,<br>
> maybe we should open a project on <a href="http://projects.kde.org" target="_blank">projects.kde.org</a>? I have no idea about<br>
> the quality of accepted projects though, so that's for you to decide.<br>
<br>
</div>I only had a very quick look at it, but over all it looks quite nice already.<br>
Quite a feat, considering the complexity of our language support API (which is<br>
sub-par, esp. on the documentation side ;-)). Your project is more than<br>
welcome on <a href="http://projects.kde.org" target="_blank">projects.kde.org</a>, the first step would be to get a developer<br>
account (you can put me in as a reference), then we can import the project to<br>
playground.<br></blockquote><div><br></div><div>Great! I will probably first look for parser alternatives as you suggested and wait a few days, so more people can give their opinions about this plugin.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br>
> Currently most important issues with my plugin are lack of tests and<br>
> documentation, but I will start working on that soon. Also I guess I will<br>
> need frameworks port, I'm hoping to get some help here on that.<br>
<br>
</div>Tests are crucial for a language support plugin. Really, I can't stress this<br>
enough. Esp. if you are writing it from scratch with parser and everything,<br>
you'll have to write tons of tests to ensure you are not breaking something<br>
further down the road. You'll save yourself a huge amount of pain and time if<br>
you develop a language support in a tests-driven style. I.e. whenever you<br>
notice something is not working, write a test for it, then make it pass.<br>
<div><br>
> A little bit more info about the plugin is available on github page, if you<br>
> want to try it out, don't forget to set $GOPATH environment variable for<br>
> your project.<br>
<br>
</div>Whats the GOPATH env var required for? Include paths or something like that?<br>
You could hook in to the IncludesAndDefinesManager in kdevelop and let the<br>
user define that from inside the UI.<br>
<br></blockquote><div><br></div><div>Yes, Go searches for packages in directories mentioned in GOPATH. I'll try to use IncludesAndDefinesManager as soon as I have more time.<br><br></div><div>Thanks,<br></div><div>Pavel<br>
</div><div><br></div></div></div></div>