[closes gh-71] Added xml docs to all public API.
This commit is contained in:
Родитель
b995baa9d2
Коммит
5d5b99134f
|
@ -10,7 +10,7 @@ insert_final_newline = false
|
|||
[*.cs]
|
||||
csharp_new_line_before_open_brace = none
|
||||
|
||||
[*.{html,config,csproj}]
|
||||
[*.{html,config,csproj,props}]
|
||||
indent_size = 2
|
||||
|
||||
[project.json]
|
||||
|
|
|
@ -2,22 +2,73 @@
|
|||
using JetBrains.Annotations;
|
||||
|
||||
namespace MirrorSharp.Advanced {
|
||||
/// <summary>
|
||||
/// JSON writer used to communicate with MirrorSharp clients.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// At the moment the output is not actively validated --
|
||||
/// writer can produce invalid JSON if not used carefully.
|
||||
/// </remarks>
|
||||
[PublicAPI]
|
||||
public interface IFastJsonWriter : IDisposable {
|
||||
/// <summary>Opens a new JSON object (<c>{</c>).</summary>
|
||||
void WriteStartObject();
|
||||
|
||||
/// <summary>Closes current JSON object (<c>}</c>).</summary>
|
||||
void WriteEndObject();
|
||||
|
||||
/// <summary>Opens an new JSON array (<c>[</c>).</summary>
|
||||
void WriteStartArray();
|
||||
|
||||
/// <summary>Closes current JSON array (<c>]</c>).</summary>
|
||||
void WriteEndArray();
|
||||
|
||||
/// <summary>Writes a new JSON property with a string value (e.g. <c>"name": "value"</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
/// <param name="value">Value of the property to write; can be null.</param>
|
||||
void WriteProperty([NotNull] string name, [CanBeNull] string value);
|
||||
|
||||
/// <summary>Writes a new JSON property with a single-character string value (e.g. <c>"name": "c"</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
/// <param name="value">Value of the property to write.</param>
|
||||
void WriteProperty([NotNull] string name, char value);
|
||||
|
||||
/// <summary>Writes a new JSON property with an integer value (e.g. <c>"name": 1</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
/// <param name="value">Value of the property to write.</param>
|
||||
void WriteProperty([NotNull] string name, int value);
|
||||
|
||||
/// <summary>Writes a new JSON property with a boolean value (e.g. <c>"name": true</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
/// <param name="value">Value of the property to write.</param>
|
||||
void WriteProperty([NotNull] string name, bool value);
|
||||
|
||||
/// <summary>Writes a new JSON property and opens its object value (e.g. <c>"name": {</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
void WritePropertyStartObject([NotNull] string name);
|
||||
|
||||
/// <summary>Writes a new JSON property and opens its array value (e.g. <c>"name": [</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
void WritePropertyStartArray([NotNull] string name);
|
||||
|
||||
/// <summary>Writes a new JSON property name (e.g. <c>"name":</c>).</summary>
|
||||
/// <param name="name">Name of the property to write.</param>
|
||||
void WritePropertyName([NotNull] string name);
|
||||
void WriteValue([CanBeNull] string value);
|
||||
|
||||
/// <summary>Writes string value as a JSON string.</summary>
|
||||
/// <param name="value">Value to write; can be null.</param>
|
||||
void WriteValue([CanBeNull] string value);
|
||||
|
||||
/// <summary>Writes char value as a JSON string.</summary>
|
||||
/// <param name="value">Value to write.</param>
|
||||
void WriteValue(char value);
|
||||
|
||||
/// <summary>Writes int value as a JSON number.</summary>
|
||||
/// <param name="value">Value to write.</param>
|
||||
void WriteValue(int value);
|
||||
|
||||
/// <summary>Writes bool value as a JSON boolean.</summary>
|
||||
/// <param name="value">Value to write.</param>
|
||||
void WriteValue(bool value);
|
||||
}
|
||||
}
|
|
@ -2,8 +2,10 @@
|
|||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace MirrorSharp.Advanced {
|
||||
/// <summary>Represents a user session based on Roslyn.</summary>
|
||||
[PublicAPI]
|
||||
public interface IRoslynSession {
|
||||
/// <summary>Roslyn <see cref="Microsoft.CodeAnalysis.Project"/> associated with the current session.</summary>
|
||||
[PublicAPI, NotNull] Project Project { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
namespace MirrorSharp.Advanced {
|
||||
/// <summary>An interface used to implement custom (extension) options.</summary>
|
||||
public interface ISetOptionsFromClientExtension {
|
||||
/// <summary>Method called each time MirrorSharp encounters an extension option (<c>x-*</c>).</summary>
|
||||
/// <param name="session">Current <see cref="IWorkSession" />.</param>
|
||||
/// <param name="name">Name of the extension option; always starts with 'x-'.</param>
|
||||
/// <param name="value">Value of the extension option, as provided by the client.</param>
|
||||
/// <returns><c>true</c> if extension options is recognized; otherwise, <c>false</c>.</returns>
|
||||
bool TrySetOption(IWorkSession session, string name, string value);
|
||||
}
|
||||
}
|
|
@ -5,9 +5,19 @@ using JetBrains.Annotations;
|
|||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace MirrorSharp.Advanced {
|
||||
/// <summary>An interface used to implement periodic custom processing.</summary>
|
||||
[PublicAPI]
|
||||
public interface ISlowUpdateExtension {
|
||||
/// <summary>Method called by MirrorSharp periodically (e.g. each 500ms), if there were any changes.</summary>
|
||||
/// <param name="session">Current <see cref="IWorkSession" />.</param>
|
||||
/// <param name="diagnostics">Current diagnostics. <see cref="ProcessAsync" /> can add extra diagnosics if needed.</param>
|
||||
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that MirrorSharp can use to cancel processing.</param>
|
||||
/// <returns>Any object; result will be passed to <see cref="WriteResult" />.</returns>
|
||||
[NotNull, ItemCanBeNull] Task<object> ProcessAsync([NotNull] IWorkSession session, IList<Diagnostic> diagnostics, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>Called after <see cref="ProcessAsync" />; writes its result to the client if required.</summary>
|
||||
/// <param name="writer"><see cref="IFastJsonWriter"/> used to write the result.</param>
|
||||
/// <param name="result">Result returned by <see cref="ProcessAsync" />.</param>
|
||||
void WriteResult([NotNull] IFastJsonWriter writer, [CanBeNull] object result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,14 @@
|
|||
using JetBrains.Annotations;
|
||||
|
||||
namespace MirrorSharp.Advanced {
|
||||
/// <summary>Represents an active user session.</summary>
|
||||
[PublicAPI]
|
||||
public interface IWorkSession {
|
||||
/// <summary>Specifies whether the current session is based on Roslyn.</summary>
|
||||
bool IsRoslyn { get; }
|
||||
/// <summary>Returns associated Roslyn session if any; throws otherwise.</summary>
|
||||
[NotNull] IRoslynSession Roslyn { get; }
|
||||
|
||||
/// <summary>Arbitrary data associated with the user session.</summary>
|
||||
[NotNull] IDictionary<string, object> ExtensionData { get; }
|
||||
}
|
||||
}
|
|
@ -3,6 +3,9 @@ using JetBrains.Annotations;
|
|||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace MirrorSharp.Advanced {
|
||||
/// <summary>Base class for Roslyn-based language options. Should not be used directly.</summary>
|
||||
/// <typeparam name="TParseOptions">Type of <see cref="ParseOptions" /> for this language.</typeparam>
|
||||
/// <typeparam name="TCompilationOptions">Type of <see cref="CompilationOptions" /> for this language.</typeparam>
|
||||
[PublicAPI]
|
||||
public class MirrorSharpRoslynOptions<TParseOptions, TCompilationOptions>
|
||||
where TParseOptions : ParseOptions
|
||||
|
@ -22,18 +25,21 @@ namespace MirrorSharp.Advanced {
|
|||
_metadataReferences = metadataReferences;
|
||||
}
|
||||
|
||||
/// <summary><see cref="ParseOptions" /> for this language.</summary>
|
||||
[NotNull]
|
||||
public TParseOptions ParseOptions {
|
||||
get => _parseOptions;
|
||||
set => _parseOptions = Argument.NotNull(nameof(value), value);
|
||||
}
|
||||
|
||||
/// <summary><see cref="CompilationOptions" /> for this language.</summary>
|
||||
[NotNull]
|
||||
public TCompilationOptions CompilationOptions {
|
||||
get => _compilationOptions;
|
||||
set => _compilationOptions = Argument.NotNull(nameof(value), value);
|
||||
}
|
||||
|
||||
/// <summary><see cref="MetadataReference" />s for this language.</summary>
|
||||
[NotNull]
|
||||
public ImmutableList<MetadataReference> MetadataReferences {
|
||||
get => _metadataReferences;
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="../NuGet.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>MirrorSharp shared server library. MirrorSharp is a code editor <textarea> built on Roslyn — see https://github.com/ashmind/mirrorsharp/blob/master/README.md for details.</Description>
|
||||
<VersionPrefix>0.9.0-pre-20170522</VersionPrefix>
|
||||
<Authors>Andrey Shchekin</Authors>
|
||||
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
|
||||
<AssemblyName>MirrorSharp.Common</AssemblyName>
|
||||
<PackageId>MirrorSharp.Common</PackageId>
|
||||
<PackageTags>Roslyn;CodeMirror</PackageTags>
|
||||
<PackageProjectUrl>https://github.com/ashmind/mirrorsharp</PackageProjectUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/ashmind/mirrorsharp.git</RepositoryUrl>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;portable-net45+win8</PackageTargetFallback>
|
||||
<RootNamespace>MirrorSharp</RootNamespace>
|
||||
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
|
||||
<VersionPrefix>0.9.0-pre-20170523</VersionPrefix>
|
||||
<Description>MirrorSharp shared server library. $(DescriptionSuffix)</Description>
|
||||
<PackageTags>Roslyn;CodeMirror</PackageTags>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;portable-net45+win8</PackageTargetFallback>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="10.4.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="2.0.0" />
|
||||
|
@ -34,6 +30,10 @@
|
|||
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DocumentationFile>$(OutDir)\MirrorSharp.Common.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System" />
|
||||
|
|
|
@ -6,12 +6,11 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using MirrorSharp.Internal;
|
||||
using MirrorSharp.Internal.Handlers;
|
||||
using MirrorSharp.Internal.Handlers.Shared;
|
||||
|
||||
namespace MirrorSharp.Advanced {
|
||||
public abstract class MiddlewareBase {
|
||||
namespace MirrorSharp.Internal {
|
||||
internal abstract class MiddlewareBase {
|
||||
[NotNull] private readonly LanguageManager _languageManager;
|
||||
[NotNull] private readonly MirrorSharpOptions _options;
|
||||
[ItemNotNull] private readonly ImmutableArray<ICommandHandler> _handlers;
|
|
@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using MirrorSharp.Advanced;
|
||||
|
||||
namespace MirrorSharp {
|
||||
/// <summary>MirrorSharp options for C#</summary>
|
||||
public class MirrorSharpCSharpOptions : MirrorSharpRoslynOptions<CSharpParseOptions, CSharpCompilationOptions> {
|
||||
internal MirrorSharpCSharpOptions() : base(
|
||||
new CSharpParseOptions(),
|
||||
|
|
|
@ -8,21 +8,34 @@ using MirrorSharp.Internal.Abstraction;
|
|||
using MirrorSharp.Internal.Roslyn;
|
||||
|
||||
namespace MirrorSharp {
|
||||
/// <summary>MirrorSharp options object.</summary>
|
||||
[PublicAPI]
|
||||
public sealed class MirrorSharpOptions : IConnectionOptions, IWorkSessionOptions, ILanguageManagerOptions {
|
||||
[NotNull] internal IDictionary<string, Func<ILanguage>> Languages { get; } = new Dictionary<string, Func<ILanguage>>();
|
||||
|
||||
/// <summary>Creates a new instance of <see cref="MirrorSharpOptions" />.</summary>
|
||||
public MirrorSharpOptions() {
|
||||
Languages.Add(LanguageNames.CSharp, () => new CSharpLanguage(CSharp));
|
||||
}
|
||||
|
||||
/// <summary>MirrorSharp options for C#.</summary>
|
||||
/// <remarks>These options are ignored if <see cref="DisableCSharp" /> was called.</remarks>
|
||||
[NotNull] public MirrorSharpCSharpOptions CSharp { get; } = new MirrorSharpCSharpOptions();
|
||||
[CanBeNull] public ISlowUpdateExtension SlowUpdate { get; set; }
|
||||
|
||||
/// <summary>Defines a <see cref="ISetOptionsFromClientExtension" /> used to support extra options.</summary>
|
||||
[CanBeNull] public ISetOptionsFromClientExtension SetOptionsFromClient { get; set; }
|
||||
|
||||
/// <summary>Defines a <see cref="ISlowUpdateExtension" /> used to extend periodic processing.</summary>
|
||||
[CanBeNull] public ISlowUpdateExtension SlowUpdate { get; set; }
|
||||
|
||||
/// <summary>Defines whether the exceptions should include full details (messages, stack traces).</summary>
|
||||
public bool IncludeExceptionDetails { get; set; }
|
||||
|
||||
/// <summary>Defines whether the SelfDebug mode is enabled — might reduce performance.</summary>
|
||||
public bool SelfDebugEnabled { get; set; }
|
||||
|
||||
/// <summary>Disables C# — the language will not be available to the client.</summary>
|
||||
/// <returns>Current <see cref="MirrorSharpOptions" /> object, for convenience.</returns>
|
||||
public MirrorSharpOptions DisableCSharp() {
|
||||
Languages.Remove(LanguageNames.CSharp);
|
||||
return this;
|
||||
|
|
|
@ -3,8 +3,16 @@ using JetBrains.Annotations;
|
|||
using MirrorSharp.FSharp.Internal;
|
||||
|
||||
namespace MirrorSharp.FSharp.Advanced {
|
||||
/// <summary>Represents a configuration endpoint for F# virtual filesystem.</summary>
|
||||
[PublicAPI]
|
||||
public static class FSharpFileSystem {
|
||||
[NotNull] public static FSharpVirtualFile RegisterVirtualFile([NotNull] MemoryStream stream) => CustomFileSystem.Instance.RegisterVirtualFile(stream);
|
||||
/// <summary>Registers a new virtual file with unique name in the F# filesystem.</summary>
|
||||
/// <param name="stream"><see cref="MemoryStream" /> representing the content of the file.</param>
|
||||
/// <returns><see cref="FSharpVirtualFile" /> object that provides the unique name and allows deregistration.</returns>
|
||||
/// <remarks><see cref="FSharpVirtualFile.Dispose()" /> should be used to deregister the file.</remarks>
|
||||
[NotNull] public static FSharpVirtualFile RegisterVirtualFile([NotNull] MemoryStream stream) {
|
||||
Argument.NotNull(nameof(stream), stream);
|
||||
return CustomFileSystem.Instance.RegisterVirtualFile(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,17 @@
|
|||
using Microsoft.FSharp.Compiler.SourceCodeServices;
|
||||
|
||||
namespace MirrorSharp.FSharp.Advanced {
|
||||
/// <summary>Represent combined Parse and Check results from the <see cref="FSharpChecker" />.</summary>
|
||||
public class FSharpParseAndCheckResults {
|
||||
public FSharpParseAndCheckResults(FSharpParseFileResults parseResults, FSharpCheckFileAnswer checkAnswer) {
|
||||
internal FSharpParseAndCheckResults(FSharpParseFileResults parseResults, FSharpCheckFileAnswer checkAnswer) {
|
||||
ParseResults = parseResults;
|
||||
CheckAnswer = checkAnswer;
|
||||
}
|
||||
|
||||
/// <summary>Gets the Parse results.</summary>
|
||||
[NotNull] public FSharpParseFileResults ParseResults { get; }
|
||||
|
||||
/// <summary>Gets the Check answer.</summary>
|
||||
[NotNull] public FSharpCheckFileAnswer CheckAnswer { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.IO;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace MirrorSharp.FSharp.Advanced {
|
||||
/// <summary>Represents a virtual (in-memory) file within <see cref="FSharpFileSystem" />.</summary>
|
||||
[PublicAPI]
|
||||
public class FSharpVirtualFile : IDisposable {
|
||||
private readonly ConcurrentDictionary<string, FSharpVirtualFile> _ownerCollection;
|
||||
|
||||
public FSharpVirtualFile(string name, MemoryStream stream, ConcurrentDictionary<string, FSharpVirtualFile> ownerCollection) {
|
||||
internal FSharpVirtualFile(string name, MemoryStream stream, ConcurrentDictionary<string, FSharpVirtualFile> ownerCollection) {
|
||||
Name = name;
|
||||
Stream = stream;
|
||||
_ownerCollection = ownerCollection;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name of the virtual file (generated, unique).</summary>
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>Gets the MemoryStream representing contents of the virtual file.</summary>
|
||||
public MemoryStream Stream { get; }
|
||||
|
||||
/// <summary>Deregisters the file from the <see cref="FSharpFileSystem" />.</summary>
|
||||
public void Dispose() {
|
||||
_ownerCollection.TryRemove(Name, out FSharpVirtualFile _);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,12 @@ using Microsoft.FSharp.Compiler;
|
|||
using Microsoft.FSharp.Compiler.SourceCodeServices;
|
||||
|
||||
namespace MirrorSharp.FSharp.Advanced {
|
||||
/// <summary>Represents a user session based on F# parser.</summary>
|
||||
[PublicAPI]
|
||||
public interface IFSharpSession {
|
||||
/// <summary>Returns the combined <see cref="FSharpParseAndCheckResults" /> for the current session.</summary>
|
||||
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the call.</param>
|
||||
/// <returns>Last <see cref="FSharpParseAndCheckResults"/> if still valid, otherwise results of a new forced parse and check.</returns>
|
||||
[ItemNotNull] ValueTask<FSharpParseAndCheckResults> ParseAndCheckAsync(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>Return last parse result (if text hasn't changed since), but doesn't force a new reparse.</summary>
|
||||
|
@ -20,11 +24,21 @@ namespace MirrorSharp.FSharp.Advanced {
|
|||
/// <returns>Last <see cref="FSharpCheckFileAnswer"/> if still valid, otherwise <c>null</c>.</returns>
|
||||
[CanBeNull] FSharpCheckFileAnswer GetLastCheckAnswer();
|
||||
|
||||
/// <summary>Converts <see cref="FSharpErrorInfo" /> to a <see cref="Diagnostic" />.</summary>
|
||||
/// <param name="error"><see cref="FSharpErrorInfo" /> value to convert.</param>
|
||||
/// <returns><see cref="Diagnostic" /> value that corresponds to <paramref name="error" />.</returns>
|
||||
[NotNull] Diagnostic ConvertToDiagnostic([NotNull] FSharpErrorInfo error);
|
||||
|
||||
/// <summary>Gets the <see cref="FSharpChecker" /> associated with this session.</summary>
|
||||
[NotNull] FSharpChecker Checker { get; }
|
||||
|
||||
/// <summary>Gets the <see cref="ProjectOptions" /> associated with this session.</summary>
|
||||
[NotNull] FSharpProjectOptions ProjectOptions { get; }
|
||||
|
||||
/// <summary>Gets the assembly reference paths associated with this session.</summary>
|
||||
ImmutableArray<string> AssemblyReferencePaths { get; }
|
||||
|
||||
/// <summary>Gets the <see cref="AssemblyReferencePaths" /> as a <see cref="FSharpList{T}"/>.</summary>
|
||||
[NotNull] FSharpList<string> AssemblyReferencePathsAsFSharpList { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,22 @@ using MirrorSharp.Advanced;
|
|||
using MirrorSharp.Internal;
|
||||
|
||||
namespace MirrorSharp.FSharp.Advanced {
|
||||
/// <summary>Provides F#-related extensions to the <see cref="IWorkSession" />.</summary>
|
||||
[PublicAPI]
|
||||
public static class WorkSessionExtensions {
|
||||
public static bool IsFSharp(this IWorkSession session) {
|
||||
/// <summary>Specifies whether the <see cref="IWorkSession" /> is using F#.</summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <returns><c>true</c> if the session is using F#; otherwise, <c>false</c></returns>
|
||||
public static bool IsFSharp([NotNull] this IWorkSession session) {
|
||||
Argument.NotNull(nameof(session), session);
|
||||
return ((WorkSession)session).LanguageSession is IFSharpSession;
|
||||
}
|
||||
|
||||
/// <summary>Returns F# session associated with the <see cref="IWorkSession" />, if any; throws otherwise.</summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <returns><see cref="IFSharpSession" /> if the session is using F#</returns>
|
||||
public static IFSharpSession FSharp(this IWorkSession session) {
|
||||
Argument.NotNull(nameof(session), session);
|
||||
return (IFSharpSession)((WorkSession)session).LanguageSession;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../NuGet.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>MirrorSharp.FSharp</AssemblyName>
|
||||
<RootNamespace>MirrorSharp.FSharp</RootNamespace>
|
||||
<TargetFrameworks>net46</TargetFrameworks>
|
||||
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<VersionPrefix>0.9.0-pre-20170522</VersionPrefix>
|
||||
<Authors>Andrey Shchekin</Authors>
|
||||
<Company>Andrey Shchekin</Company>
|
||||
<PackageProjectUrl>https://github.com/ashmind/mirrorsharp</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/ashmind/mirrorsharp.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<VersionPrefix>0.9.0-pre-20170523</VersionPrefix>
|
||||
<Description>MirrorSharp F# support library. $(DescriptionSuffix)</Description>
|
||||
<PackageTags>F#;CodeMirror</PackageTags>
|
||||
<Description>MirrorSharp F# support library. MirrorSharp is a code editor <textarea> built on Roslyn — see https://github.com/ashmind/mirrorsharp/blob/master/README.md for details.</Description>
|
||||
<DocumentationFile>$(OutDir)\MirrorSharp.FSharp.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using Microsoft.FSharp.Compiler.SourceCodeServices;
|
||||
|
||||
namespace MirrorSharp.FSharp.Internal {
|
||||
public static class SymbolTags {
|
||||
internal static class SymbolTags {
|
||||
private static ImmutableArray<string> Namespace { get; } = ImmutableArray.Create("Namespace");
|
||||
|
||||
private static ImmutableArray<string> Delegate { get; } = ImmutableArray.Create("Delegate");
|
||||
|
|
|
@ -5,6 +5,7 @@ using JetBrains.Annotations;
|
|||
using Microsoft.FSharp.Core;
|
||||
|
||||
namespace MirrorSharp.FSharp {
|
||||
/// <summary>MirrorSharp options for F#</summary>
|
||||
[PublicAPI]
|
||||
public class MirrorSharpFSharpOptions {
|
||||
internal MirrorSharpFSharpOptions() {
|
||||
|
@ -15,6 +16,7 @@ namespace MirrorSharp.FSharp {
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>Specifies the list of assembly reference paths to be used.</summary>
|
||||
public ImmutableArray<string> AssemblyReferencePaths { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,12 @@ using MirrorSharp.FSharp.Internal;
|
|||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace MirrorSharp {
|
||||
/// <summary>Extensions to <see cref="MirrorSharpOptions" /> related to F#.</summary>
|
||||
public static class MirrorSharpOptionsExtensions {
|
||||
/// <summary>Enables and configures F# support in the <see cref="MirrorSharpOptions" />.</summary>
|
||||
/// <param name="options">Options to configure</param>
|
||||
/// <param name="setup">Setup delegate used to configure <see cref="MirrorSharpFSharpOptions" /></param>
|
||||
/// <returns>Value of <paramref name="options" />, for convenience.</returns>
|
||||
[NotNull]
|
||||
public static MirrorSharpOptions EnableFSharp([NotNull] this MirrorSharpOptions options, [CanBeNull] Action<MirrorSharpFSharpOptions> setup = null) {
|
||||
Argument.NotNull(nameof(options), options);
|
||||
|
|
|
@ -25,6 +25,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Owin.Demo", "Owin.Demo\Owin
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasic", "VisualBasic\VisualBasic.csproj", "{C8076D77-4C5A-450E-AF3F-9E37A8B512D8}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9EC6CF09-4D36-4723-9548-060215C88E50}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
NuGet.Common.props = NuGet.Common.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
Tests.Shared\MirrorSharp.Tests.Shared.projitems*{0a9078a1-bd26-4dc7-87bb-ded125f6218b}*SharedItemsImports = 13
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<Authors>Andrey Shchekin</Authors>
|
||||
<PackageProjectUrl>https://github.com/ashmind/mirrorsharp</PackageProjectUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/ashmind/mirrorsharp.git</RepositoryUrl>
|
||||
<DescriptionSuffix>MirrorSharp is a code editor <textarea> built on Roslyn — see https://github.com/ashmind/mirrorsharp/blob/master/README.md for details.</DescriptionSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<DefineConstants>$(DefineConstants); JETBRAINS_ANNOTATIONS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -3,10 +3,17 @@ using Owin;
|
|||
using JetBrains.Annotations;
|
||||
|
||||
namespace MirrorSharp.Owin {
|
||||
/// <summary>MirrorSharp-related extensions for the <see cref="IAppBuilder" />.</summary>
|
||||
[PublicAPI]
|
||||
public static class AppBuilderExtensions {
|
||||
public static void UseMirrorSharp([NotNull] this IAppBuilder app, [CanBeNull] MirrorSharpOptions options = null) {
|
||||
/// <summary>Adds MirrorSharp middleware to the <see cref="IAppBuilder" />.</summary>
|
||||
/// <param name="app">The app builder.</param>
|
||||
/// <param name="options">The <see cref="MirrorSharpOptions" /> object used by the MirrorSharp middleware.</param>
|
||||
[NotNull]
|
||||
public static IAppBuilder UseMirrorSharp([NotNull] this IAppBuilder app, [CanBeNull] MirrorSharpOptions options = null) {
|
||||
Argument.NotNull(nameof(app), app);
|
||||
app.Use(typeof(Middleware), options ?? new MirrorSharpOptions());
|
||||
return app;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,15 +5,13 @@ using System.Net.WebSockets;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using MirrorSharp.Advanced;
|
||||
using MirrorSharp.Internal;
|
||||
|
||||
namespace MirrorSharp.Owin.Internal {
|
||||
using AppFunc = Func<IDictionary<string, object>, Task>;
|
||||
using WebSocketAccept = Action<IDictionary<string, object>, Func<IDictionary<string, object>, Task>>;
|
||||
|
||||
internal class Middleware : MiddlewareBase {
|
||||
private static readonly Task Done = Task.FromResult((object) null);
|
||||
|
||||
private readonly AppFunc _next;
|
||||
|
||||
public Middleware([NotNull] AppFunc next, [NotNull] MirrorSharpOptions options) : base(options) {
|
||||
|
@ -49,7 +47,7 @@ namespace MirrorSharp.Owin.Internal {
|
|||
callCancelled
|
||||
);
|
||||
});
|
||||
return Done;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +1,14 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../NuGet.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>MirrorSharp OWIN server. MirrorSharp is a code editor <textarea> built on Roslyn — see https://github.com/ashmind/mirrorsharp/blob/master/README.md for details.</Description>
|
||||
<VersionPrefix>0.9.0-pre-20170522</VersionPrefix>
|
||||
<Authors>Andrey Shchekin</Authors>
|
||||
<TargetFramework>net46</TargetFramework>
|
||||
<AssemblyName>MirrorSharp.Owin</AssemblyName>
|
||||
<PackageId>MirrorSharp.Owin</PackageId>
|
||||
<PackageTags>Roslyn;CodeMirror</PackageTags>
|
||||
<PackageProjectUrl>https://github.com/ashmind/mirrorsharp</PackageProjectUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/ashmind/mirrorsharp.git</RepositoryUrl>
|
||||
<RootNamespace>MirrorSharp.Owin</RootNamespace>
|
||||
<TargetFramework>net46</TargetFramework>
|
||||
<VersionPrefix>0.9.0-pre-20170523</VersionPrefix>
|
||||
<Description>MirrorSharp OWIN server. $(DescriptionSuffix)</Description>
|
||||
<PackageTags>Roslyn;CodeMirror</PackageTags>
|
||||
<DocumentationFile>$(OutDir)\MirrorSharp.Owin.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using MirrorSharp.Advanced;
|
||||
using MirrorSharp.Internal;
|
||||
using MirrorSharp.Testing.Internal;
|
||||
using MirrorSharp.Testing.Internal.Results;
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../NuGet.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>MirrorSharp testing helpers. MirrorSharp is a code editor <textarea> built on Roslyn — see https://github.com/ashmind/mirrorsharp/blob/master/README.md for details.</Description>
|
||||
<VersionPrefix>0.9.0-pre-20170522</VersionPrefix>
|
||||
<Authors>Andrey Shchekin</Authors>
|
||||
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
|
||||
<AssemblyName>MirrorSharp.Testing</AssemblyName>
|
||||
<PackageId>MirrorSharp.Testing</PackageId>
|
||||
<PackageProjectUrl>https://github.com/ashmind/mirrorsharp</PackageProjectUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/ashmind/mirrorsharp.git</RepositoryUrl>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8+wp8+wpa81;portable-net45+win8</PackageTargetFallback>
|
||||
<RootNamespace>MirrorSharp.Testing</RootNamespace>
|
||||
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
|
||||
<VersionPrefix>0.9.0-pre-20170523</VersionPrefix>
|
||||
<Description>MirrorSharp testing helpers. $(DescriptionSuffix)</Description>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8+wp8+wpa81;portable-net45+win8</PackageTargetFallback>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -9,8 +9,13 @@ using MirrorSharp.VisualBasic.Internal;
|
|||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace MirrorSharp {
|
||||
/// <summary>Extensions to <see cref="MirrorSharpOptions" /> related to Visual Basic .NET.</summary>
|
||||
[PublicAPI]
|
||||
public static class MirrorSharpOptionsExtensions {
|
||||
/// <summary>Enables and configures Visual Basic .NET support in the <see cref="MirrorSharpOptions" />.</summary>
|
||||
/// <param name="options">Options to configure</param>
|
||||
/// <param name="setup">Setup delegate used to configure <see cref="MirrorSharpVisualBasicOptions" /></param>
|
||||
/// <returns>Value of <paramref name="options" />, for convenience.</returns>
|
||||
[NotNull]
|
||||
public static MirrorSharpOptions EnableVisualBasic([NotNull] this MirrorSharpOptions options, [CanBeNull] Action<MirrorSharpVisualBasicOptions> setup = null) {
|
||||
Argument.NotNull(nameof(options), options);
|
||||
|
|
|
@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis.VisualBasic;
|
|||
using MirrorSharp.Advanced;
|
||||
|
||||
namespace MirrorSharp.VisualBasic {
|
||||
/// <summary>MirrorSharp options for Visual Basic .NET</summary>
|
||||
public class MirrorSharpVisualBasicOptions : MirrorSharpRoslynOptions<VisualBasicParseOptions, VisualBasicCompilationOptions> {
|
||||
internal MirrorSharpVisualBasicOptions() : base(
|
||||
new VisualBasicParseOptions(),
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../NuGet.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
|
||||
<AssemblyName>MirrorSharp.VisualBasic</AssemblyName>
|
||||
<RootNamespace>MirrorSharp.VisualBasic</RootNamespace>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;portable-net45+win8</PackageTargetFallback>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<VersionPrefix>0.9.0-pre-20170522</VersionPrefix>
|
||||
<Authors>Andrey Shchekin</Authors>
|
||||
<Company>Andrey Shchekin</Company>
|
||||
<PackageProjectUrl>https://github.com/ashmind/mirrorsharp</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/ashmind/mirrorsharp.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
|
||||
<VersionPrefix>0.9.0-pre-20170523</VersionPrefix>
|
||||
<Description>MirrorSharp Visual Basic .NET support library. $(DescriptionSuffix)</Description>
|
||||
<PackageTags>Roslyn;Visual Basic;CodeMirror</PackageTags>
|
||||
<Description>MirrorSharp Visual Basic .NET support library. MirrorSharp is a code editor <textarea> built on Roslyn — see https://github.com/ashmind/mirrorsharp/blob/master/README.md for details.</Description>
|
||||
<DocumentationFile>$(OutDir)\MirrorSharp.VisualBasic.xml</DocumentationFile>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;portable-net45+win8</PackageTargetFallback>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче