question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow additional omnisharp settings to be overridden at the workspace level

See original GitHub issue

Currently omnisharp.path and omnisharp.useGlobalMono cannot be overridden at the workspace level.

Reason for change:

Currently, due to an architectural issue in roslyn, omnisharp’s scripting support does not support custom scripting hosts. Because of this a custom omnisharp build must be used in order to use a custom scripting host. The problem with that is the omnisharp implementation is global.

Allowing omnisharp.path would allow the omnisharp implementation to be overridden only where needed.

The reason for needing omnisharp.useGlobalMono is because setting it to never is the only way to run a custom omnisharp build without mono. My current omnisharp build doesn’t use mono (.net 5 instead).

Having these two settings available at the workspace level would allow the vscode extension to be used in custom scripting scenarios without affecting the normal operation machine wide.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MiniguyBrendancommented, Feb 19, 2021

I know that this issue is sort of in limbo, but I just wanted to echo that this is an issue for me, too.

I work on a multiplayer game that has a server component (dotnet core) and the actual game client (Unity’s mono runtime). I’d like to be able to use vscode to write code for both components at the same time, but omnisharp.useGlobalMono cannot be overridden at the workspace level.

I lose all Intellisense highlighting on one of the two windows depending on how the value is set. In this situation (where the absence or presence of a flag determines whether or not the specific project works), wouldn’t this be a good case for making this a workspace flag?

1reaction
filipwcommented, Feb 19, 2021

I work on a multiplayer game that has a server component (dotnet core) and the actual game client (Unity’s mono runtime). I’d like to be able to use vscode to write code for both components at the same time, but omnisharp.useGlobalMono cannot be overridden at the workspace level.

There is a new feature that shipped in OmniSharp 1.37.5 that should be helpful here. You can set "omnisharp.useGlobalMono": "always" (to make everything compatible with .NET Framework projects such as Unity) and then create omnisharp.json in the root of the project that you’d want to override this behavior (.NET Core project in your case) and add the following content there:

{ 
  "msbuild": { 
       "useBundledOnly": true 
   } 
}

This will force the OmniSharp project loader to skip MSBuild from global Mono and use the bundled one instead for that given folder. The bundled MSBuild is version 16.8, compatible with .NET Core (as opposed to the incompatible version 16.6 in Mono 6.12).

Alternatively, if you install nightly Mono (https://www.mono-project.com/download/nightly/) 6.13, it works both with latest .NET Core SDKs and with .NET Framework projects such as Unity since it ships with MSBuild 16.8 too. Then "omnisharp.useGlobalMono": "always" just works for everything, although I can understand having a nightly Mono may not be desirable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting C# formatting options for OmniSharp on Visual Studio ...
Place omnisharp.json in a project directory for project-specific settings. At each level you override individual settings; you don't need to ...
Read more >
OmniSharp/omnisharp-vim: Vim omnicompletion (intellisense ...
The roslyn server releases come with an embedded mono , but this can be overridden to use the installed mono by setting g:OmniSharp_server_use_mono...
Read more >
Language Server Protocol Specification - 3.17
This document describes the 3.17.x version of the language server protocol. An implementation for node of the 3.17.x version of the protocol can...
Read more >
End-user Guide Red Hat CodeReady Workspaces 2.15
Adding a Visual Studio Code extension using the workspace configuration; 5.2.2. ... To add or override generateName value, use the following factory URL:....
Read more >
Hidden features of OmniSharp and C# extension for VS Code
Specifically in C# extension in VS Code, for some settings, there is also a special shorthand syntax that allows you to enable some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found