-
Notifications
You must be signed in to change notification settings - Fork 726
Allow Razor cohosting to work with non-Razor SDK projects #8559
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
Changes from 5 commits
f96d8d8
f1ee78d
1f2e475
b6cdecf
8a4c29d
6eee942
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -666,7 +666,7 @@ export class RoslynLanguageServer { | |
|
|
||
| args.push( | ||
| '--razorDesignTimePath', | ||
| path.join(razorPath, 'Targets', 'Microsoft.NET.Sdk.Razor.DesignTime.targets') | ||
| path.join(razorSourceGeneratorPath, 'Targets', 'Microsoft.NET.Sdk.Razor.DesignTime.targets') | ||
| ); | ||
|
|
||
| // Get the brokered service pipe name from C# Dev Kit (if installed). | ||
|
|
@@ -706,6 +706,15 @@ export class RoslynLanguageServer { | |
| // Set command enablement to use roslyn standalone commands. | ||
| await vscode.commands.executeCommand('setContext', 'dotnet.server.activationContext', 'Roslyn'); | ||
| _wasActivatedWithCSharpDevkit = false; | ||
|
|
||
| if (razorOptions.cohostingEnabled) { | ||
| // Razor has code in Microsoft.CSharp.DesignTime.targets to handle non-Razor-SDK projects, but that doesn't get imported outside | ||
| // of DevKit so we polyfill with a mini-version that Razor provides for that scenario. | ||
|
Comment on lines
+711
to
+712
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why aren't we importing the same support directly?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In DevKit the targets file comes from the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I presume we also need this for C# standalone scenarios, when devkit isn't available?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, thats the only scenario this code runs in. With DevKit, we leave it up to it. |
||
| args.push( | ||
| '--csharpDesignTimePath', | ||
| path.join(razorComponentPath, 'Targets', 'Microsoft.CSharpExtension.DesignTime.targets') | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| for (const extensionPath of additionalExtensionPaths) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.