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

Cake support #932

Merged
merged 40 commits into from
Oct 25, 2017
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a651d6a
Adds OmniSharp.Cake project and Cake project system
bjorkstromm Jul 3, 2017
d9cd7a6
Project System now loads Cake files
bjorkstromm Jul 3, 2017
a1bcaba
Remove Cake.Core dependency
bjorkstromm Jul 4, 2017
054ecf9
Use Cake Configuration
bjorkstromm Jul 7, 2017
3fec513
Adds Buffer handlers for Cake
bjorkstromm Jul 14, 2017
3635771
Added more services
bjorkstromm Jul 14, 2017
ec9af89
Adds context model to Cake
bjorkstromm Jul 14, 2017
e6225ac
Fix hostObjectType loading for Cake
bjorkstromm Jul 15, 2017
c46a223
Update dependencies
bjorkstromm Aug 2, 2017
fa78f27
Remove target netstandard1.6
bjorkstromm Aug 15, 2017
b4b9b3f
Use IAssemblyLoader
bjorkstromm Aug 15, 2017
5c6760e
Use TargetFramework instead of TargetFrameworks
bjorkstromm Aug 15, 2017
392c2b8
Add DocumentationProvider
bjorkstromm Aug 15, 2017
6f66afa
Reorder request handlers
bjorkstromm Aug 16, 2017
e78d168
Refactor Cake Script Service
bjorkstromm Aug 16, 2017
063fe25
Fix line number translations to work when a cake file is loaded.
bjorkstromm Aug 17, 2017
55b6b27
Cache references and using and react on changes
bjorkstromm Aug 21, 2017
f207ceb
Find Cake.Bakery if path contains version
bjorkstromm Aug 21, 2017
f616e2e
Fix translation of lines for requests and responses
bjorkstromm Aug 22, 2017
e7b24c4
Added unit test project and fixed some translations.
bjorkstromm Aug 24, 2017
3f61d56
Support method and property aliases in gotodefinition handler.
bjorkstromm Aug 25, 2017
7299149
Git ignore launchSettings.json
bjorkstromm Sep 23, 2017
7340b9f
Git ignore Rider stuff
bjorkstromm Oct 5, 2017
753ebfe
Initial tests for Cake handlers.
bjorkstromm Oct 5, 2017
6d99493
Catch any exception when parsing configuration.
bjorkstromm Oct 10, 2017
a295267
Use package versions from packages.props
bjorkstromm Oct 10, 2017
65518ba
Handle incremental changes.
bjorkstromm Oct 17, 2017
cdd109a
Merge branch 'master' into feature/cake
david-driscoll Oct 18, 2017
e126ff4
Address code review comments.
bjorkstromm Oct 18, 2017
54c3bab
Merge branch 'master' into feature/cake
DustinCampbell Oct 19, 2017
e2dd7df
Make Cake Bakery resolution case insensitive
bjorkstromm Oct 19, 2017
a6194f6
Update Cake.Scripting and Bakery versions
bjorkstromm Oct 19, 2017
9fecd07
Add mono wrapper for executing bakery
bjorkstromm Oct 19, 2017
eb02fde
Fix LineIndexHelper and tests on Linux/OSX
bjorkstromm Oct 21, 2017
f6afebf
Add gotodefinition tests.
bjorkstromm Oct 22, 2017
e0cdfa5
Update to release bits of Cake.Scripting and Bakery
bjorkstromm Oct 22, 2017
50ad596
CakeConfiguration was never used.
bjorkstromm Oct 24, 2017
04825e0
Enhance compilation options usage in project system.
bjorkstromm Oct 24, 2017
48a2e73
Removed some magic integers.
bjorkstromm Oct 24, 2017
8a59058
Added MIT License for code copied from Cake repo
bjorkstromm Oct 24, 2017
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
6 changes: 4 additions & 2 deletions src/OmniSharp.Cake/CakeProjectSystem.cs
Original file line number Diff line number Diff line change
@@ -5,14 +5,14 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Cake.Core.Scripting;
using Cake.Scripting.Abstractions;
using Cake.Scripting.Abstractions.Models;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Scripting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using OmniSharp.Cake.Polyfill;
using OmniSharp.Models.WorkspaceInformation;
using OmniSharp.Services;

@@ -107,6 +107,8 @@ private ProjectInfo GetProject(CakeScript cakeScript, string filePath)
{
var name = Path.GetFileName(filePath);

AssemblyLoader.LoadFrom(cakeScript.Host.AssemblyPath);

return ProjectInfo.Create(
id: ProjectId.CreateNewId(Guid.NewGuid().ToString()),
version: VersionStamp.Create(),
@@ -120,7 +122,7 @@ private ProjectInfo GetProject(CakeScript cakeScript, string filePath)
metadataReferences: cakeScript.References.Select(reference => MetadataReference.CreateFromFile(reference/*, documentation: CreateDocumentationProvider(referencePath))*/)),
// TODO: projectReferences?
isSubmission: true,
hostObjectType: typeof(IScriptHost));
hostObjectType: Type.GetType(cakeScript.Host.TypeName));
}

private CompilationOptions GetCompilationOptions(ISet<string> usings)
11 changes: 6 additions & 5 deletions src/OmniSharp.Cake/OmniSharp.Cake.csproj
Original file line number Diff line number Diff line change
@@ -17,11 +17,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.3.0-beta2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.3.0-beta2" />
<PackageReference Include="Cake.Scripting.Abstractions" Version="0.1.0-unstable0062" />
<PackageReference Include="Cake.Scripting.Transport" Version="0.1.0-unstable0062" />
<PackageReference Include="Cake.Core" Version="0.20.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Cake.Scripting.Abstractions" Version="0.1.0-unstable0064" />
<PackageReference Include="Cake.Scripting.Transport" Version="0.1.0-unstable0064" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions src/OmniSharp.Cake/Polyfill/AssemblyLoader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Reflection;

namespace OmniSharp.Cake.Polyfill
{
internal static class AssemblyLoader
{
public static Assembly LoadFrom(string assemblyPath)
{
#if NET46
return Assembly.LoadFrom(assemblyPath);
#else
return System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath);
#endif
}
}
}