Comments (10)
I would like to bump this and 👍 this.
There is CSX support already in OmniSharp (via scriptcs) and Atom uses it, and you can "fake-force" it in VS Code by adding an empty project.json
next to your CSX. You will get CSX intellisense, including cross-CSX file navigation and it will respect #r
directives and even recognize scriptcs-style NuGet references (by convention).
That said, this whole experience should be normalized (after all, scriptcs is a bit opinionated about some things). As I mentioned in a call a while ago I'd like to see "basic" CSX support as first class citizen in OmniSharp and then scriptcs (with its custom host and what have you), being the superset of regular CSX, could be an opt in plugin.
I have lots of PoCs going on including one that I am working on right now so hopefully we can bring this in soonest.
@DustinCampbell - hopefully it makes sense? we can even start small, single file only and grow from there
from vscode-csharp.
I've installed the 'csharp' extension for Visual Studio Code. It would be neat if it fully supported .csx files from C# Interactive csi.exe
. Syntax highlighting works fine, but there's no autocomplete or debugging.
ext install csharp
from vscode-csharp.
Here's a feature request for .csx C# script support in Visual Studio https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/7848117-add-scriptcs-csx-intellisense-and-debugging-in-v
You can run .csx scripts with C# Interactive (csi.exe). It would be neat if you could debug them in Visual Studio.
from vscode-csharp.
I think this can be closed now that OmniSharp/omnisharp-roslyn#659 has been merged.
There are still some issues and ongoing work (see https://github.com/OmniSharp/omnisharp-roslyn/issues?q=is%3Aissue+is%3Aopen+csx+label%3Acsx) but those can be tracked separately in the omnisharp-roslyn repo.
from vscode-csharp.
Yeah, I agree. The latest beta should be much better.
from vscode-csharp.
There is CSX support already in OmniSharp (via scriptcs) and Atom uses it, and you can "fake-force" it in VS Code by adding an empty project.json next to your CSX. You will get CSX intellisense, including cross-CSX file navigation and it will respect #r directives and even recognize scriptcs-style NuGet references (by convention).
I know I'm lazily posting on a closed issue, but I can't for the life of me find details on this convention. Can someone point me to this reference material or share it here for posterity's sake?
from vscode-csharp.
@peder Since last year OmniSharp has no support for scriptcs-style scripting (i.e. nuget packages via packages.config
). Instead, we only support standard CSI.exe scripting. This is the official script runner that is built as part of the Roslyn repo and ships with MSBuild tools.
At the moment the only supported way to provide references to external assemblies in CSI is to use #r
references, and that is what OmniSharp supports.
Aside from CSI, OmniSharp also supports Azure-Functions like references via project.json
(have a look at the .NET Core script runner here https://github.com/filipw/dotnet-script) and soon it will support #r "nuget package"
references (PR here - OmniSharp/omnisharp-roslyn#813).
I hope this helps - and apologies for the confusion. Updating the documentation to put all of this information together is on my list 📚
from vscode-csharp.
Awesome update--thanks. I was giving C# Scripting a whirl last night and started hitting some walls. Despite those issues, I have to think the *.csx
is bound to grow, especially when/if Node.js developers dabble in .NET.
I'll check out the Azure Functions approach. Thanks again.
from vscode-csharp.
I think the confusion comes from the fact that - due to the popularity of scriptcs project - folks equate C# scripting / CSX with what scriptcs offers.
In reality, scriptcs is a de facto dialect on top of standard CSX scripting and offers some extra features over CSI.exe (it's a superset of standard scripting), mainly packages.config
integration and custom #
directives. This was partially supported in OmniSharp a while ago, but due to various problems, it was removed. What we decided to have in OmniSharp instead, was full support for standard Roslyn (CSI) scripting, and to do it well.
So if you stick to CSI-only scripting, you will have excellent language support in OmniSharp - on par with "full" C# - refactoring, go to definition, go to metadata, find references, intellisense and so on.
from vscode-csharp.
It's unfortunate there's confusion between scriptcs and csi.exe "C# Interactive". Ideally both would clarify the difference in their documentation:
from vscode-csharp.
Related Issues (20)
- Auto doc comment generation and other formatOnType features broken HOT 9
- Request textDocument/foo failed HOT 10
- Creating a new class under a folder in Solution Explorer does not give the class correct namespace HOT 2
- Iteration Plan for June 2024
- Please default to P2P reference HOT 1
- Standardize UI Navigation with `workbench.action.navigate` HOT 1
- test HOT 1
- If your .NET version is too old, you get no intellisense and an unhelpful error. HOT 1
- Project system ran into an unexcepted error HOT 1
- Various missing features in RazorPages in 2.31.19 HOT 1
- LSP server fails to initialize with: "Failed to find all versions of .NET Core MSBuild. Call to hostfxr_resolve_sdk2." HOT 1
- [MacOS] Unable to display source file when debugging .net dll compiled on Windows with portable pdb format and published as nuget HOT 4
- Debugger UX should show stack for current thread instead of a treeview with all threads HOT 1
- XML documentation (doc comment) creation is no longer working HOT 1
- vscode-maui.android.autosdk.configure HOT 1
- vscode-maui.android.autosdk.configure HOT 1
- Issue loading csproj projects if it includes linked files HOT 1
- Some code fixers failing on v2.33.17 HOT 1
- IntelliSense and code analysis broken with 2.33.17 HOT 4
- Many Errors in Dev console
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-csharp.