dotnet / dotnet/roslyn

ProjectSystemProjectOptionsProcessor does not set CompilationOptions when given empty command line

Open
#78,423 0 comments 0 reactions 1 assignee Claimed by @jasonmalinowski View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

https://github.com/dotnet/roslyn/blob/c5fab36af117b83adfae7a3f4649df415e9de4fb/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LoadedProject.cs#L143

It is expected that after SetCommandLine is called, the associated ProjectSystemProject is updated with non-null CompilationOptions (if it doesn't have the appropriate options on it already).

This doesn't happen when the command line we pass in is `[]`. That's because the constructor calls `ReparseCommandLineIfChanged_NoLock(arguments: []);`, which skips setting CompilationOptions, and when the new call comes in, it is perceived that nothing is changed and there's no need to update.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.