Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)

# 2.90.x
* Bump Razor to 10.0.0-preview.25416.1 (PR: [#8557](https://github.com/dotnet/vscode-csharp/pull/8557))
* Bump Roslyn to 5.0.0-2.25424.1 (PR: [#8559](https://github.com/dotnet/vscode-csharp/pull/8559))
* Generate `init` accessor for required properties inside `readonly struct`s (PR: [#80004](https://github.com/dotnet/roslyn/pull/80004))
* Allow Razor cohosting to work with non-Razor SDK projects (PR: [#79953](https://github.com/dotnet/roslyn/pull/79953))
* Update 'use expr body' to be a purely syntactic analyzer (PR: [#79979](https://github.com/dotnet/roslyn/pull/79979))
* Implement "Simplify property accessor" feature (PR: [#79754](https://github.com/dotnet/roslyn/pull/79754))
* Allow Razor to hook up the source generator in misc files (PR: [#79891](https://github.com/dotnet/roslyn/pull/79891))
* Bump Razor to 10.0.0-preview.25424.9 (PR: [#8559](https://github.com/dotnet/vscode-csharp/pull/8559))
* Allow Razor cohosting to work with non-Razor SDK projects (PR: [#12118](https://github.com/dotnet/razor/pull/12118))
* Allow the source generator to produce results for miscellaneous files (PR: [#12106](https://github.com/dotnet/razor/pull/12106))
* Fix range formatting in the presence of K&R braces (PR: [#12121](https://github.com/dotnet/razor/pull/12121))
* Add codelens endpoints and services for cohosting (PR: [#12078](https://github.com/dotnet/razor/pull/12078))
* Support Go To Def for Mvc tag helpers in cohosting (PR: [#12102](https://github.com/dotnet/razor/pull/12102))
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"workspace"
],
"defaults": {
"roslyn": "5.0.0-2.25412.5",
"omniSharp": "1.39.14",
"razor": "10.0.0-preview.25419.3",
"roslyn": "5.0.0-2.25424.1",
"omniSharp": "1.39.14",
"razor": "10.0.0-preview.25424.9",
"razorOmnisharp": "7.0.0-preview.23363.1",
"xamlTools": "17.14.36106.43"
},
Expand Down
11 changes: 10 additions & 1 deletion src/lsptoolshost/server/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't we importing the same support directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DevKit the targets file comes from the Microsoft.VisualStudio.ProjectSystem.Managed package which we don't reference in the C# extension. Seemed like a large hammer for one xml file. We'd still need all of the changes in this PR anyway, to pass the path through to msbuild etc. it would just be path itself that would change.

Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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) {
Expand Down