Skip to content
プロジェクト

概要

MirrorSharp is a code editor <textarea> built on Roslyn and CodeMirror

開発ツール

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Overview

MirrorSharp is a reusable client-server code editor component built on Roslyn and CodeMirror.

Features

Code completion

Code completion

Signature help

Signature help

Quick fixes

Quick fixes

Diagnostics

Diagnostics

Quick info

Quick info

Usage

You'll need the following:

  • MirrorSharp.AspNetCore on the server (MirrorSharp.Owin if .NET Framework)
  • mirrorsharp.js — client library that provides the user interface

Server

build

MirrorSharp.AspNetCore

NuGet

Install-Package MirrorSharp.AspNetCore

If using Endpoint Routing (3.0+ only):

app.UseEndpoints(endpoints => {
    // ...
    endpoints.MapMirrorSharp("/mirrorsharp");
});

If not using Endpoint Routing:

app.MapMirrorSharp("/mirrosharp");

MirrorSharp.Owin

NuGet

Install-Package MirrorSharp.Owin

In your Startup:

app.MapMirrorSharp("/mirrosharp");

Client

build

Library Type NPM
mirrorsharp-codemirror-6-preview Latest npm
mirrorsharp Stable npm
npm install mirrorsharp-codemirror-6-preview --save

Note: The name is temporary — once all testing on 6-preview is completed, it will become mirrorsharp 3.

Breaking Changes

Version mirrorsharp-codemirror-6-preview (future mirrorsharp 3.0+) includes a number of breaking changes — see migration-from-2.md for the full migration guide.

Build

Since mirrorsharp JS files are not bundled, you'll need to use a bundler such as Webpack, Parcel or ESBuild.

You can see a Parcel example in AspNetCore.Demo.

Note that mirrorsharp is written in TypeScript, and the package includes full TypeScript types.

Note: You need to manually require/import mirrorsharp/mirrorsharp.css into your bundle.

Usage

import mirrorsharp from 'mirrorsharp-codemirror-6-preview';

mirrorsharp(container, { serviceUrl: 'wss://your_app_root/mirrorsharp' });

If you're not using HTTPS, you'll likely need ws:// instead of wss://.

Note that the container is an actual HTML element, and not a CSS selector.

API

TODO. In general the idea is that "it just works", however customization is a goal and some options are already available.

Demos

You can check out the demos if you clone the repository locally.
After cloning, run ms setup to build and prepare everything.

Testing

TODO, but see MirrorSharp.Testing on NuGet.

関連プロジェクトを探す

読み込み中…