<div dir="ltr"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg">Hello,</div><div dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thank you for your reply!</div></div></div><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">> <span style="color:rgb(33,33,33)" class="gmail_msg">You only mentioned code completion, does that mean you are not</span></div><span style="color:rgb(33,33,33)" class="gmail_msg">> interested in working on a DUChain implementation for Go?</span><div class="gmail_msg"><font color="#212121" class="gmail_msg"><br class="gmail_msg"></font></div></div></div></div><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><font color="#212121" class="gmail_msg">I was looking at GSoC 2016 ideas page (<a href="https://community.kde.org/GSoC/2016/Ideas#Project:_KDevelop:_Go_language_integration" class="gmail_msg" target="_blank">https://community.kde.org/GSoC/2016/Ideas#Project:_KDevelop:_Go_language_integration</a>) which states that's ideally solution shouldn't use custom parser so I thought about implementing gocode support for autocompletion. In case I misunderstood the idea correct me please. </font></div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div></div><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">> <span style="color:rgb(33,33,33)" class="gmail_msg">Have you considered implementing it using LSP?</span></div>> <a href="https://github.com/sourcegraph/go-langserver" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/sourcegraph/go-langserver</a></div></div></div><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">Looks interesting. Thought it doesn't provide support for autocompletion yet it allows to integrate support for other languages using LSP.</div><div class="gmail_msg">Probably it could be implemented as library which allows building specific language plugins on top of it.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">As far as I see it's possible to create AbstractLSPLanguageSupport (name will be changed probably) class implementing ILanguageSupport by calling language server. Then, for each supported language specific plugin could be implemented which inherits AbstractLSPLanguageSupport and implements specific methods such as "StartServer", "GetConnectionUrl" + implements support to language-specific configuration (smthg like GOPATH \ go executable path, source code formatting options, etc).</div><div class="gmail_msg">So, most LSP-specific things would be handled in one library and for implementing language support it would be possible to just tweak it to specific server implementation + provide IProjectBuilder since LSP doesn't support building \ installing \ etc AFAIK.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Does it looks like a good design or there is something that I'm missing?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">In case of implementing LSP support I can change my proposal to following items:</div><div class="gmail_msg">1) Research best way of implementing LSP support.</div><div class="gmail_msg">2) Implement basic LSP support: starting server and making requests to it.</div><div class="gmail_msg">3) Implement basic Go or C# (That's languages I know and used so I have some knowledge about their environment) LSP plugin.</div><div class="gmail_msg">4) Implement support for formatting by implementing ISourceFormatter which passes calls to LSP.</div><div class="gmail_msg">5) Implement support for formatting using made in 4) source formatter with options specific to chosen language.</div><div class="gmail_msg">6) Implement 4-5 for completion and as much as possible of rest LSP capabilities.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So, developing LSP library will go in parallel with implementing a plugin which uses it so it'll be possible to actually 1) test it. 2) check design issues while implementing plugin.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">As a result, a library providing LSP support is expected and, actually, a plugin built on top of it which allows:</div><div class="gmail_msg">1) build some basic Go (or C#) project</div><div class="gmail_msg">2) use formatting, autocompletion (probably not possible in case of Go since there is no support in current server implementation), renaming of symbols.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Any suggestions are really welcome!</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">P.S.</div><div class="gmail_msg">Yep, I had some patches merged to KDevelop: <a href="https://phabricator.kde.org/diffusion/commit/query/Lmfx1Bbz5syo/" class="gmail_msg" target="_blank">https://phabricator.kde.org/diffusion/commit/query/Lmfx1Bbz5syo/</a></div><div class="gmail_msg">In case there are not enough of them I can try to start implementing support for building Go (or C#) projects by implementing IProjectBuilder as I mentioned before.</div><div class="gmail_msg">(kdev-go now doesn't support building, usage of custom build system is suggested in README.md)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Best regards,</div><div class="gmail_msg">Mikhail Ivchenko</div></div></div></div><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Tue, Mar 21, 2017 at 4:03 AM Aleix Pol <<a href="mailto:aleixpol@kde.org" class="gmail_msg" target="_blank">aleixpol@kde.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Mar 21, 2017 at 12:29 AM, Aleix Pol <<a href="mailto:aleixpol@kde.org" class="gmail_msg" target="_blank">aleixpol@kde.org</a>> wrote:<br class="gmail_msg">
> On Mon, Mar 20, 2017 at 9:43 PM, Mikhail Ivchenko <<a href="mailto:ematirov@gmail.com" class="gmail_msg" target="_blank">ematirov@gmail.com</a>> wrote:<br class="gmail_msg">
>> Hello,<br class="gmail_msg">
>><br class="gmail_msg">
>> Firstly, I want to apologize since I understand that ideally some kind of<br class="gmail_msg">
>> proposal should have been submitted before actual start of application.<br class="gmail_msg">
>><br class="gmail_msg">
>> Briefly about me:<br class="gmail_msg">
>> I'm 18 years old student from Russia who has some kind of experience in<br class="gmail_msg">
>> C++\Qt and Go. I was Google Code-In GP Winner with KDE in 2013 and 2014<br class="gmail_msg">
>> years and have some commits to KDevelop as well. Also, I mentored few tasks<br class="gmail_msg">
>> in GCI this year.<br class="gmail_msg">
>><br class="gmail_msg">
>> So, my proposal is mostly inspired by GSoC 2017 page. I had a quick research<br class="gmail_msg">
>> and come up with such ideas about Go language integration:<br class="gmail_msg">
>> 1. For support building \ project exploring:<br class="gmail_msg">
>>     - Implement IProjectBuilder in something like<br class="gmail_msg">
>> projectbuilders/golangbuilder<br class="gmail_msg">
>>     - Implement IBuildSystemManager in smtg like projectmanagers/golang<br class="gmail_msg">
>>     Main goal is to add 1) possibility to open golang projects and handle<br class="gmail_msg">
>> files of it. (Probably all files inside specific folder using<br class="gmail_msg">
>> AbstractFileManagerPlugin); 2) possibility to build \ install project and<br class="gmail_msg">
>> change such parameters as "GOPATH" and "go" executable path (for using<br class="gmail_msg">
>> different versions of Gofor example).<br class="gmail_msg">
>> 2. For source code formatting it's possible to use "go fmt" - standard tool<br class="gmail_msg">
>> for formatting. Just need to implement ISourceFormatter and pass calls to<br class="gmail_msg">
>> "go fmt".<br class="gmail_msg">
>> 3. For autocompletion support it's possible to use gocode<br class="gmail_msg">
>> (<a href="https://github.com/nsf/gocode" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/nsf/gocode</a>). It's a popular autocompletion daemon for Go<br class="gmail_msg">
>> which is used in such editors as Vim, Atom, Emacs, VS Code. This will be<br class="gmail_msg">
>> probably one of hardest features to implement.<br class="gmail_msg">
>> 4. Re semantic highlighting - as far as I know there are no real tools for<br class="gmail_msg">
>> highlighting - so I can only try to update existing Kate syntax files if<br class="gmail_msg">
>> they are outdated.<br class="gmail_msg">
>> 5. Addition but probably even more hard part could be implementing support<br class="gmail_msg">
>> for calling "gometalinter" (<a href="https://github.com/alecthomas/gometalinter" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/alecthomas/gometalinter</a>) and<br class="gmail_msg">
>> parsing \ displaying list of warnings.<br class="gmail_msg">
>><br class="gmail_msg">
>> I personally would like to go with 1-4 and try to work on 5 if I'll have<br class="gmail_msg">
>> time remaining.<br class="gmail_msg">
>><br class="gmail_msg">
>> Does it look interesting to anyone? Could someone mentor me please?<br class="gmail_msg">
>><br class="gmail_msg">
>> Best regards,<br class="gmail_msg">
>> Mikhail Ivchenko<br class="gmail_msg">
><br class="gmail_msg">
> Hi Mikhail,<br class="gmail_msg">
> That's certainly interesting.<br class="gmail_msg">
><br class="gmail_msg">
> Do you have any experience with KDevelop? It would be really<br class="gmail_msg">
> interesting to see a patch of yours (maybe fix a bug that bothers<br class="gmail_msg">
> you?). This way we get to see how you work.<br class="gmail_msg">
><br class="gmail_msg">
> You only mentioned code completion, does that mean you are not<br class="gmail_msg">
> interested in working on a DUChain implementation for Go?<br class="gmail_msg">
><br class="gmail_msg">
> Somebody worked on a go plugin some time ago:<br class="gmail_msg">
> <a href="https://github.com/KDE/kdev-go" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/KDE/kdev-go</a><br class="gmail_msg">
><br class="gmail_msg">
> Would it make sense to build on top of it?<br class="gmail_msg">
><br class="gmail_msg">
> Looking forward to your reply!<br class="gmail_msg">
> Aleix<br class="gmail_msg">
<br class="gmail_msg">
Hi Mikhail,<br class="gmail_msg">
Just another thing.<br class="gmail_msg">
Have you considered implementing it using LSP?<br class="gmail_msg">
<a href="https://github.com/sourcegraph/go-langserver" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/sourcegraph/go-langserver</a><br class="gmail_msg">
<br class="gmail_msg">
Aleix<br class="gmail_msg">
</blockquote></div></div></div></div>