Skip to content

Commit

Permalink
chore: compatible diff
Browse files Browse the repository at this point in the history
  • Loading branch information
action-hong committed Feb 20, 2024
1 parent 57804a2 commit b365cf8
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 177 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,23 @@ Currently,only `.md` files are supported。If you want to support other file t
}
```

## config

this extension will use `readRc` and `runWithConfig` if there has `.zhlintr{c, c.json}``.zhlintignore``.zhlintcaseignore`,or it will use `run()` with `zhlint.options` in `.vscode/settings.json`

## Experimental Feature

these feature maybe remove in the future

- support `.zhlintr{c, c.json}` and `.zhlintignore` (**if one of them exist,this extension will use `readRc` and `runWithConfig`,otherwise use `run()` with `zhlint.options` from `settings.json`**)
- rule diff viewer
- ignore files or directories with `.experimental-zhlintignore`,checkout [ignore](https://www.npmjs.com/package/ignore)
### diff viewer

1. set `zhlint.experimental.diff` to `true`
2. Keep Open for your markdown file(which you want to see the diff),checkout [How do I make VS Code open files in a new tab?](https://vscode.one/new-tab-vscode/)

![diff viewer](./screenshot/preview.png)

![handle hyper space option](./screenshot/see-rule-diff.png)


## options

Expand All @@ -48,8 +58,6 @@ these feature maybe remove in the future
|`zhlint.debug`|print extra message when run zhlint|`false`|
|`zhlint.enable`|Controls whether zhlint is enabled or not|`true`|
|`zhlint.experimental.diff` |enable rule diff viewer in explorer |`false`|
|`zhlint.experimental.config`|enable use `.zhlintrc` and `.zhlintignore` to config in workspace |`false`|
|`zhlint.experimental.ignore`|enable use `.experimental-zhlintignore` to ignore files or directories while linting by specifying one or more glob patterns|`false`|

## Dev

Expand Down
2 changes: 1 addition & 1 deletion client/src/RuleView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class RuleNodeProvider implements vscode.TreeDataProvider<RuleNode> {
'vscode.diff',
this.createZhlintUri(this.activeEditorUri || '', diff.diff, true),
this.createZhlintUri(this.activeEditorUri || '', diff.diff, false),
`parse: ${diff.diff.ruleName}`,
`parse: ${diff.diff.ruleName}`,
)
}))
this.handleChangeActiveEditor(vscode.window.activeTextEditor)
Expand Down
Binary file added screenshot/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/see-rule-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b365cf8

Please sign in to comment.