taichi / vscode-textlint

https://marketplace.visualstudio.com/items?itemName=taichi.vscode-textlint
MIT License
60 stars 19 forks source link

feat: support textlint v13+ #63

Closed azu closed 1 year ago

azu commented 1 year ago

Refs https://github.com/textlint/textlint/discussions/968

This PR make support textlint v13+ and ESM plugins/rules. As a backward compatibiliety, still support textlint v12 APIs like TextlintEngine.

Test Plans

textlint v13 + HTML plugin that is written in ESM

image

textlint v12 still works

image

Debug Notes

I cound not run watch task as a background. So, I comment out this line during debug. https://github.com/taichi/vscode-textlint/blob/7f73c80084c8c80b91ec59612746ac717ae41785/packages/textlint/.vscode/launch.json#L14 Is it correct?

📝 I met a problem that documents.onDidChangeContent does not be called. "textlint.languages" cause this problem. I add and "textlint.languages": ["markdown","plaintext","html"] and remove "textlint.languages": [...] and relaunch vscode, and then that works.

I don't know why, but documentSelector is empty. If documentSelector is empty, it may be better to have an error message. https://github.com/taichi/vscode-textlint/blob/7f73c80084c8c80b91ec59612746ac717ae41785/packages/textlint/src/extension.ts#L115-L117

azu commented 1 year ago

cc @taichi