oleg-shilo / cs-script.npp

CS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
MIT License
246 stars 52 forks source link

[Question] Adapting the plugin to other programming languages #39

Closed pidgeon777 closed 7 months ago

pidgeon777 commented 5 years ago

It seems your plugin really improves Notepad++ a lot, for example by adding a true Intellisense feature.

I would like to ask if your plugin, with the proper work, could be adapted to support other programming languages. For example, C, C++, or even VHDL.

Great work, though.

oleg-shilo commented 5 years ago

Thanks, I am glad you like the plugin.

could be adapted to support other programming languages.

Hm, the accurate answer is "yes" but it may be challenging.

The plugin is using a simple integration model where intellisense request (along with the language id) is sent to the external process which returns a list of suggested completion words. This process is syntaxer.exe. Currently it supports two languages: C# and VB.NET. Both intellisense implementations based on Roslyn engine. If one can come up with a similar solution for C++ or any other language then integrating it with syntaxer.exe (or an alternative "_cppsyntaxer.exe") would be a very simple task.

But... I am not sure developing an intellisense engine for C/C++ is easy.

pidgeon777 commented 5 years ago

Thanks for the reply. My next question would be, is syntaxer.exe acting as a Language Server Protocol system?

https://langserver.org/

From the page I reported above:

The Language Server protocol is used between a tool (the client) and a language smartness provider (the server) to integrate features like auto complete, go to definition, find all references and alike into the tool

oleg-shilo commented 5 years ago

Yes it is acting as LSP system, even though it does not use the same protocol.

Notepad++ Intellisense support was implemented before and independently from any C# LSP solution (e.g. OmniSharp). Thus it is using an alternative custom protocol. Though today I would use LSP as it is fully consistent with Syntaxer protocol.

Syntaxer protocol is quite simple and can easily be extended to either expose itself as LSP or rout requests to the external LSP server (e.g. C++). I am happy to make the required adjustments if indeed there is a demand.

Your post has prompted me to do something that is well overdue :) Syntaxer documentation.

Well I haven't finished it yet but the complete round trip "Get Completion" use case is already fully documented: https://github.com/oleg-shilo/syntaxer/wiki