Skip to content
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

Dont limit the #load to only .cake files #2527

Closed
llaaccssaapp opened this issue Apr 11, 2019 · 3 comments · Fixed by #2588
Closed

Dont limit the #load to only .cake files #2527

llaaccssaapp opened this issue Apr 11, 2019 · 3 comments · Fixed by #2588
Labels
Bug
Milestone

Comments

@llaaccssaapp
Copy link

@llaaccssaapp llaaccssaapp commented Apr 11, 2019

What You Are Seeing?

Since 0.33 there is no longer support for loading .cs files with the #load directive

What is Expected?

#l "./file.cs" will include the file and parse it

What version of Cake are you using?

0.33

Are you running on a 32 or 64 bit system?

64

What environment are you running on? Windows? Linux? Mac?

Windows

Code location

src/Cake.Core/Scripting/Processors/Loading/FileLoadDirectiveProvider.cs
public bool CanLoad(IScriptAnalyzerContext context, LoadReference reference)
return extension != null && extension.Equals(".cake", StringComparison.OrdinalIgnoreCase);

please allow .cake and .cs file extensions

@slicht

This comment has been minimized.

Copy link

@slicht slicht commented May 16, 2019

We need this as well. We can't use the current implementation since we need .cs files for code completion in VS.

@mythgarr

This comment has been minimized.

Copy link
Contributor

@mythgarr mythgarr commented Jul 30, 2019

This is also blocking me from updating. Using an older release will complicate things - I'd like to use some features introduced in January.
I'm not sure why the Where is necessary here at all - wouldn't you just add *.cake to the end of the glob? Maybe I'll just put together a pull request and see if it gets accepted.

@mythgarr

This comment has been minimized.

Copy link
Contributor

@mythgarr mythgarr commented Aug 1, 2019

As part of supporting globbing within the #load directive the file filter was made consistent with nuget packages. I'm looking for ways to make that filter more selective so that explicit file paths are always included, globs are always filtered.
Even this seems a little excessive. If I write #load "plugins/*.cs" I've explicitly stated that I want to load all cs files at the specific location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.