vscode-csharp
vscode-csharp copied to clipboard
No intellisense available for razor
From @Felsig on April 8, 2016 23:51
- VSCode Version: 0.10.11 (0.10.11)
- OS Version: OSX El Capitan 10.11.2
Specifically when writing code like @Model.Id or the similar I get no sort of intellisense. I assumed that would be a feature as the website states support for Razor. Is this just not a feature?
Copied from original issue: Microsoft/vscode#5113
Unfortunately, there is no way to get IntelliSense for Razor in VS Code through OmniSharp today. The Razor parser does not run as it does in Visual Studio. We will look at this in the future though.
Thanks!
Is there anyway to help out with this? Personally this is my number 1 issue with using VS Code for aspnet core development -- since refactoring/usage/etc is no longer safe because usages within cshtml aren't seen -- and cshtml views aren't even compiled on build (not sure if there is a way to make that happen with the new core stuff like there used to be).
@david-driscoll was looking at it awhile back over in https://github.com/OmniSharp/omnisharp-roslyn. Maybe drop by Slack and chat about it?
@DustinCampbell Thanks -- I'll hop over there an find out.
Have the same Issues (but from Ubuntu) really missing that Razor Intellisense, it'd really make all the difference in the world.
Will i be able to spot progress on this feature here?
Agree. Now that we have tabs, razor-intellisense is the "one big thing" missing from VS Code for asp.net core devs.
We'll be adding support to OmniSharp eventually to support Razor, sadly I don't have a specific timeline. This is mainly because it's not a very easy problem to solve, but it is something we want to get working.
Some updates? I also really miss it.
I need it also
To be clear, this is a fairly big work item. It is currently in our "future" milestone because we don't yet have a good sense of when it will happen..
@DustinCampbell is there a design/approach in mind for this? It would be great if there was a rough outline of the work that needed to be done and some general guidelines for an approach. This is something I would love to see happen and would also help make it so, but I'm honestly not sure where to even get started (I've only barely started touching OmniSharp and I haven't found any real documentation/overview docs for it). If this was something that could be put together, I would hope others in the community would try to step up and help (I would with whatever time I could find).
I have a branch that was the bare minimum to wire in the "basic" Razor runtime. It's available https://github.com/OmniSharp/omnisharp-roslyn/tree/razorhost.
When I say bare minimum, basically I was able to get diagnostics returned from the Razor host, and there were a lot of them because we I hadn't wired in any of the references (including things like mscorelib, lol).
We have yet to be determined if that is the best way to do it, but we're working on it.
The work that needs to be done is basically
- Determine the best way to wire the Razor project into an "Mvc" assembly.
- Basically my thought was, just look for any projects that have a reference to
Microsoft.AspNetCore.Mvc.Razorwhich they would then get a new "sister"/"sibling" project that understands the Razor syntax. - We then keep this projects references in sync with the references of the related project. With that in theory any type will be reachable by both projects, so compiling Razor should be a little better.
- Basically my thought was, just look for any projects that have a reference to
- Figure out how to detect tag helpers
- Wire in tag helpers (hopefully)
- Build out services that understand razor
- Diagnostics (partially done already)
- Autocomplete / Intellisense
- Highlighting
- Tag Helpers
- Syntax Tokens
There are other challenges on the VSCode / Atom side, with properly merging the C# / HTML syntax, so that they show the correct context at all times. This, I believe, is where a lot of the big work comes in because it involves work into VSCode itself.
My hope is this week to triage some bugs with the Atom plugin (I've not had much time lately!), and then dig into Razor support, and try to tie it into the DotNet Project System, which while is on it's way out, will be a valid proof of concept.
@david-driscoll
I believe, is where a lot of the big work comes in because it involves work into VSCode itself.
This is correct and now that we have extracted the HTML support into its own language server, we will start in October with the nested languages support. We will start with CSS Intellisense, which comes from the CSS language server, inside HTML.
What is the status of this?:)
Once again, any status update?
There is no movement on this at the moment. To be honest, this isn't at the top of the priority list as I'm mostly working on getting support for .NET Core .csproj projects finalized.
Okay, just the only thing that is stopping me using vscode only atm. As For .net core 1.0 apps no razor compilation so I can't get intellisense and cannot get and view errors until runtime. So I'm falling back to vs2015 all the time just for razor. If I get free time I might play with the branch list above^. Thanks
Any help would be welcome! :smile:
In the meantime, there is an extension for vscode that implements intellisense for the Model object at least :)
https://marketplace.visualstudio.com/items?itemName=schneiderpat.aspnet-helper
any plans for this?
I'm waiting for this feature too. It should also be possible to debug and refactor razor template files like we can do in visual studio.
I think even being able to format markup properly will be a huge bonus. Since now markup formatting isn't working and it's really annoying to format html tags by hands.
please, I want this.
I'm going to jump on this bandwagon. As a front end developer, Visual Studio is gross. It's a horror to write JS/CSS/HTML in, but I'm have little choice but to use it for templating. I want to stop juggling between VS for C#/Razor and Atom for everything else.
Sometimes I need 4 separate solutions open at the same time. VS cries when I try to do this. As such, being able to fully use Razor inside VS Code would be phenomenal.
leave razor we gonna use some js framework< no I wont
+1 I need this...
almost one year and half past... I am doubting this feature was buried deeply in vscode backlog tomb.
To my point of view it's an important feature. Good cshtml support is the only reason why I still use visual studio 2017 instead of vscode.