oleg-shilo / cs-script-sublime

Sublime Text 3 plugin for CS-Script
MIT License
9 stars 1 forks source link

[Visual Studio extension] support for .csx #6

Open benblo opened 4 years ago

benblo commented 4 years ago

Apologies for posting this in the Sublime repo, but I couldn't find your repo for the "CS-Script Tools" VS extension. So I'm using .csx extension, because of the ease of just double-clicking in explorer, and right-clicking for more, eg edit/debug in VS when Sublime doesn't cut it. (I spend the rest of my non-script life in C# as well so having that context menu for regular .cs files is kind of awkward.)

2 issues:

Alternatively... could it be possible to use a sub-extension, like myscript.x.cs ? Double-clicking the file in the explorer probably wouldn't be able to differentiate past the last extension, but I think the context menu thing is from another project of yours, would that work?

oleg-shilo commented 4 years ago

Sorry for the delayed response.

While the extension can be reworked to handle csx. It is a bit challenging for various practical reasons though possible. However I would encourage you to use different approach not based on VS extension.

Right-click editing:

image

shell-x.zip

I have attached the configuration files for x-shell handlers of *.csx extension.

Double-click execute

A simple registry key will do the trick:

HKEY_CLASSES_ROOT\.csx\shell\Run\command\(Default):cscs.exe "%1"

The n you can have execute as the extension is compiled for older I can have a look have

benblo commented 4 years ago

Hey, so I already have all that installed & setup, sorry if I wasn't clear.

My problem is, once I've opened the .csx file in the CS-Script-generated solution, Intellisense support is not as good as for a regular .cs file. As I've mentioned, I'm unsure if the problem is with VS's Intellisense or Resharper's Intellisense, as R# bypasses/disables a lot of the builtin VS features.

So my alternative question was, instead of using the .csx extension, could I use for example a .x.cs extension? This way all the regular tools would see it as a proper .cs extension, and it's "only" a matter of hooking up Explorer support (right-click and double-click) for .x.cs.

oleg-shilo commented 4 years ago

NP. The Intellisense is fully provided by VS as well as syntax highlight. Thus there is nothing that CS-Script extension can do about it.

BTW Resharper is a well known for is nasty manners when it comes respecting the original user experience of the hosting environment (VS).

As for .x.cs then of course you can use it. CS-Script is completely neutral to the file extensions. And "hooking up explorer support" can be easily done with shell-x and registry key for double-click.