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

Intellisense for C# does not work in multiproject environment #904

Closed
aeschli opened this issue Nov 10, 2016 · 16 comments
Closed

Intellisense for C# does not work in multiproject environment #904

aeschli opened this issue Nov 10, 2016 · 16 comments
Assignees
Milestone

Comments

@aeschli
Copy link
Contributor

aeschli commented Nov 10, 2016

From @PradeepLoganathan on November 10, 2016 7:8

  • VSCode Version: 1.7.1
  • OS Version: Microsoft Windows [Version 10.0.14393]

Steps to Reproduce:

  1. I have created a sample GIT repository at https://github.com/PradeepLoganathan/testvscode
  2. I have folders for source and tests and have initialized projects in these folders using dotnet new.
  3. I have a global.json specifying the project folder structure.
  4. Intellisense no longer works.

Copied from original issue: microsoft/vscode#15282

@DustinCampbell
Copy link
Member

Which version of the C# extension do you have installed?

@PradeepLoganathan
Copy link

I have version 1.4.1. ( Omnisharp C# extension)

@PradeepLoganathan
Copy link

Here is further version information. If needed I can upload a video of the issue. I am just trying to make VS code better :-)

  • VSCode Version: Code 1.7.1 (02611b40b24c9df2726ad8b33f5ef5f67ac30b44, 2016-11-03T13:53:14.822Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
html-snippets abusaidm 0.0.18
rest-client humao 0.10.2
Angular2 johnpapa 1.0.2
csharp ms-vscode 1.4.1
vscode-docker PeterJausovec 0.0.7

@DustinCampbell
Copy link
Member

Thanks for the additional information. I suspect this is the same issue that was reported in #735 awhile back. This should be fixed in our latest beta release of the C# extension. Could you try the beta and see if it fixes your issue?

You can do the following to install a beta release of the extension:

  1. Download the .vsix file for the release you want.
  2. Open Visual Studio Code
  3. Select View->Extensions to display the Extension pane.
  4. In the Extensions pane, click on the little gear next to the C# extension and select "Uninstall". After it's uninstalled, click the "Reload" button to allow Visual Studio Code to reload.
  5. In the Extensions pane, click the [...] at the top-right corner and select "Install from VSIX...". Select the .vsix file that you downloaded earlier.
  6. Click the "Reload" button to allow Visual Studio Code to reload.

Let me know if this works any better for your scenario.

@PradeepLoganathan
Copy link

I did all of the above steps. It did not resolve the issue. I am not getting intellisense both for core types as well as custom types.

@DustinCampbell
Copy link
Member

@PradeepLoganathan: Could you paste your OmniSharp log here for me?

  1. Open Visual Studio Code and open your project.
  2. Select View->Output from the menu to display the Output pane.
  3. In the Output pane, select OmniSharp Log in the top-right corner.

Copy and paste the content here.

@DustinCampbell
Copy link
Member

This is fixed in OmniSharp now. Once we take a new build for the extension, we'll publish a beta that you can try. Otherwise, the fix will be available when we ship 1.6 of the extension in the coming weeks.

@DustinCampbell
Copy link
Member

I've created a v1.6-beta2 release of the C# extension that contains this fix, among others. See this page for information on installing beta releases

@PradeepLoganathan
Copy link

@DustinCampbell I installed the beta and also updated VS code to the latest version (1.7.1 --> 1.7.2 ) and am happy to say it works great :-) thanks. 👍

@imuni4fun
Copy link

@DustinCampbell I am not sure where the best place is to post this, either here or in a new issue...

I am using VS Code 1.18.1 and have a very simple test workspace where intellisense does not work in C# when opening the multi-project workspace. It works if I open each project in their own VS Code process.

Steps to reproduce:

  1. dotnet new classlib --name lib
  2. dotnet new console --name top
  3. dotnet add top/top.csproj reference lib/lib.csproj
  4. code .
  5. open each project, create build resources, and build
  6. create a workspace and add both projects to it

If you open the workspace, intellisense no longer works from top to classlib.
If you open the top project directly, intellisense works from top to classlib.
No extensions are enabled.

Any idea why? Is this on the roadmap to be something that should work? It seems like it should. It is killing our team having to have several VS Code instances up in order to get intellisense.

Thanks!
Jason

@DustinCampbell
Copy link
Member

You might need to tell OmniSharp to launch on the correct project. Try this: open your workspace and open a C# file in the editor. At the bottom-right of VS Code, there should be a little OmniSharp "flame" icon in the status bar. Click on that and it should bring up a project launcher that allows you to select which folder in your workspace that OmniSharp is launched on.

@DustinCampbell
Copy link
Member

@imuni4fun : If my suggestion doesn't work, please file a different issue as your query is definitely not related to this closed issue (since it pre-dates multi-root workspaces in VS Code).

@DustinCampbell
Copy link
Member

Also, you might check out this issue where I gave the same solution: #1889.

@imuni4fun
Copy link

imuni4fun commented Dec 12, 2017

@DustinCampbell great, thanks! That did the trick. I also see # 909 (OmniSharp/omnisharp-roslyn#909) which tracks the intended end result where we won't have to choose which single root project omnisharp is aware of, which was my next question. Any idea when that might land?

@DustinCampbell
Copy link
Member

I don't have a date, but it's definitely on the backlog. There are several things it's stacked up behind however.

@lariamato
Copy link

This is still not working

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

5 participants