oleg-shilo / cs-script.npp

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

64-bit version #2

Closed Svetomech closed 7 years ago

Svetomech commented 7 years ago

Any plans on 64-bit version? I'm using Notepad++ (64-bit) and was hoping to see CSScript.Npp work.

oleg-shilo commented 7 years ago

Isn't it the moment when you truly appreciate the hosting model the other editors have? :) Sublime, Atom, VSCode they all host extensions under portable runtime (e.g. Python, Node.js).

It's a difficult one. The plugin code itself is C# so it is ultimately portable. However it integrates with N++ via x86 DLLExport layer. I remember trying once to port it to x64 but I had plenty of really strange problems and not only portability related ones. I even got an impression that x64 N++ somehow different to x86 functionality wise. Though most likely it was only an impression.

I don't have time right now to invest into this and I don't even have a x64 N++ copy for testing. I've done a very quick x64 build (attached) and you can just try it in your environment. There is a small chance that it will just work. Let me know if it indeed does.

CSScriptNpp.x64.1.7.6.1.zip

Svetomech commented 7 years ago

Yeah, their hosting model is kinda superior. But I don't want to trade that off for much better performance N++ has. Sublime comes somewhat close, but I only enjoy using it on Linux.

Okay. Here's what happens after installing the DLL you provided above: image image

oleg-shilo commented 7 years ago

Thanks, this confirms that the N++ interop (NppPluginNETBase.cs) that I inherited with the project template is x86 specific. I will keep this issue open and see if the author of the interop has updated it for x64. ... OK there is an update. Judging from this post: https://notepad-plus-plus.org/community/topic/12633/npppluginnet-64-bit. I wasn't the only one who was affected.

I will plan the upgrade.

Though I have to say that it does put an extra maintenance pressure on me. Maintaining two separate synced products on N++ plugins repository is not an easy task and most likely will require N++ support. And interacting with N++ team is ... let's say... a challenge. But not an impossible one :)

Just letting you know that I only yesterday release the first cut of VSCode extension for CS-Script. It is conceptually very similar to the plugin for Sublime but it has the Debugger!!!!!

Both Sublime and VSCode plugins for CS-Script can be a good portable alternative for Notepad++.

Svetomech commented 7 years ago

Both Sublime and VSCode plugins for CS-Script can be a good portable alternative for Notepad++.

Wait, CS-Script is available for these editors too? The main reason I went with N++ was CS-Script (:

oleg-shilo commented 7 years ago

Wait, CS-Script is available for these editors too?

Yes it is available. :) Though VSCode plugin is just a "baby" (a couple days old). But it has the highest potential out of all.

After developing for three of those popular editors I have now pretty good understanding of their strengths and weaknesses. As well as their potential for CS-Script:

Svetomech commented 7 years ago

Excellent dev language - TypeScript

Yeah, I fancy TS too.

Now that I think of it, does one even need CS-Script for VSCode? AFAIK it has excellent C# support and developer experience. Am I wrong? I mean, what would the advantages of using CS-Script for VSCode be?

Thank you for sharing your experience!

oleg-shilo commented 7 years ago

Currently VSCode story for C# has very strong objective to serve .NET Core. And this imposes so many limitations preventing it from being a phenomenal tool for a desktop/server app development. VSCode C# fancies only ASP.NET Core (at least currently). Thus you cannot benefit from the richness of neither .NET nor Mono:

And CS-Script fills the gap. It lets full scale desktop CLR back into the game. The extension itself is very lean. It just binds Mono Debugger, OmniSharp and CS-Script together. And CS-Script plays role of runtime host (launcher) and a project manager. That's it. Everything else is just standard VSCode functionality. With the help of CS-Script extension it is now possible for VSCode to:

And all this on top of the all rich functionality that is available with OmniSharp and MonoDebug.

Svetomech commented 7 years ago

Thanks for the info. I missed these features you listed when I last used VSCode. I'll be sure to check out CS-Script for VSCode the next time I install it.

Btw, I don't have anything against .NET Core. It's cool, and can also be used to write any kind of server-side applications, not only web apps.

Also, VSCode is pretty great for TypeScript. Are you developing your plugin for VSCode in VSCode? (:

oleg-shilo commented 7 years ago

Btw, I don't have anything against .NET Core.

Me neither. I am a big supporter the .NET Core move. Particularly with .NET Standard spec.

It's just for some cases Mono/.NET it is still a better choice. One obvious approach would be for VSCode to allow to fall back to Mono/.NET but they decided to not to. And this is exactly what I see as a problem. CS-Script.VSCode is just happens to be a suitable solution to this problem but it also can be other C# hosting solution. When VSCode either adds native Mono/.NET support or .NET Core reaches true maturity there will be no need for any extension like that.

While all CS-Script plugins have symbiotic relationship with their hosting editors/IDEs, CS-Script's primary objective is to bring Python user experience for C# syntax. Not to enhance editors. Thus I actually see no problem with an editor/IDE not gaining anything from CS-Script.

Are you developing your plugin for VSCode in VSCode?

Of course. I wouldn't do it any other way. :)

Svetomech commented 7 years ago

Screw N++, I'm going with VSCode and your extension :D

Seriously though, can't wait for .NET Core to mature enough to be on par with Mono in terms of features. But til that day comes, I'm using the latter. Especially since the most recent version (5.0) was a really great step forwards. I mean, finally abandoning XBuild in favor of MSBuild (and Roslyn)? Best thing ever.

Python user experience for C#

Never really tried that side of CS-Script. But looking at some screenshots now, I love the ability to pass console arguments by just writing a comment. I guess I'm outta check CS-Script custom syntax.

oleg-shilo commented 7 years ago

:) :) :)

I am with you on this one.

Especially since the most recent version (5.0) was a really great step forwards.

I have a quick look and found that the latest mono actually supports C# 7. Though it needs to be activated in some special way and by default it generates pdb not mdb so I will need to convert one into another on fly. Otherwise MonoDebug will not understand the symbols. But all doable.

I am overdue with some of cs-script.vscode doco but as a good substitution you can go to cs-script.sublime wiki: https://github.com/oleg-shilo/cs-script-sublime/wiki.

After all the objective is to make cs-script.vscode to do what cs-script.sublime does but to have a superior OmniSharp (Intellisense) and the mono Debugger!!!!

That wiki is actually quite informative but for complete doco go https://github.com/oleg-shilo/cs-script/wiki.

And for super light syntax reminder:

cscs.exe syntax

and CLI commands

cscs.exe cmd
Svetomech commented 7 years ago

Hmm, I skimmed through the wiki, and it looks really promising. But one detail in particular caught my attention. Is Chocolatey the official way to install CS-Script on Windows now? I thought it came bundled w/ appropriate plugin installers.

oleg-shilo commented 7 years ago

The script engine itself is a single file - cscs.exe (or window app version csws.exe). Thus it is just too easy to get it bundled with the products that use it. And this is what I typically do

However the whole CS-Script suite comes with plenty of other stuff:

And for that Chocolatey is a better fit as deployment technology.

Svetomech commented 7 years ago

I see, thanks.

Should the issue be closed?

oleg-shilo commented 7 years ago

Yeah, let's close it for now. But if anyone is also interested it can be reopened. I am not sure when and if I'll get time to look at N++ x64 porting but at least then we can set it's status to help wanted.