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 syntax highlight in VSCode code-workspace for mixed C# & F# solution #1882

Open
ilog2000 opened this issue Jun 3, 2023 · 2 comments
Open

Comments

@ilog2000
Copy link

ilog2000 commented Jun 3, 2023

Describe the bug

I have monorepo with a dozen of subfolders and subprojects including C# app, C# libs, F# libs, Typescript React app, React component libs, azure pipelines, and scripts. In the root there is app.sln including all csproj & fsproj from subdirectories. I also prepared server.code-workspace file for VSCode to work with server side code. When workspace is loaded and code analysis finished, I have no syntax highlight in *.fs files.

Some related details:

  1. In VSCode status bar there is an icon of "C# Project Selector"
    1
  2. When click on it, no fsproj files suggested, only csproj ones
    2
  3. As a result I see "Not in F# Project (Still loading...)" forever, and no syntax highlight
    3
  4. If the first item in server.code-workspace is csproj, then F# file is processed by C# analyzer and the file is full of errors
  5. If I include root (".") into code-workspace or run VSCode without code-workspace, then I am able to select app.sln in "C# Project Selector" and highlighting works. But in this case analysis is running on all (more than thousand) files in monorepo and it takes like 15 minutes on my PC

I am not 100% sure this is exactly Ionide issue, but need to start somewhere. Either I could simply not know about some extras in settings, please give me a clue then.

Machine info

  • OS: Windows10
  • .NET SDK version: 5/6/7 (all the latest)
  • Ionide version: 7.5.4
@vzarytovskii
Copy link

Iirc, iodide doesn't fully support workspaces, @baronfel ?

@ilog2000
Copy link
Author

ilog2000 commented Jun 8, 2023

I was able to work around the issue:

  1. Created solution subdirectory
  2. Copied app.sln into it and prefixed all project paths with ..\
  3. Added solution into the list of workspaces in server.code-workspace file and put "FSharp.workspacePath": "./solution/app.sln" into settings section

I can conclude that this is OmniSharp issue - having solution file outside workspaces, it cannot access it and ignores all non-C# projects.

If there is a way to force OmniSharp to reference solution or not to ignore fsproj with settings, please do that. Otherwise feel free to close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants