oleg-shilo / cs-script.npp

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

Interesting project but could there be more examples #42

Closed mwpowellhtx closed 4 years ago

mwpowellhtx commented 4 years ago

Cannot seem to be able to add assembly references, particularly for Npp automation features.

Chiefly I'm interested to do something basic to start with, like insert a time stamp.

I can do it in PythonScript notwithstanding the x86 x64 installer confusion, but I'd like to get my feet wet doing this with CS Script.

Also, the Intellisense and/or auto-completion does not seem to pick up on these things. I see no options after obvious namespaces are entered. Does not add to the references, etc.

Thanks!

mwpowellhtx commented 4 years ago

Just want to make sure this is not me as it were. Using the latest x64 Npp 7.7.1 I think, if that helps at all. i.e. maybe there is an Npp breaking change or something that I am experiencing in this plugin.

oleg-shilo commented 4 years ago

Not sure I fully understand the nature of the problem.

Adding assembly references in CS-SCript is simple - just add //css_ref <assembly>. Examples are kind of a low value as CS-Script works with "plain vanilla" C# so all existing C# samples are applicable.

Something tells me that you are trying to do something more specific than adding references...

mwpowellhtx commented 4 years ago

Directives not found, for starters. This seems like it would be a helpful page.

mwpowellhtx commented 4 years ago

@oleg-shilo Thanks for the response. Mainly, I'm looking for the way in which we would engage with the Npp environment? I assume this is the NppAutomation? However, the reference cannot be found or is not being added.

oleg-shilo commented 4 years ago

Directives not found, for starters

The link you provided is currently invalid as the content hosting has moved to GitHub completely. Please let me know where you found this obsolete link and I will correct it. I thought I did it but it looks like "I missed the spot".

Anyway the best (light) documentation can be found here https://github.com/oleg-shilo/cs-script/wiki/Standalone-Script-Execution#quick-guide-of-cs-script-directives

And the full legacy documentation content can be found here: https://www.cs-script.net/cs-script/help-legacy/root/

I'm looking for the way in which we would engage with the Npp environment?

OK, then you need to use another extension 'Automation Scripts'. You need to install it so the automation runtime is initialized and hosted Npp. And CS-Script.Npp extension can be used to edit the automation scripts. Thus:

The only problem is that scripts.npp has at this very moment is only available for x86 version of Npp. And porting it to x64 is currently in progress: https://github.com/oleg-shilo/scripts.npp/issues/2.

Another point is that due to the recent changes in Npp the scripts.npp extension is no longer available via plugin manager and needs to be installed manually.

mwpowellhtx commented 4 years ago

@oleg-shilo Re: Directives, I'm just reviewing through the wiki pages, etc. If that's an absolute URL, perhaps embed it as a relative one, if that makes sense to do so. That would be my suggestion. Will follow on after I scan over and digest the rest of your response, thank you BTW.

mwpowellhtx commented 4 years ago

@oleg-shilo I see, x86 only at the moment. I think that actually is a kerfuffle for more than one plugin, even still today, unfortunately. I see. I will reinstall with x86.

I did notice that those plugins were no longer available. Is there a time frame and/or is it possible, presumably due to Npp breaking changes, when that could be reintroduced?

Appreciate the feedback. Cheers.

mwpowellhtx commented 4 years ago

@oleg-shilo Oh yes, one more thing closing out the thought... I should think that a getting started snippet, perhaps capturing these bits themselves, is very helpful. Bottom line, most folks adopting any sort of scripting capability enhancing their Npp experience want to do just that. Anything short of that is fairly meaningless.

mwpowellhtx commented 4 years ago

@oleg-shilo Reviewing scripts.npp (?), I'm not sure that it is stitched together for delivery? There are no releases tagged? No binaries or other packages I could download and give it a try? At least that's where it stands at the moment. Or have I missed something?

Nice, re: the .NET Core migration path, BTW. Is that building on a netstandard2.0? Culminating in a netcore2.1 binary i.e. script?

oleg-shilo commented 4 years ago

"CS-Script - C # Intellisense" (cs-script.npp) is already available for both x86 and x64. I can be installed via Npp "Pluins Admin":

image

"Automation Scripts" (scripts.npp) only exists as x86 and it is not available via Npp "Pluins Admin". Yes, due to the Npp breaking changes in the hosting model.

As for time frame, I have started porting ~month ago and quickly achieved ~80% completion. Then had to put it on hold due to the competing work/life priorities. I have only ~1week work left there. And hope to resume development next week.

I should think that a getting started snippet, perhaps capturing these bits themselves, is very helpful.

Indeed. "Automation Scripts" plugin comes with the library of various samples directly available in Npp. vial plugin's samples browser. The plugin also provides "Create Script" workflow that creates a basic script ready for execution and further customization.

oleg-shilo commented 4 years ago

binaries or other packages I could download and give it a try? At least that's where it stands at the moment. Or have I missed something?

I am afraid not. The original plugin hosting site (CodePlex) R.I.P. And because there were no updates since then binaries exist only in CodePlex archive and PluginManager repository (which is no longer supported by Npp).

I can have a look and find the binaries on my old PC but would rather try to resume working on the new release. Thus if within a few days (up to 2 weeks) I do net publish a new release of the plugin then it means I have drowned in other priorities :)

keep in mind, I am referring to the https://github.com/oleg-shilo/scripts.npp all the time. Not this very GitHub project. This one is all good.

mwpowellhtx commented 4 years ago

I appreciate the response. I was able to get something quite satisfactory working via LuaScripts in the meanwhile. Still, this looks interesting, and I might like to check it out once it has been properly stitched together. Cheers.

oleg-shilo commented 4 years ago

Glad to say, the porting of the solution is done. I am in process of porting the samples now.

oleg-shilo commented 4 years ago

Done, https://github.com/oleg-shilo/scripts.npp/releases/tag/v2.0.0.0-beta