diff --git a/OmniSharp.sln b/OmniSharp.sln index a764075691..9873c5869c 100644 --- a/OmniSharp.sln +++ b/OmniSharp.sln @@ -38,7 +38,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "OmniSharp.Roslyn", "src\Omn EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "OmniSharp.MSBuild", "src\OmniSharp.MSBuild\OmniSharp.MSBuild.xproj", "{9AF025CA-3706-401F-8D50-59FAD5AFE725}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "OmniSharp.ScriptCs", "src\OmniSharp.ScriptCs\OmniSharp.ScriptCs.xproj", "{F52F6F60-AB29-414D-A24B-DE8EFFBA34C0}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "OmniSharp.Script", "src\OmniSharp.Script\OmniSharp.Script.xproj", "{F52F6F60-AB29-414D-A24B-DE8EFFBA34C0}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "OmniSharp.MSBuild.Tests", "tests\OmniSharp.MSBuild.Tests\OmniSharp.MSBuild.Tests.xproj", "{194A88AE-1429-416B-86C1-BF6F7FF47404}" EndProject diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Diagnostics/CodeCheckService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Diagnostics/CodeCheckService.cs index 2e495fe7bd..896e12e73a 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Diagnostics/CodeCheckService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Diagnostics/CodeCheckService.cs @@ -33,11 +33,11 @@ public async Task Handle(CodeCheckRequest request) var semanticModel = await document.GetSemanticModelAsync(); IEnumerable diagnostics = semanticModel.GetDiagnostics(); - //script files can have custom directives such as #load which will be deemed invalid by Roslyn - //we suppress the CS1024 diagnostic for script files for this reason. Roslyn will fix it later too, so this is temporary. if (document.SourceCodeKind != SourceCodeKind.Regular) { - diagnostics = diagnostics.Where(diagnostic => diagnostic.Id != "CS1024"); + // CS8099 needs to be surpressed so that we can use #load directives in scripts + // additionally, we need to suppress CS1701: https://github.com/dotnet/roslyn/issues/5501 + diagnostics = diagnostics.Where(diagnostic => diagnostic.Id != "CS8099" && diagnostic.Id != "CS1701"); } foreach (var quickFix in diagnostics.Select(MakeQuickFix)) diff --git a/src/OmniSharp.Script/FileParser.cs b/src/OmniSharp.Script/FileParser.cs new file mode 100644 index 0000000000..69928e94c1 --- /dev/null +++ b/src/OmniSharp.Script/FileParser.cs @@ -0,0 +1,57 @@ +using System.IO; +using System.Linq; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; + +namespace OmniSharp.Script +{ + public class FileParser + { + public static FileParserResult ProcessFile(string path, CSharpParseOptions parseOptions) + { + var result = new FileParserResult(); + ParseFile(path, result, parseOptions); + return result; + } + + private static void ParseFile(string path, FileParserResult result, CSharpParseOptions parseOptions) + { + var fullPath = Path.GetFullPath(path); + if (result.LoadedScripts.Contains(fullPath)) + { + return; + } + + result.LoadedScripts.Add(fullPath); + + var scriptCode = File.ReadAllText(fullPath); + + var syntaxTree = CSharpSyntaxTree.ParseText(scriptCode, parseOptions); + + var namespaces = syntaxTree.GetCompilationUnitRoot().Usings.Select(x => x.Name.ToString()); + foreach (var ns in namespaces) + { + result.Namespaces.Add(ns.Trim()); + } + + var refs = syntaxTree.GetCompilationUnitRoot().GetReferenceDirectives().Select(x => x.File.ToString()); + foreach (var reference in refs) + { + result.References.Add(reference.Replace("\"", string.Empty)); + } + + var loads = syntaxTree.GetCompilationUnitRoot().GetLoadDirectives().Select(x => x.File.ToString()); + foreach (var load in loads) + { + var filePath = load.Replace("\"", string.Empty); + var currentWorkingDirectory = Path.GetDirectoryName(fullPath); + + var loadFullPath = Path.IsPathRooted(filePath) ? filePath : Path.Combine(currentWorkingDirectory, filePath); + if (!string.IsNullOrWhiteSpace(loadFullPath)) + { + ParseFile(loadFullPath, result, parseOptions); + } + } + } + } +} \ No newline at end of file diff --git a/src/OmniSharp.Script/FileParserResult.cs b/src/OmniSharp.Script/FileParserResult.cs new file mode 100644 index 0000000000..5c14ffcda1 --- /dev/null +++ b/src/OmniSharp.Script/FileParserResult.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace OmniSharp.Script +{ + public class FileParserResult + { + public HashSet Namespaces { get; } = new HashSet(); + public HashSet References { get; } = new HashSet(); + public HashSet LoadedScripts { get; } = new HashSet(); + } +} \ No newline at end of file diff --git a/src/OmniSharp.ScriptCs/OmniSharp.ScriptCs.xproj b/src/OmniSharp.Script/OmniSharp.Script.xproj similarity index 95% rename from src/OmniSharp.ScriptCs/OmniSharp.ScriptCs.xproj rename to src/OmniSharp.Script/OmniSharp.Script.xproj index 189e43bd55..b7dfe5572d 100644 --- a/src/OmniSharp.ScriptCs/OmniSharp.ScriptCs.xproj +++ b/src/OmniSharp.Script/OmniSharp.Script.xproj @@ -7,7 +7,7 @@ f52f6f60-ab29-414d-a24b-de8effba34c0 - OmniSharp.ScriptCs + OmniSharp.Script ..\..\artifacts\obj\$(MSBuildProjectName) .\bin\ diff --git a/src/OmniSharp.ScriptCs/ScriptCsContext.cs b/src/OmniSharp.Script/ScriptContext.cs similarity index 73% rename from src/OmniSharp.ScriptCs/ScriptCsContext.cs rename to src/OmniSharp.Script/ScriptContext.cs index 9612342739..b49363cb25 100644 --- a/src/OmniSharp.ScriptCs/ScriptCsContext.cs +++ b/src/OmniSharp.Script/ScriptContext.cs @@ -1,27 +1,24 @@ +using System; using System.Collections.Generic; using System.Composition; +using System.Reflection; using Microsoft.CodeAnalysis; -namespace OmniSharp.ScriptCs +namespace OmniSharp.Script { [Export, Shared] - public class ScriptCsContext + public class ScriptContext { public HashSet CsxFilesBeingProcessed { get; } = new HashSet(); // All of the followings are keyed with the file path // Each .csx file is wrapped into a project public Dictionary CsxFileProjects { get; } = new Dictionary(); - public Dictionary> CsxReferences { get; } = new Dictionary>(); + public Dictionary> CsxReferences { get; } = new Dictionary>(); public Dictionary> CsxLoadReferences { get; } = new Dictionary>(); public Dictionary> CsxUsings { get; } = new Dictionary>(); - - public HashSet ScriptPacks { get; } = new HashSet(); - - // Nuget and ScriptPack stuff public HashSet CommonReferences { get; } = new HashSet(); - public HashSet CommonUsings { get; } = new HashSet(); - + public HashSet CommonUsings { get; } = new HashSet { "System" }; public string RootPath { get; set; } } } diff --git a/src/OmniSharp.ScriptCs/ScriptCsContextModel.cs b/src/OmniSharp.Script/ScriptContextModel.cs similarity index 85% rename from src/OmniSharp.ScriptCs/ScriptCsContextModel.cs rename to src/OmniSharp.Script/ScriptContextModel.cs index 4d07bd44b7..005815a555 100644 --- a/src/OmniSharp.ScriptCs/ScriptCsContextModel.cs +++ b/src/OmniSharp.Script/ScriptContextModel.cs @@ -2,11 +2,11 @@ using System.Linq; using OmniSharp.Roslyn.Models; -namespace OmniSharp.ScriptCs +namespace OmniSharp.Script { - public class ScriptCsContextModel + public class ScriptContextModel { - public ScriptCsContextModel(ScriptCsContext context) + public ScriptContextModel(ScriptContext context) { RootPath = context.RootPath; CsxFilesBeingProcessed = context.CsxFilesBeingProcessed; @@ -14,7 +14,6 @@ public ScriptCsContextModel(ScriptCsContext context) CsxReferences = context.CsxReferences.ToDictionary(x => x.Key, x => x.Value.Select(z => new ReferenceModel(z))); CsxLoadReferences = context.CsxLoadReferences.ToDictionary(x => x.Key, x => x.Value.Select(z => new ProjectInfoModel(z))); CsxUsings = context.CsxUsings.ToDictionary(x => x.Key, x => x.Value.AsEnumerable()); - ScriptPacks = context.ScriptPacks; CommonReferences = context.CommonReferences.Select(z => new ReferenceModel(z)); CommonUsings = context.CommonUsings; } @@ -27,13 +26,8 @@ public ScriptCsContextModel(ScriptCsContext context) public Dictionary> CsxReferences { get; } public Dictionary> CsxLoadReferences { get; } public Dictionary> CsxUsings { get; } - - public HashSet ScriptPacks { get; } - - // Nuget and ScriptPack stuff public IEnumerable CommonReferences { get; } public IEnumerable CommonUsings { get; } - public string RootPath { get; set; } } } diff --git a/src/OmniSharp.ScriptCs/ScriptCsProjectSystem.cs b/src/OmniSharp.Script/ScriptProjectSystem.cs similarity index 55% rename from src/OmniSharp.ScriptCs/ScriptCsProjectSystem.cs rename to src/OmniSharp.Script/ScriptProjectSystem.cs index 03fffd4ec3..e868277bba 100644 --- a/src/OmniSharp.ScriptCs/ScriptCsProjectSystem.cs +++ b/src/OmniSharp.Script/ScriptProjectSystem.cs @@ -6,50 +6,40 @@ using System.Linq; using System.Reflection; using System.Threading.Tasks; -using Common.Logging; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.Scripting.Hosting; using Microsoft.CodeAnalysis.Text; +using Microsoft.DotNet.ProjectModel; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyModel; using Microsoft.Extensions.Logging; using OmniSharp.Models.v1; -using OmniSharp.ScriptCs.Extensions; +using OmniSharp.Roslyn.Models; using OmniSharp.Services; -using ScriptCs; -using ScriptCs.Contracts; -using ScriptCs.Hosting; -using LogLevel = ScriptCs.Contracts.LogLevel; -namespace OmniSharp.ScriptCs +namespace OmniSharp.Script { - [Export(typeof(IProjectSystem))] - public class ScriptCsProjectSystem : IProjectSystem + [Export(typeof(IProjectSystem)), Shared] + public class ScriptProjectSystem : IProjectSystem { - private static readonly string BaseAssemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location); - CSharpParseOptions CsxParseOptions { get; } = new CSharpParseOptions(LanguageVersion.CSharp6, DocumentationMode.Parse, SourceCodeKind.Script); - IEnumerable DotNetBaseReferences { get; } = new[] - { - MetadataReference.CreateFromFile(typeof(object).GetTypeInfo().Assembly.Location), // mscorlib - MetadataReference.CreateFromFile(typeof(Enumerable).GetTypeInfo().Assembly.Location), // systemCore - MetadataReference.CreateFromFile(typeof(IScriptHost).Assembly.Location) // scriptcsContracts - }; - - OmnisharpWorkspace Workspace { get; } - IOmnisharpEnvironment Env { get; } - ScriptCsContext Context { get; } - ILogger Logger { get; } + private CSharpParseOptions CsxParseOptions { get; } = new CSharpParseOptions(LanguageVersion.Default, DocumentationMode.Parse, SourceCodeKind.Script); + private OmnisharpWorkspace Workspace { get; } + private IOmnisharpEnvironment Env { get; } + private ScriptContext Context { get; } + private ILogger Logger { get; } [ImportingConstructor] - public ScriptCsProjectSystem(OmnisharpWorkspace workspace, IOmnisharpEnvironment env, ILoggerFactory loggerFactory, ScriptCsContext scriptCsContext) + public ScriptProjectSystem(OmnisharpWorkspace workspace, IOmnisharpEnvironment env, ILoggerFactory loggerFactory, ScriptContext scriptContext) { Workspace = workspace; Env = env; - Context = scriptCsContext; - Logger = loggerFactory.CreateLogger(); + Context = scriptContext; + Logger = loggerFactory.CreateLogger(); } - public string Key { get { return "ScriptCs"; } } - public string Language { get { return LanguageNames.CSharp; } } + public string Key => "Script"; + public string Language => LanguageNames.CSharp; public IEnumerable Extensions { get; } = new[] { ".csx" }; public void Initalize(IConfiguration configuration) @@ -67,40 +57,55 @@ public void Initalize(IConfiguration configuration) Context.RootPath = Env.Path; Logger.LogInformation($"Found {allCsxFiles.Length} CSX files."); - // TODO: write and adapter to implement the new ScriptCs ILogProvider interface - #pragma warning disable 0618 - //script name is added here as a fake one (dir path not even a real file); this is OK though -> it forces MEF initialization - var baseScriptServicesBuilder = new ScriptServicesBuilder(new ScriptConsole(), LogManager.GetCurrentClassLogger()) - .LogLevel(LogLevel.Debug) - .Cache(false) - .Repl(false) - .ScriptName(Env.Path) - .ScriptEngine(); + // explicitly inherit scripting library references to all global script object (InteractiveScriptGlobals) to be recognized + var inheritedCompileLibraries = DependencyContext.Default.CompileLibraries.Where(x => + x.Name.ToLowerInvariant().StartsWith("microsoft.codeanalysis")).ToList(); - var scriptServices = baseScriptServicesBuilder.Build(); + var runtimeContexts = File.Exists(Path.Combine(Env.Path, "project.json")) ? ProjectContext.CreateContextForEachTarget(Env.Path) : null; - var scriptPacks = scriptServices.ScriptPackResolver.GetPacks().ToList(); - var assemblyPaths = scriptServices.AssemblyResolver.GetAssemblyPaths(Env.Path); - - // Common usings and references - Context.CommonUsings.UnionWith(ScriptExecutor.DefaultNamespaces); + // if we have no context, then we also have no dependencies + // we can assume desktop framework + // and add mscorlib + if (runtimeContexts?.Any() == false) + { + Logger.LogInformation("Unable to find project context for CSX files. Will default to non-context usage."); + Context.CommonReferences.Add(MetadataReference.CreateFromFile(typeof(object).GetTypeInfo().Assembly.Location)); + Context.CommonReferences.Add(MetadataReference.CreateFromFile(typeof(Enumerable).GetTypeInfo().Assembly.Location)); + inheritedCompileLibraries.AddRange(DependencyContext.Default.CompileLibraries.Where(x => + x.Name.ToLowerInvariant().StartsWith("system.runtime"))); + } + // otherwise we will grab dependencies for the script from the runtime context + else + { + // assume the first one + var runtimeContext = runtimeContexts.First(); + Logger.LogInformation($"Found script runtime context '{runtimeContext?.TargetFramework.Framework}' for '{runtimeContext.ProjectFile.ProjectFilePath}'."); - Context.CommonReferences.UnionWith(DotNetBaseReferences); - Context.CommonReferences.UnionWith(scriptServices.MakeMetadataReferences(ScriptExecutor.DefaultReferences)); // ScriptCs defaults - Context.CommonReferences.UnionWith(scriptServices.MakeMetadataReferences(assemblyPaths)); // nuget references + var projectExporter = runtimeContext.CreateExporter("Release"); + var projectDependencies = projectExporter.GetDependencies(); - if (scriptPacks != null && scriptPacks.Any()) - { - var scriptPackSession = new ScriptPackSession(scriptPacks, new string[0]); - scriptPackSession.InitializePacks(); + // let's inject all compilation assemblies needed + var compilationAssemblies = projectDependencies.SelectMany(x => x.CompilationAssemblies); + foreach (var compilationAssembly in compilationAssemblies) + { + Logger.LogDebug("Discovered script compilation assembly reference: " + compilationAssembly.ResolvedPath); + Context.CommonReferences.Add(MetadataReference.CreateFromFile(compilationAssembly.ResolvedPath)); + } - //script pack references - Context.CommonReferences.UnionWith(scriptServices.MakeMetadataReferences(scriptPackSession.References)); + // for non .NET Core, include System.Runtime + if (runtimeContext.TargetFramework.Framework != ".NETCoreApp") + { + inheritedCompileLibraries.AddRange(DependencyContext.Default.CompileLibraries.Where(x => + x.Name.ToLowerInvariant().StartsWith("system.runtime"))); + } - //script pack usings - Context.CommonUsings.UnionWith(scriptPackSession.Namespaces); + } - Context.ScriptPacks.UnionWith(scriptPackSession.Contexts.Select(pack => pack.GetType().ToString())); + // inject all inherited assemblies + foreach (var inheritedCompileLib in inheritedCompileLibraries.SelectMany(x => x.ResolveReferencePaths())) + { + Logger.LogDebug("Adding implicit reference: " + inheritedCompileLib); + Context.CommonReferences.Add(MetadataReference.CreateFromFile(inheritedCompileLib)); } // Process each .CSX file @@ -108,7 +113,7 @@ public void Initalize(IConfiguration configuration) { try { - CreateCsxProject(csxPath, baseScriptServicesBuilder); + CreateCsxProject(csxPath); } catch (Exception ex) { @@ -123,7 +128,7 @@ public void Initalize(IConfiguration configuration) /// Each .csx file is to be wrapped in its own project. /// This recursive function does a depth first traversal of the .csx files, following #load references /// - private ProjectInfo CreateCsxProject(string csxPath, IScriptServicesBuilder baseBuilder) + private ProjectInfo CreateCsxProject(string csxPath) { // Circular #load chains are not allowed if (Context.CsxFilesBeingProcessed.Contains(csxPath)) @@ -137,29 +142,27 @@ private ProjectInfo CreateCsxProject(string csxPath, IScriptServicesBuilder base return Context.CsxFileProjects[csxPath]; } - // Process the file with ScriptCS first Logger.LogInformation($"Processing script {csxPath}..."); Context.CsxFilesBeingProcessed.Add(csxPath); - var localScriptServices = baseBuilder.ScriptName(csxPath).Build(); - var processResult = localScriptServices.FilePreProcessor.ProcessFile(csxPath); + + var processResult = FileParser.ProcessFile(csxPath, CsxParseOptions); // CSX file usings - Context.CsxUsings[csxPath] = processResult.Namespaces.ToList(); + Context.CsxUsings[csxPath] = processResult.Namespaces.Union(Context.CommonUsings).ToList(); var compilationOptions = new CSharpCompilationOptions( outputKind: OutputKind.DynamicallyLinkedLibrary, - usings: Context.CommonUsings.Union(Context.CsxUsings[csxPath])); + usings: Context.CsxUsings[csxPath]); // #r refernces - Context.CsxReferences[csxPath] = localScriptServices.MakeMetadataReferences(processResult.References).ToList(); + Context.CsxReferences[csxPath] = processResult.References.Select(x => MetadataReference.CreateFromFile(x)).ToList(); - //#load references recursively Context.CsxLoadReferences[csxPath] = processResult .LoadedScripts .Distinct() - .Except(new[] { csxPath }) - .Select(loadedCsxPath => CreateCsxProject(loadedCsxPath, baseBuilder)) + .Except(new[] {csxPath}) + .Select(loadedCsxPath => CreateCsxProject(loadedCsxPath)) .ToList(); // Create the wrapper project and add it to the workspace @@ -176,7 +179,7 @@ private ProjectInfo CreateCsxProject(string csxPath, IScriptServicesBuilder base metadataReferences: Context.CommonReferences.Union(Context.CsxReferences[csxPath]), projectReferences: Context.CsxLoadReferences[csxPath].Select(p => new ProjectReference(p.Id)), isSubmission: true, - hostObjectType: typeof(IScriptHost)); + hostObjectType: typeof(InteractiveScriptGlobals)); Workspace.AddProject(project); AddFile(csxPath, project.Id); @@ -193,7 +196,6 @@ private ProjectInfo CreateCsxProject(string csxPath, IScriptServicesBuilder base return project; } - private void AddFile(string filePath, ProjectId projectId) { using (var stream = File.OpenRead(filePath)) @@ -217,7 +219,7 @@ Task IProjectSystem.GetProjectModelAsync(string filePath) Task IProjectSystem.GetWorkspaceModelAsync(WorkspaceInformationRequest request) { - return Task.FromResult(new ScriptCsContextModel(Context)); + return Task.FromResult(new ScriptContextModel(Context)); } } } diff --git a/src/OmniSharp.Script/project.json b/src/OmniSharp.Script/project.json new file mode 100644 index 0000000000..b60f4dbd88 --- /dev/null +++ b/src/OmniSharp.Script/project.json @@ -0,0 +1,37 @@ +{ + "version": "1.0.0-*", + "buildOptions": { + "warningsAsErrors": true + }, + "dependencies": { + "OmniSharp.Abstractions": "1.0.0", + "OmniSharp.Roslyn.CSharp": "1.0.0", + "Microsoft.DotNet.ProjectModel": "1.0.0-rc3-003121", + "Microsoft.CodeAnalysis.CSharp.Scripting": "2.0.0-rc" + }, + "frameworks": { + "net46": { + "frameworkAssemblies": { + "System.Runtime": "", + "System.Threading": "", + "System.Threading.Tasks": "", + "System.Collections": "", + "System.Globalization": "", + "System.Linq": "", + "System.Text.Encoding": "", + "System.Reflection": "", + "System.Security": "", + "System.Xml": "" + } + }, + "netstandard1.6": { + "imports": [ + "dotnet5.4", + "portable-net45+win8" + ], + "dependencies": { + "NETStandard.Library": "1.6.0" + } + } + } +} \ No newline at end of file diff --git a/src/OmniSharp.ScriptCs/Extensions/ScriptcsExtensions.cs b/src/OmniSharp.ScriptCs/Extensions/ScriptcsExtensions.cs deleted file mode 100644 index ac98f9fbe5..0000000000 --- a/src/OmniSharp.ScriptCs/Extensions/ScriptcsExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.CodeAnalysis; -using ScriptCs; - -namespace OmniSharp.ScriptCs.Extensions -{ - internal static class ScriptcsExtensions - { - private static readonly string BaseAssemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location); - - internal static IEnumerable MakeMetadataReferences(this ScriptServices scriptServices, IEnumerable referencesPaths) - { - var listOfReferences = new List(); - foreach (var importedReference in referencesPaths.Where(x => !x.ToLowerInvariant().Contains("scriptcs.contracts"))) - { - if (scriptServices.FileSystem.IsPathRooted(importedReference)) - { - if (scriptServices.FileSystem.FileExists(importedReference)) - listOfReferences.Add(MetadataReference.CreateFromFile(importedReference)); - } - else - { - listOfReferences.Add(MetadataReference.CreateFromFile(Path.Combine(BaseAssemblyPath, importedReference.ToLower().EndsWith(".dll") ? importedReference : importedReference + ".dll"))); - } - } - - return listOfReferences; - } - } -} diff --git a/src/OmniSharp.ScriptCs/NullScriptEngine.cs b/src/OmniSharp.ScriptCs/NullScriptEngine.cs deleted file mode 100644 index bd24a267a8..0000000000 --- a/src/OmniSharp.ScriptCs/NullScriptEngine.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using ScriptCs.Contracts; - -namespace OmniSharp.ScriptCs -{ - public class NullScriptEngine : IScriptEngine - { - public string BaseDirectory { get; set; } - - public string CacheDirectory { get; set; } - - public string FileName { get; set; } - - public ScriptResult Execute(string code, string[] scriptArgs, AssemblyReferences references, IEnumerable namespaces, ScriptPackSession scriptPackSession) - { - return new ScriptResult(); - } - } -} diff --git a/src/OmniSharp.ScriptCs/project.json b/src/OmniSharp.ScriptCs/project.json deleted file mode 100644 index 65b7a8a251..0000000000 --- a/src/OmniSharp.ScriptCs/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "warningsAsErrors": true - }, - "dependencies": { - "OmniSharp.Abstractions": "1.0.0", - "OmniSharp.Roslyn.CSharp": "1.0.0" - }, - "frameworks": { - "net46": { - "dependencies": { - "ScriptCs.Hosting": "0.16.1", - "Microsoft.Web.Xdt": "2.1.1", - "NuGet.Core": "2.10.1" - } - } - } -} \ No newline at end of file diff --git a/src/OmniSharp/project.json b/src/OmniSharp/project.json index 27e90300eb..a8346f4242 100644 --- a/src/OmniSharp/project.json +++ b/src/OmniSharp/project.json @@ -17,14 +17,11 @@ "OmniSharp.Roslyn.CSharp": "1.0.0", "OmniSharp.DotNet": "1.0.0", "OmniSharp.DotNetTest": "1.0.0", - "OmniSharp.MSBuild": "1.0.0" + "OmniSharp.MSBuild": "1.0.0", + "OmniSharp.Script": "1.0.0" }, "frameworks": { - "net46": { - "dependencies": { - "OmniSharp.ScriptCs": "1.0.0" - } - }, + "net46": {}, "netcoreapp1.0": { "imports": [ "dotnet5.4",