https://github.com/replit/codemirror-lang-csharp
https://github.com/replit/codemirror-lang-csharp
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/replit/codemirror-lang-csharp
- Owner: replit
- License: mit
- Created: 2022-12-15T19:11:26.000Z (about 3 years ago)
- Default Branch: initial
- Last Pushed: 2023-10-07T09:44:49.000Z (over 2 years ago)
- Last Synced: 2025-04-05T15:47:05.528Z (10 months ago)
- Language: TypeScript
- Size: 205 KB
- Stars: 7
- Watchers: 33
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeMirror C# Language Support
A CodeMirror extension that provides C# syntax highlighting and language support.
### Usage
```ts
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { csharp } from "@replit/codemirror-lang-csharp";
import { basicSetup } from 'codemirror';
new EditorView({
state: EditorState.create({
doc: `
using System;
namespace Test
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, world!");
}
}
}
`,
extensions: [basicSetup, csharp()],
}),
parent: document.querySelector('#editor'),
});
```