Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No intellisense available for razor #168

Open
egamma opened this issue Apr 11, 2016 · 104 comments
Open

No intellisense available for razor #168

egamma opened this issue Apr 11, 2016 · 104 comments

Comments

@egamma
Copy link
Contributor

@egamma egamma commented Apr 11, 2016

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

@DustinCampbell
Copy link
Contributor

@DustinCampbell DustinCampbell commented Apr 11, 2016

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.

@DustinCampbell DustinCampbell added this to the future milestone Apr 11, 2016
@adamhilton
Copy link

@adamhilton adamhilton commented Apr 12, 2016

Thanks!

@eamodio
Copy link
Contributor

@eamodio eamodio commented Jun 7, 2016

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).

@DustinCampbell
Copy link
Contributor

@DustinCampbell DustinCampbell commented Jun 7, 2016

@david-driscoll was looking at it awhile back over in https://github.com/OmniSharp/omnisharp-roslyn. Maybe drop by Slack and chat about it?

@eamodio
Copy link
Contributor

@eamodio eamodio commented Jun 7, 2016

@DustinCampbell Thanks -- I'll hop over there an find out.

@rasmus91
Copy link

@rasmus91 rasmus91 commented Jun 14, 2016

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?

@eimik
Copy link

@eimik eimik commented Jul 8, 2016

Agree. Now that we have tabs, razor-intellisense is the "one big thing" missing from VS Code for asp.net core devs.

@david-driscoll
Copy link
Member

@david-driscoll david-driscoll commented Jul 8, 2016

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.

@mchomer
Copy link

@mchomer mchomer commented Aug 25, 2016

Some updates?
I also really miss it.

@winuxue
Copy link

@winuxue winuxue commented Sep 18, 2016

I need it also

@DustinCampbell
Copy link
Contributor

@DustinCampbell DustinCampbell commented Sep 19, 2016

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..

@eamodio
Copy link
Contributor

@eamodio eamodio commented Sep 19, 2016

@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).

@david-driscoll
Copy link
Member

@david-driscoll david-driscoll commented Sep 19, 2016

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.Razor which 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.
  • 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.

@egamma
Copy link
Contributor Author

@egamma egamma commented Sep 19, 2016

@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.

@uxsoft
Copy link

@uxsoft uxsoft commented Nov 4, 2016

What is the status of this?:)

@eByte23
Copy link

@eByte23 eByte23 commented Jan 20, 2017

Once again, any status update?

@DustinCampbell
Copy link
Contributor

@DustinCampbell DustinCampbell commented Jan 20, 2017

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.

@eByte23
Copy link

@eByte23 eByte23 commented Jan 20, 2017

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

@DustinCampbell
Copy link
Contributor

@DustinCampbell DustinCampbell commented Jan 20, 2017

Any help would be welcome! 😄

@karabaja4
Copy link

@karabaja4 karabaja4 commented Jan 23, 2017

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

@DustinCampbell DustinCampbell modified the milestone: future Feb 7, 2017
@mrtristan
Copy link

@mrtristan mrtristan commented Feb 24, 2017

any plans for this?

@idarous
Copy link

@idarous idarous commented May 3, 2017

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.

@AndrewBrianHall
Copy link

@AndrewBrianHall AndrewBrianHall commented Jul 5, 2018

@MicleBrick have you looked to see if Visual Studio Community edition is an option?

@MicleBrick
Copy link

@MicleBrick MicleBrick commented Jul 5, 2018

Sadly it's not, since I currently have Linux on my workstation

@roboriaan
Copy link

@roboriaan roboriaan commented Jul 9, 2018

Thanks @MicleBrick .Going to give Jetbrains Rider a shot. Love VS community but I'm not always on a Windows machine.

@myrup
Copy link

@myrup myrup commented Jul 9, 2018

@roboriaan VS community works excellent for OS X as well :)

@seriouz
Copy link

@seriouz seriouz commented Jul 18, 2018

@Andrew-MSFT So .cshtml files do have to support Intellisense for:
HTML, C#, Razor, Javascript, Typescript?

@AndrewBrianHall
Copy link

@AndrewBrianHall AndrewBrianHall commented Jul 19, 2018

You should get support for HTML, JavaScript, CSS, and TypeScript in VS Code, it's just C# support that's missing at this time.

@mdx0111
Copy link

@mdx0111 mdx0111 commented Aug 12, 2018

C# support would be highly appreciated.

Many thanks.

@gianlazz
Copy link

@gianlazz gianlazz commented Aug 21, 2018

Wow I was shocked to find out that this wasn't supported. Super disappointed :/

@seriouz
Copy link

@seriouz seriouz commented Aug 21, 2018

They showed us a internal work in progress on the community stand up. And it looked promising!

@mikes-gh
Copy link

@mikes-gh mikes-gh commented Aug 21, 2018

