I followed the instructions on the website, but I don't get full cake support.
environment: linux, dotnet (6.0.302), vscode (1.70.0), c# extension (1.25.0), cake extension (2.0.0) - i.e. latest of everything
repro
build.cake
result:
Setup
, Teardown
, Task
, etc. - shows "The name 'Teardown' does not exist in the current context"logs:
Cake Workspace
OmniSharp Log
and no messages related to cake, but it does show this when I open build.cake
:
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /tmp/cake/build.cake.
[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /tmp/cake/build.cake
notes:
dotnet tool install --global cake.tool
.vscode/settings.json
omnisharp.json
file in the workspace root:
{
"cake": {
"enabled": true,
"bakeryPath": "~/.vscode/extensions/cake-build.cake-vscode-2.0.0/Cake.Bakery/tools/Cake.Bakery.exe"
}
}
Due to some constraints, OmniSharp (the basis for the VSCode C# extension, which also includes support for Cake) currently does not ship the support for Cake in the net6
versions.
So you have two options here:
set "omnisharp.useModernNet": false
in the vscode settings. This will not use the net6
version of OmniSharp and fall back the mono/.NET Framework versions.
set "omnisharp.path": "latest"
in the vscode settings. This will always use the latest beta version of OmniSharp (at the time of writing, this is 1.39.2-beta.4
). OmniSharp does (will?) ship support for Cake in the net6
versions starting with 1.39.1
(which is currently available for download, but not used in the c# extension for vs code.)