Skip to content

Commit

Permalink
feat: extension readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sanshuiyijing committed Jun 25, 2024
1 parent 74cd988 commit 14b6bc4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
4 changes: 0 additions & 4 deletions packages/extensions/autocomplete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const editorView = new EditorView({

## API

```
```

```ts
// DefaultCompletionConfig configs please refer to: https://codemirror.net/docs/ref/#autocomplete.autocompletion

Expand Down
7 changes: 1 addition & 6 deletions packages/extensions/basic-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ npm install @tidbcloud/codemirror-extension-basic-setup
You need to install its peer dependencies as well:

```shell
npm install @codemirror/autocomplete @codemirror/commands @codemirror/lang-sql @codemirror/language @codemirror/lint @codemirror/search @codemirror/state @codemirror/view @codemirror/highlight
npm install @codemirror/autocomplete @codemirror/commands @codemirror/lang-sql @codemirror/language @codemirror/lint @codemirror/search @codemirror/state @codemirror/view @lezer/highlight
```

## Usage
Expand All @@ -24,11 +24,6 @@ import {
basicSetup
} from '@tidbcloud/codemirror-extension-basic-setup'

interface basicSetupOptions {
title?: string
message?: string
}

const editorView = new EditorView({
state: EditorState.create({
doc,
Expand Down
4 changes: 2 additions & 2 deletions packages/extensions/events/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @tidbcloud/codemirror-extension-events

Events Extensions for CodeMirror6. This extension provides 3 default events: onChange, onFocusChange and onSelectionChange.
Events extensions for CodeMirror6. This extension provides 3 default events: onChange, onFocusChange and onSelectionChange.

## Installation

Expand All @@ -11,7 +11,7 @@ npm install @tidbcloud/codemirror-extension-events
You need to install its peer dependencies as well:

```shell
npm install @codemirror/view @codemirror/view
npm install @codemirror/view @codemirror/state
```

## Usage
Expand Down
8 changes: 4 additions & 4 deletions packages/extensions/linters/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @tidbcloud/codemirror-extension-linters

This extension provide 3 linters:
This extension provides 3 linters:

- fullWidthCharLinter: lint all the chinese characters
- useDbLinter: use statement linter, the first statement should be use dbName;
Expand All @@ -23,7 +23,7 @@ npm install @codemirror/view @codemirror/state @codemirror/lint
```ts
import { EditorView } from '@codemirror/view'
import { EditorState } from '@codemirror/state'
import { autoCompletion } from '@tidbcloud/codemirror-extension-linters'
import { fullWidthCharLinter } from '@tidbcloud/codemirror-extension-linters'

interface charLinterConfig {
title?: string
Expand All @@ -46,7 +46,7 @@ const editorView = new EditorView({
```ts
import { EditorView } from '@codemirror/view'
import { EditorState } from '@codemirror/state'
import { autoCompletion } from '@tidbcloud/codemirror-extension-linters'
import { useDbLinter } from '@tidbcloud/codemirror-extension-linters'

type DBLinterOptions = {
level?: 'error' | 'warning'
Expand All @@ -72,7 +72,7 @@ const editorView = new EditorView({
```ts
import { EditorView } from '@codemirror/view'
import { EditorState } from '@codemirror/state'
import { autoCompletion } from '@tidbcloud/codemirror-extension-linters'
import { regexMatchLinter } from '@tidbcloud/codemirror-extension-linters'

interface RegexpItem {
reg: RegExp
Expand Down

0 comments on commit 14b6bc4

Please sign in to comment.