Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:10
    Build #225 passed
  • 18:54
    DonkeyRit starred cake-build/cake
  • Sep 30 18:11
    JCelestial starred cake-build/cake
  • Sep 30 13:01
    mahfouzt starred cake-build/cake
  • Sep 30 09:54
    nils-a commented #2868
  • Sep 30 06:46
    gep13 commented #2868
  • Sep 30 06:32
    jafsuen starred cake-build/cake
  • Sep 30 00:12
    spurgear starred cake-build/cake
  • Sep 29 13:58
    nils-a commented #2868
  • Sep 29 13:54
    nils-a closed #2869
  • Sep 29 13:31
    Build #5936 passed
  • Sep 29 13:27
    gep13 commented #2869
  • Sep 29 13:24
    nils-a opened #2869
  • Sep 29 13:19
    Build #5935 passed
  • Sep 29 13:14
    nils-a synchronize #2789
  • Sep 29 12:55
    nils-a commented #2868
  • Sep 29 12:51
    nils-a opened #2868
  • Sep 28 20:56
    kcamp removed as member
  • Sep 28 20:35
    Build #96 passed
  • Sep 28 20:33
    Build #95 passed
Rich Bryant
@richbryant
so, how do I get Intellisense? There's nothing on the site.
and I know it works because it worked in Mattias' video
Nils Andresen
@nils-a
image.png
Have you tried it like this?
Martin Björkström
@mholo65
@richbryant, sorry for the outdated docs. Let's walk you through this. Are you on Windows?
Easiest. Install Cake global tool https://www.nuget.org/packages/Cake.Tool and Cake.Bakery (easiest from Choco if you are on Windows https://chocolatey.org/packages/cake-bakery.portable). In VS Code, also install the C# Extension (https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
Rich Bryant
@richbryant
yes, I am
both of those are installed
I do not know the window in the screenshot you showed me
Martin Björkström
@mholo65

I mentioned three things ;)

Ok, if you don't like Chocolatey, you can download Cake.bakery ZIP from here https://github.com/cake-build/bakery/releases/tag/0.4.1, extract it and add to PATH.

Rich Bryant
@richbryant
you're right, I didn't have bakery installed. I do now.
Martin Björkström
@mholo65
The screenshot @nils-a showed, are helpers provided by the Cake extension in VS Code (https://marketplace.visualstudio.com/items?itemName=cake-build.cake-vscode)
Rich Bryant
@richbryant
i have that installed too but I normally work in VS and don't know VSCode well.
Martin Björkström
@mholo65
Ok, then Ctrl+Shift+P and select `Restart OmniSharp
Rich Bryant
@richbryant
ther eis now a tools folder
Nick
@nick5454
@richbryant I use VS and use the project to validate my syntax
csproj
Rich Bryant
@richbryant
ok, that's all good. Still no intellisense though
Martin Björkström
@mholo65
Ok, that's because OmniSharp / VS Code C# extension broke Cake support, and haven't release a new version yet.. But we can use a pre-release version. hang on..
image.png
Ctrl+Shift+P and select Open User Settings
image.png
image.png
Search for omnisharp.path and click Edit in settings.json
Rich Bryant
@richbryant
ok
Martin Björkström
@mholo65
Add "omnisharp.path": "latest"
Rich Bryant
@richbryant
got that
it's installing
Martin Björkström
@mholo65
Ok, then we wait :)
image.png
At some point, check the logs at in the Output tab. Select OmniSharp Log
Rich Bryant
@richbryant
The doqwnload is still going, I think.
oh, here we are
i think it's done
Martin Björkström
@mholo65
Do you have completion now?
Rich Bryant
@richbryant
Apparently not
wait! Yes I do!
thank you, thanks very much.
Martin Björkström
@mholo65
I noticed it was a little bit slow with latest OmniSharp now that I tested..
Rich Bryant
@richbryant
yes, but it does get there. Which is a huge benefit.
Martin Björkström
@mholo65
But it's managable
:+1:
Rich Bryant
@richbryant
thanks again. Right! Dinner.
Martin Björkström
@mholo65
Yes, and the red squiggles are a life saver.
Np!
Nils Andresen
@nils-a
@mholo65 thanks. I totally forgot about the current OmniSharp-problem.
Martin Björkström
@mholo65
NP! I should ping the folk who create the Extension releases, that we want a new one soonish..
Maciek Misztal
@mmisztal1980
@devlead is there an equivalent delegate to Func<string, CakeTaskBuilder> for Setup ?
Mattias Karlsson
@devlead
@mmisztal1980 that would be Action<Action<ISetupContext>>, do make your code more readable you could create an delegate i.e. public delegate void SetupHandler(Action<ISetupContext> action); and use that.

that could look something like this

public delegate void SetupHandler(Action<ISetupContext> action);

public class UsingSetupInAClass
{
     private SetupHandler Setup { get; }

     public void MySetup(Action<ISetupContext> action) => Setup(action);

     public UsingSetupInAClass(SetupHandler setup)
     {
         Setup = setup;
     }
}

var usingSetupInAClass = new UsingSetupInAClass(Setup);

usingSetupInAClass.MySetup(context=>context.Information("MySetup"));

Task("UsingSetupInAClass");

RunTarget("UsingSetupInAClass");

output

----------------------------------------
Setup
----------------------------------------
MySetup

========================================
UsingSetupInAClass
========================================

Task                          Duration
--------------------------------------------------
Setup                         00:00:00.0131468
--------------------------------------------------
Total:                        00:00:00.0186093