They were very non-committal on the Stand up. It is not a work in progress but an early investigation that may or may not turn into support for Razor in vs code. They were very clear that they weren't making any promises. I really hope that this proves to be achievable with the resources available and would appreciate an update here on the status of the investigation.

@mikes-gh
Copy link

@mikes-gh mikes-gh commented Aug 21, 2018

Is there a github repo of the investigation?

@mika76
Copy link

@mika76 mika76 commented Aug 21, 2018

Getting updated on the issue is so disappointing. ASP.NET is a priority of .NET, VS Code is a priority - but the single thing that is stopping bringing the two together is what ... a lack of priority? I mean this issue was opened in 2016! All we've gotten are a couple of teasers and then silence in between.

@xsoheilalizadeh
Copy link

@xsoheilalizadeh xsoheilalizadeh commented Aug 21, 2018

@mika76 They work hard to prepare this feature if you want to know the feature progress, join to the OmniSharp slack team. I asked about this feature in the twitter.
image

I think OmniSharp isn't part of Microsoft and they are alone in the development of this extensions.

@SeriaWei
Copy link

@SeriaWei SeriaWei commented Aug 22, 2018

That's why I'm still using Visual Studio.

@mattwelke
Copy link

@mattwelke mattwelke commented Aug 22, 2018

@SeriaWei I'm more of a fan of Rider from JetBrains myself, if I want Razor support. I can't wait for VS Code to get it though. 🙏

@danroth27
Copy link
Contributor

@danroth27 danroth27 commented Aug 22, 2018

As @Andrew-MSFT mentioned previously we have started investigating VSCode support for Razor. We even showed a demo recently on the ASP.NET Community Standup of some of our early prototyping work. We've also reached out to various folks in the OmniSharp community to discuss how best to proceed with this effort. Nothing to share publicly yet, but we are working on it.

@ShadowDancer
Copy link

@ShadowDancer ShadowDancer commented Aug 30, 2018

@danroth27
Do You have anything like dev feed? :) I would be happy even with prototype demo.

@danroth27
Copy link
Contributor

@danroth27 danroth27 commented Aug 30, 2018

@ShadowDancer Not yet, but the intent is that the development work will be public and open source. We just have a few more hoops to jump through.

@gripusa
Copy link

@gripusa gripusa commented Sep 8, 2018

sometimes, I lost the picture how Microsoft operates, they have a great product in the form of VSCode and they support many languages but they dont support a language which is developed by them and core to their development frameworks. If this is an issue with revenue cutting, surely , supporting Razor would not cut tot their budget because front-end developers would not be using Visual Studio any way. In short, it will be great to have Razor support in VSCode.

@DMW007
Copy link

@DMW007 DMW007 commented Oct 1, 2018

@gripusa I totally agree. And even after those strange concepts got reported by issues like this from the community, MS doesn't fix them in a reasonable time expenditure. This issue is open for nearly 3 years now. Very sad to see, that it seems that I've to use third party products instead of ASP.NET Core, since they're better supported in their own editor...

@SIkebe
Copy link

@SIkebe SIkebe commented Oct 1, 2018

@DMW007 Have you seen this?
#2554

@mika76
Copy link

@mika76 mika76 commented Oct 1, 2018

@SIkebe wow this is great news - we're so close now 👍 👏 🎉

@AndrewBrianHall
Copy link

@AndrewBrianHall AndrewBrianHall commented Oct 1, 2018

As you can see from the referenced Pull Request, we are working on adding Razor support in VS Code and will let you know as soon as there is a preview version available to try

@danroth27
Copy link
Contributor

@danroth27 danroth27 commented Oct 8, 2018

Razor tooling work for VS Code is now happening here: https://github.com/aspnet/Razor.VSCode. It will all get released as part of the standard C# extension, but if you're specifically interested in Razor support in VS Code then the Razor.VSCode repo is where the action is at (source code, issue tracking, etc). Enjoy!

@Lepike
Copy link

@Lepike Lepike commented Oct 9, 2018

That is really good new @danroth27. Its going to be a game changer.
Thanks for sharing!

/ Lars

@kokman
Copy link

@kokman kokman commented Oct 16, 2018

Good job. Thanks

@danroth27
Copy link
Contributor

@danroth27 danroth27 commented Oct 31, 2018

The C# extension for Visual Studio Code released today (1.17.0) with preview support for Razor editing. Includes support for directive and C# completions. No support for tag helpers yet - that's next. Please file Razor related issues in the https://github.com/aspnet/Razor.VSCode repo.

@mattwelke
Copy link

@mattwelke mattwelke commented Oct 31, 2018

@danroth27 Y'all are amazing. I'm going to make it my duty to test this thing.

@ryancheung
Copy link

@ryancheung ryancheung commented Jan 12, 2020

Tag helpers intellisense seems works now with the latest c# extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.