-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support not referencing VB #168
Comments
What an interesting side effect of local functions! I guess because they're "lifted" into separate methods? In any case, I've hit the merge button and am planning a release within the next day or two once I clear the remaining PR backlog. Thanks for the contribution, and sorry for the delay! |
Yes, exactly. Using regular methods would achieve the same effect, but I thought local functions were more appropriate here. |
I want to use Buildalyzer.Workspaces, but without referencing Microsoft.CodeAnalysis.VisualBasic.Workspaces (because I have a custom build of Microsoft.CodeAnalysis.CSharp.Worspaces). When I try to do that, I get the following exception:
This happens because of the following code in
CreateCompilationOptions
(and similar, but longer code inCreateParseOptions
):https://github.com/daveaglick/Buildalyzer/blob/da88770a2952f7894c05cd0866ef9d766f78aaea/src/Buildalyzer.Workspaces/AnalyzerResultExtensions.cs#L192-L200
This means that JIT compiling the method requires a reference to Microsoft.CodeAnalysis.VisualBasic, even if I only ever want to create C# options.
Extracting the language-specific code into a local function seems to fix this issue.
The text was updated successfully, but these errors were encountered: