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 in C# file that is not included in a project #47

Closed
ghost opened this issue Feb 28, 2016 · 17 comments
Closed

No IntelliSense in C# file that is not included in a project #47

ghost opened this issue Feb 28, 2016 · 17 comments

Comments

@ghost
Copy link

ghost commented Feb 28, 2016

Seriously? What kind of editor is this?

If I need to follow certain instructions in order to get basic Intellisense on C# just to edit a single .cs file, then this needs to be really freaking obvious.

screen capture on 2016-02-28 at 13-09-47

@ghost ghost changed the title No Intellisense on C# No Intellisense in C# Feb 28, 2016
@DustinCampbell
Copy link
Member

This is something we'll definitely be working on. Today, you can't get IntelliSense for a file without it belonging to a project file, which is not a great experience.

@ghost
Copy link
Author

ghost commented Feb 29, 2016

And I can't create a project too, because there is no "New Project" option on the menu, which is also not a great experience either.

@DustinCampbell
Copy link
Member

@Leocrespo -- bear in mind that this is an editor and not an IDE. "New Project" isn't something that you find in many other editors (like, say Sublime Text).

@ghost
Copy link
Author

ghost commented Mar 4, 2016

So there's no Intellisense because the file doesn't belong to a project, and yet I can't create a project. Sure, makes sense.

@DustinCampbell
Copy link
Member

As I said, we'll be working on IntelliSense for project-less scenarios. At the moment, the most common way to create a C# project for VS Code scenarios is to use a scaffolding tool like yeoman or to create a project.json manually. Eventually, you'll be able to use the .NET command-line tools to create a project with "dotnet new".

@DustinCampbell DustinCampbell changed the title No Intellisense in C# No IntelliSense in C# file that is not included in a project Mar 7, 2016
@dhnnjy
Copy link

dhnnjy commented Mar 17, 2016

@DustinCampbell 'Dotnet new' creates simple Console app template. vscode can't create a project. Yeoman is probably outdated, it doesn't work with latest CLI. Is there any way of creating web api or class library?

@gregg-miskelly
Copy link
Contributor

Sorry if this is obvious, but the problem is that there is a major shift in how ASP.NET Core works, and it hasn't been fully released. I think your best bet is https://github.com/aspnet/cli-samples. If you have trouble, you may want to follow up with @sayedihashimi, and I believe he owns the yoman generator.

@sayedihashimi
Copy link
Member

yo aspnet is typically updated a few days before the release. We don't have a good mechanism to get pre-release templates out today. The main issue on my side here is that we have to author templates twice. Once for VS and once for yo aspnet. The Microsoft team authors templates in aspnet/templates initially for VS, and then we post the final result to get added in yo aspnet. I'm working to define a new approach to templates where we can have one source of truth for templates which then get added to both VS and yo aspnet. Once I make good progress there then we will have a better story for pre-release templates. That will likely take me at least a few months as I'm doing all the work on the side at nights.

@filipw
Copy link
Contributor

filipw commented Mar 23, 2016

this looks like the same as this OmniSharp/omnisharp-roslyn#207

I would like to mention that you can get project-less intellisense in CSX files already in omnisharp

@landaire
Copy link

This is an old issue but what needs to be done to accomplish this? At my job I review and trace code more than I write it. Usually I'll clone multiple repos and go through code, tracing things by hovering over a symbol and going to definition.

For example, I cloned https://github.com/aspnet/mvc. In Sublime with no additional setup I can just hover over a symbol and see where it's defined:

screen shot 2017-09-13 at 19 52 13

In VS Code the story is different:

screen shot 2017-09-13 at 19 52 20

What would need to be done in order to match Sublime's out-of-box experience with projects like this?

@DustinCampbell
Copy link
Member

@landaire: This issue is different than what you've reported here. This issue is about opening just a single file with no project file. However, in your scenario (cloning MVC), you certainly have a project file.

@landaire
Copy link

landaire commented Sep 14, 2017

@DustinCampbell: Hmmm. True. I was under the impression I was using a different C# plugin that was not backed by Omnisharp (and didn't look at project files) but sure enough that's the plugin I'm using. Is there a separate issue already that you're aware of for what I'm referring to?

@DustinCampbell
Copy link
Member

Without more information, it's hard to determine what's going on and whether there's an existing issue that matches what you're seeing. Have you tried clicking the OmniSharp icon at the bottom right of the status bar and picking a particular solution or project to launch OmniSharp on? Also, what does the OmniSharp Log display? (You can see this by selecting View->Output and then picking "OmniSharp Log" from the dropdown in the top-right of the Output pane).

@Davilink
Copy link

Will a good use when you want to create small script to be use with dotnet script (https://github.com/filipw/dotnet-script). Otherwise i have to create a console application just to test something out.

@hifall
Copy link

hifall commented Aug 4, 2018

So this still is the case, that in order to use OmniSharp's services, one needs to create a full project, instead of using a single file?

@mzhukovs
Copy link

mzhukovs commented Sep 2, 2018

Nice - when will v1.16 be released with this?

@akshita31
Copy link
Contributor

The latest version of the c# extension which includes intellisense support for standalone c# files is out. Please do give it a try.

dibarbet pushed a commit to dibarbet/vscode-csharp that referenced this issue Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants