master e8089210cafe cached
23 files
34.2 KB
12.9k tokens
4 symbols
1 requests
Download .txt
Repository: ics-creative/project-japanese-proofreading
Branch: master
Commit: e8089210cafe
Files: 23
Total size: 34.2 KB

Directory structure:
gitextract_15gqhu90/

├── .editorconfig
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .prettierrc
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   ├── settings.json
│   └── tasks.json
├── .vscodeignore
├── CHANGELOG.md
├── DEVELOPMENT.md
├── EXAMPLES.md
├── LICENSE.txt
├── README.md
├── images/
│   └── icon.psd
├── package.json
├── src/
│   ├── extension.ts
│   ├── index.d.ts
│   ├── rules/
│   │   ├── rule-data.ts
│   │   └── rule.ts
│   └── server.ts
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


================================================
FILE: .eslintrc.js
================================================
module.exports = {
  root: true,
  parser: "@typescript-eslint/parser",
  parserOptions: {
    ecmaVersion: 6,
    sourceType: "module",
  },
  extends: [
    "plugin:@typescript-eslint/recommended",
    "plugin:prettier/recommended",
    "plugin:import/errors",
    "prettier",
  ],
  plugins: ["prettier", "@typescript-eslint"],
  rules: {
    "no-unused-vars": "off",
    // TypeScript側のeslintで未使用のvarをエラー
    "@typescript-eslint/no-unused-vars": 1,
    "sort-keys": 0,
    "no-console": 0,
    "func-style": [2, "expression", { allowArrowFunctions: true }],
    "import/order": [
      "error",
      {
        groups: ["internal", "builtin", "external", "parent"],
      },
    ],
    "import/no-unresolved": "off",
  },
  ignorePatterns: ["node_modules", "out", "dist", "**/*.d.ts"],
};


================================================
FILE: .gitattributes
================================================
# Set default behavior to automatically normalize line endings.
* text=auto



================================================
FILE: .gitignore
================================================
out
node_modules
.vscode-test/
*.vsix

.DS_Store
Thumbs.db
.idea

yarn.lock


================================================
FILE: .prettierrc
================================================
{
  "trailingComma": "all",
  "arrowParens": "always"
}


================================================
FILE: .vscode/extensions.json
================================================
{
	// See http://go.microsoft.com/fwlink/?LinkId=827846
	// for the documentation about the extensions.json format
	"recommendations": [
		"dbaeumer.vscode-eslint"
	]
}

================================================
FILE: .vscode/launch.json
================================================
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
	"version": "0.2.0",
    "configurations": [
        {
            "name": "Extension",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutable": "${execPath}",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}"
            ],
            "outFiles": [
                "${workspaceFolder}/out/**/*.js"
            ],
            "preLaunchTask": "npm: watch"
        },
        {
            "name": "Extension Tests",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutable": "${execPath}",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}",
                "--extensionTestsPath=${workspaceFolder}/out/test"
            ],
            "outFiles": [
                "${workspaceFolder}/out/test/**/*.js"
            ],
            "preLaunchTask": "npm: watch"
        }
    ]
}


================================================
FILE: .vscode/settings.json
================================================
// Place your settings in this file to overwrite default and user settings.
{
    "files.exclude": {
        "out": false // set this to true to hide the "out" folder with the compiled JS files
    },
    "search.exclude": {
        "out": true // set this to false to include "out" folder in search results
    },
    // Turn off tsc task auto detection since we have the necessary tasks as npm scripts
    "typescript.tsc.autoDetect": "off"
}

================================================
FILE: .vscode/tasks.json
================================================
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "watch",
            "problemMatcher": "$tsc-watch",
            "isBackground": true,
            "presentation": {
                "reveal": "never"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

================================================
FILE: .vscodeignore
================================================
.vscode/**
out/test/**
out/**/*.map
src/**
.gitignore
tsconfig.json
vsc-extension-quickstart.md
eslintrc.json
*/**.psd

================================================
FILE: CHANGELOG.md
================================================
# Change Log

## 1.3.0(2023.04.07)

- 内部の構成をリファクタリング
- 初期設定では、校正ルール「助詞の連続」をオフに変更
- 自動修正が可能な校正ルールにクイックフィックスを追加

## 1.2.0(2023.02.07)

- 入力例のドキュメントを作成 [#22](https://github.com/ics-creative/project-japanese-proofreading/issues/22)
- 半角の大かっこの使用を許容する設定項目を追加 [#24](https://github.com/ics-creative/project-japanese-proofreading/issues/24)
- 拡張子がないファイルでクラッシュする不具合を修正 [#26](https://github.com/ics-creative/project-japanese-proofreading/issues/26)
- いくつかの校正ルールで、波線が適切に表示されない不具合を修正(和文におけるハイフンの使用、ら抜き言葉など)

## 1.1.0(2022.03.04)

- 校正機能が利用できるファイル形式を追加
  - Latex(`.tex`)ファイル
  - HTML(`.html`)ファイル
- 和文における全半角の句読点(カンマ・ピリオド)を許容する設定項目を追加 [#5](https://github.com/ics-creative/project-japanese-proofreading/issues/5)

## 1.0.0(2022.03.02)

- 校正辞書を2022年2月時点のものに更新
- アイコンの変更
- 校正指摘の波線が適切に表示されていない不具合を修正
- 「ですます / である」調の校正ルールが動作していなかった不具合を修正

## 0.2.3(2019.10.28)

- Re:VIEWファイル対応
- 校正辞書を修正
  - ならびに関する条件の緩和(横並び・縦並びを許容)

## 0.2.2(2019.05.14)

- 校正辞書を追加
  - TrueType/OpenType
  - Amazon Web Services

## 0.2.0(2018.12.28)

- 設定画面から有効にする校正ルールを選択できるように変更

## 0.1.6(2018.09.14)

- 校正ルールを調整
- iPhone XS、iPhone XRなどを辞書に追加

## 0.1.5(2018.09.07)

- 校正ルール等を調整
- 半角丸括弧を許容

## 0.1.4(2018.09.06)

- 校正ルール等を調整

## 0.1.3(2018.09.05)

- 校正ルールの緩和
- 校正ルール等を調整(1000件以上の辞書を追加)
  - 間違いやすい慣用句の定義を追加
  - 長音表記、製品名表記のルールを追加

## 0.1.2(2018.08.30)

- 校正ルール等を調整

## 0.1.1(2018.06.29)

- 校正ルール等を調整

## 0.1.0(2018.06.26)

- 初版リリース


================================================
FILE: DEVELOPMENT.md
================================================
# 「テキスト校正くん」の開発について

## 開発環境の構築

1. VS Codeで本プロジェクトのルートディレクトリを開いてください。
2. ターミナルから`npm i`で必要なパッケージをインストールしてください。
3. VS Codeで[F5]キーを押下しデバッグ実行を行うと、開発中の拡張機能がインストールされた状態でVS Codeが立ち上がります。

## 拡張機能の公開手順

### 公開ツール(vsce)のインストール

以下のコマンドを実行し、公開ツールをインストールしてください。

```shell
npm i -g vsce
```

### 拡張機能のパッケージング

拡張機能を公開せずにパッケージ化できます。公開前に内部確認する際に利用します。

```shell
vsce package
````

### 拡張機能の公開

Visual Studio Team Servicesを活用して、拡張機能の公開を行います。
公開するには、Personal Access Tokensが必要であるため、以下のサイトの通り設定をしてください。

https://vscode-doc-jp.github.io/docs/extensions/publish-extension.html

1. `package.json`のバージョン番号(version)を更新します。

2. `CHANGELOG.md`に更新するバージョンの変更履歴を追記します。

3. 以下のコマンドを実行し公開処理を行います。  
  コマンド実行後、マーケット側でverifyが行われ、問題なければ数分後マーケットに反映されます。
  ```shell
  vsce publish
  ```


================================================
FILE: EXAMPLES.md
================================================
# テキスト校正くんチェック事例
こちらに書かれている内容はテキスト校正くんにて検出される**NG例**です。

## 「ですます」調と「である」調の混在
これは素敵です。あれは平凡である。

---
補足:ですます調の検出には[textlint-rule-no-mix-dearu-desumasu](https://github.com/textlint-ja/textlint-rule-no-mix-dearu-desumasu)を利用しています。誤検出の回避のため「である調」の判定は明らかに常体な「〜である」のみとなっています。
以下のような例は検出できません。

「これは素敵です。あれは平凡だ。」
「これは素敵です。あれは平凡と言われている。」

---

## 大文字アルファベットの使用
点Aと点Bを結んだ線分

## かっこ類と隣接する文字の間にスペースが使用されている
炭酸水素ナトリウム (別名、重曹) があります

## 和文におけるダッシュ「-」の使用
彼は―たとえそうだとしても

## 和文におけるハイフン「-」の使用
東京-横浜間の電車

## ひらくべき漢字
例えば

## 和文の句読点として半角ピリオド「.」と半角カンマ「,」が使用されている
しかし,

## 和文の句読点として全角ピリオド「.」と全角カンマ「,」が使用されている
しかし,

## ら抜き言葉
食べれる

## 助数詞にともなう「ヶ」の表記を使用している(「か」の使用を推奨)
1ヶ月

## 外来語カタカナ表記の語尾の長音表記を省略している
プリンタ

## 半角の丸かっこの使用
塩化ナトリウム(別名、食塩)があります

## 半角の大かっこの使用
祇園精舎の[中略]盛者必衰の理をあらはす。

## ウェブ技術に関する誤った固有名詞の使用
githubにあるWebpackのソースコード

## 和文に半角の疑問符(?)が使用されている
そうでしょうか?

## 疑問符(?)の後ろと続く文の間に半角スペースが使われている
でしょうか? しかしながら

---

注:校正ルールを参考にしている『JTF日本語標準スタイルガイド』によれば

> 文末に疑問符を使用し、後に別の文が続く場合は、直後に全角スペースを挿入します。文中に疑問符を使用する場合はスペースを挿入しません。
>
> 『JTF日本語標準スタイルガイド 第3.0版』 3.2.2 疑問符(?)より

とあり、文末の疑問符には直後に全角スペースをいれるのが望ましいとされています。しかしながら、疑問符の使用が文末か文中かは検出性能の限界のためわかりません。そのため「でしょうか?しかしながら」のような文末における全角スペースなしの場合でもNGにはなりません。

---

## 逆説の「が」が複数回使用されている
寝坊したが、いつもより遅い電車に乗ったが、幸い間に合った。

## 誤った固有名詞の使用
ビッグカメラに寄った後、東京ビックサイトに行った

## 誤った慣用表現
取り付く暇もない

---
補足:検出される間違いやすい慣用表現や誤字については[ics-creative/textlint-rule-preset-icsmedia](https://github.com/ics-creative/textlint-rule-preset-icsmedia/blob/master/dict/prh_idiom.yml)に記載されています。

---

## 康煕部首に含まれる漢字が使われている
道具を⽤いた

---
補足:康煕部首はUnicodeのブロックに存在する漢字の部首を表す文字です。一部の部首が普段使う漢字と**非常によく似ている**ため紛れ込んでいると区別がつきづらいです。文字化けや検索に引っかからないなどの不具合を引き起こす恐れがあるのでテキスト校正くんでは検出しています。

---

## 全角の算用数字の使用
1月1日

## 誤った算用数字と漢数字の使用
第3者の意見を一か月後にヒアリングします

## 重言の使用
馬から落馬する

## 助詞の連続使用
旅行先で怪我で病院に運ばれた

---
注:初期設定ではオフにしています。プラグインの設定より有効にできます。

---

## 冗長な表現の使用
提供することができます

## 制御文字の使用


---
補足:ウェブサイト上だと制御文字は文字化けしてしまうので、こちらのマークダウンファイルをダウンロードしてご確認ください。

---

## 全角文字同士の間にスペースが使用されている
ここには山 川がある

## 全角文字と半角文字の間にスペースが使用されている
成田空港から Los Angelsに向かった

## 読点が1つの文中に4回以上使用されている
私は、しかし、どんな理由があろうとも、とにかく、見たかった。

## 二重否定の使用
できなくもない

## 不自然な濁点の使用
エンシ゛ンの不調


================================================
FILE: LICENSE.txt
================================================
MIT License

Copyright (c) 2018 ICS INC.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# テキスト校正くん

VS Code上でテキストファイル・Markdownファイル・Re:VIEWファイルの日本語の文章をチェックする拡張機能です。該当のファイルを開いた時、更新した時に自動で校正のチェックを行い、文章内の問題のある箇所をマーキングし問題パネルにエラー内容を表示します。

メールの文章を作成する際やブログ記事の文章を作成する際などに、ご使用いただくと便利です。

![デモ](images/demo.gif)

ウェブ業界の専門用語を含め、一般的な文章のルールに沿って主に以下のようなチェックを行います。

- 「ですます」調と「である」調の混在
  - 誤検出の回避のため「である調」の判定は明らかに常体な「〜である」のみとなっています。
- ら抜き言葉
- 二重否定
- 同じ助詞の連続使用(※初期設定では無効)
- 同じ接続詞の連続使用
- 逆接の接続助詞「が」の連続使用
- 全角と半角アルファベットの混在
- 弱い日本語表現の利用(〜かもしれない)
- 読点の数(1文に4つまで)
- ウェブの用語や名称の表記統一(Javascript→JavaScript、Github→GitHub等)
- 漢字の閉じ方、開き方(下さい→ください、出来る→できる等)

## 使い方

拡張機能のインストール後、テキストファイルを開くと自動で文章のチェックが行われ、問題パネルに指摘内容が表示されます。問題パネルが表示されていない場合は、ステータスバーの左下にあるアイコンをクリックし、問題パネルを表示してください。

対応しているテキストファイルは以下の形式です。

- テキストファイル(`.txt`)
- Markdownファイル(`.md`)
- HTMLファイル(`.html`)
- Latexファイル(`.tex`)
- Re:VIEWファイル(`.re`)

問題パネルには、指摘内容と該当箇所(何行目の何文字目で発生しているか)の情報が表示されます。指摘内容をダブルクリックすることで該当箇所へカーソルを移動できるため、そのまま修正が可能です。リアルタイムでチェックを行っているため、該当箇所の修正を行うと、エラーが消えます。

指摘される例文を次のリンクにまとめています。コピーして校正ルールの確認にご利用ください。

* [GitHub - project-japanese-proofreading/EXAMPLES.md](https://github.com/ics-creative/project-japanese-proofreading/blob/master/EXAMPLES.md?plain=1)

## 校正ルールの変更方法

設定画面より有効にする校正ルールを選択できます。`Ctrl`+`,`(`⌘`+`,`)で設定画面を開き、左側のサイドバーから「拡張機能」>「テキスト校正くん」を選択し、有効にする校正ルールを選択してください。

![](images/demo_setting.gif)


================================================
FILE: package.json
================================================
{
  "name": "japanese-proofreading",
  "displayName": "テキスト校正くん",
  "description": "VS CodeでテキストファイルやMarkdownファイルの日本語の文章をチェックする拡張機能",
  "version": "1.3.0",
  "publisher": "ICS",
  "engines": {
    "vscode": "^1.74.3"
  },
  "icon": "images/icon.png",
  "galleryBanner": {
    "color": "#424242",
    "theme": "dark"
  },
  "license": "SEE LICENSE IN LICENSE.txt",
  "homepage": "https://github.com/ics-creative/project-japanese-proofreading/blob/master/README.md",
  "bugs": {
    "url": "https://github.com/ics-creative/project-japanese-proofreading/issues",
    "email": "maya.watanabe@ics-web.jp"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/ics-creative/project-japanese-proofreading.git"
  },
  "categories": [
    "Linters",
    "Other"
  ],
  "activationEvents": [
    "onLanguage:html",
    "onLanguage:latex",
    "onLanguage:review",
    "onLanguage:markdown",
    "onLanguage:plaintext"
  ],
  "main": "./out/extension",
  "contributes": {
    "configuration": {
      "type": "object",
      "title": "テキスト校正くん",
      "properties": {
        "japanese-proofreading.maxNumberOfProblems": {
          "scope": "resource",
          "type": "number",
          "default": 100,
          "description": "校正チェックを行う、1ドキュメント辺りの最大指摘数です。"
        },
        "japanese-proofreading.trace.server": {
          "scope": "window",
          "type": "string",
          "enum": [
            "off",
            "messages",
            "verbose"
          ],
          "default": "off",
          "description": "VS Codeと言語サーバー間通信のトレース設定です。"
        },
        "japanese-proofreading.textlint.誤字": {
          "type": "boolean",
          "default": true,
          "description": "有効(間違いやすい慣用表現をチェックします)"
        },
        "japanese-proofreading.textlint.重言": {
          "type": "boolean",
          "default": true,
          "description": "有効(同じ意味の言葉を重ねていないかチェックします)"
        },
        "japanese-proofreading.textlint.ひらく漢字": {
          "type": "boolean",
          "default": true,
          "description": "有効(漢字の閉じ開きをチェックします)"
        },
        "japanese-proofreading.textlint.冗長な表現": {
          "type": "boolean",
          "default": true,
          "description": "有効(冗長な日本語表現がないかチェックします)"
        },
        "japanese-proofreading.textlint.外来語カタカナ表記": {
          "type": "boolean",
          "default": true,
          "description": "有効(外来語カタカナ表記の語尾の長音表記をチェックします)"
        },
        "japanese-proofreading.textlint.固有名詞": {
          "type": "boolean",
          "default": true,
          "description": "有効(社名やブランド名などの固有名詞の表記をチェックします)"
        },
        "japanese-proofreading.textlint.技術用語": {
          "type": "boolean",
          "default": true,
          "description": "有効(ウェブ技術に関する固有名詞の表記をチェックします)"
        },
        "japanese-proofreading.textlint.読点の数": {
          "type": "boolean",
          "default": true,
          "description": "有効(一つの文で\"、\"を4つ以上使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.助詞の連続": {
          "type": "boolean",
          "default": false,
          "description": "有効(同じ助詞を連続して使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.ピリオドとカンマの使用(半角)": {
          "type": "boolean",
          "default": true,
          "description": "有効(和文の句読点に半角ピリオド(.)や半角カンマ(,)を使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.ピリオドとカンマの使用(全角)": {
          "type": "boolean",
          "default": true,
          "description": "有効(和文の句読点に全角ピリオド(.)や全角カンマ(,)を使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.算用数字": {
          "type": "boolean",
          "default": true,
          "description": "有効(算用数字が半角で表記されているかチェックします)"
        },
        "japanese-proofreading.textlint.アルファベット": {
          "type": "boolean",
          "default": true,
          "description": "有効(アルファベットが半角で表記されているかチェックします)"
        },
        "japanese-proofreading.textlint.算用数字と漢数字の使い分け": {
          "type": "boolean",
          "default": true,
          "description": "有効(算用数字と漢数字の使い分けをチェックします)"
        },
        "japanese-proofreading.textlint.一部の助数詞の表記": {
          "type": "boolean",
          "default": true,
          "description": "有効(助数詞にともなう「ヵ」「か」「カ」「ヶ」「ケ」「箇」「個」の表記で「か」を使用しているかチェックします。)"
        },
        "japanese-proofreading.textlint.全角文字と半角文字の間": {
          "type": "boolean",
          "default": true,
          "description": "有効(全角文字と半角文字の間にスペースを入れていないかチェックします)"
        },
        "japanese-proofreading.textlint.全角文字どうし": {
          "type": "boolean",
          "default": true,
          "description": "有効(全角文字どうしの間にスペースを入れていないかをチェックします)"
        },
        "japanese-proofreading.textlint.かっこ類と隣接する文字の間のスペースの有無": {
          "type": "boolean",
          "default": true,
          "description": "有効(かっこの外側、内側ともにスペースを入れていないかをチェックします)"
        },
        "japanese-proofreading.textlint.疑問符(?)": {
          "type": "boolean",
          "default": true,
          "description": "有効(疑問符の後に別の文が続く場合、全角スペースが入っているかチェックします)"
        },
        "japanese-proofreading.textlint.ハイフン(-)": {
          "type": "boolean",
          "default": true,
          "description": "有効(和文にハイフンを使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.ダッシュ(-)": {
          "type": "boolean",
          "default": true,
          "description": "有効(和文にダッシュを使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.丸かっこ()": {
          "type": "boolean",
          "default": true,
          "description": "有効(半角の丸かっこを使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.大かっこ[]": {
          "type": "boolean",
          "default": true,
          "description": "有効(半角の大かっこを使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.ら抜き言葉": {
          "type": "boolean",
          "default": true,
          "description": "有効(ら抜き言葉をチェックします)"
        },
        "japanese-proofreading.textlint.二重否定": {
          "type": "boolean",
          "default": true,
          "description": "有効(二重否定をチェックします)"
        },
        "japanese-proofreading.textlint.不自然な濁点": {
          "type": "boolean",
          "default": true,
          "description": "有効(「エンシ゛ン」のような不自然な濁点をチェックします)"
        },
        "japanese-proofreading.textlint.康煕部首": {
          "type": "boolean",
          "default": true,
          "description": "有効(康煕部首に含まれる漢字を使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.逆接の「が」の複数回出現": {
          "type": "boolean",
          "default": true,
          "description": "有効(逆接の接続助詞「が」が、同一文中に複数回出現していないかチェックします)"
        },
        "japanese-proofreading.textlint.制御文字": {
          "type": "boolean",
          "default": true,
          "description": "有効(制御文字を使用していないかチェックします)"
        },
        "japanese-proofreading.textlint.ゼロ幅スペース": {
          "type": "boolean",
          "default": true,
          "description": "有効(ゼロ幅スペースを使用していないかチェックします)"
        }
      }
    }
  },
  "scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "watch": "tsc -watch -p ./",
    "lint": "eslint src --ext .ts",
    "format": "eslint src --ext .ts --fix",
    "update-dictionary": "npm uninstall textlint-rule-preset-icsmedia && npm i ics-creative/textlint-rule-preset-icsmedia",
    "vsce:package": "vsce package"
  },
  "devDependencies": {
    "@types/node": "^18.11.18",
    "@types/vscode": "^1.74.0",
    "@typescript-eslint/eslint-plugin": "^5.48.1",
    "@typescript-eslint/parser": "^5.48.0",
    "eslint": "^8.31.0",
    "eslint-config-prettier": "^8.6.0",
    "eslint-plugin-import": "^2.27.4",
    "eslint-plugin-prettier": "^4.2.1",
    "prettier": "^2.8.2",
    "typescript": "^4.9.4"
  },
  "dependencies": {
    "textlint": "^12.5.1",
    "textlint-plugin-html": "^0.3.0",
    "textlint-plugin-latex2e": "^1.2.0",
    "textlint-plugin-review": "^0.4.1",
    "textlint-rule-preset-icsmedia": "github:ics-creative/textlint-rule-preset-icsmedia",
    "textlint-rule-preset-japanese": "^7.0.0",
    "textlint-rule-preset-jtf-style": "^2.3.13",
    "textlint-rule-prh": "^5.3.0",
    "vscode-languageclient": "^8.0.2",
    "vscode-languageserver": "^8.0.2",
    "vscode-languageserver-textdocument": "^1.0.8",
    "vscode-uri": "^3.0.7"
  }
}


================================================
FILE: src/extension.ts
================================================
import * as path from "path";
import { ExtensionContext, workspace } from "vscode";
import {
  LanguageClient,
  LanguageClientOptions,
  ServerOptions,
  TransportKind,
} from "vscode-languageclient/node";

let client: LanguageClient;

export const activate = (context: ExtensionContext) => {
  const serverModule = context.asAbsolutePath(path.join("out", "server.js"));
  const debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };
  const serverOptions: ServerOptions = {
    run: { module: serverModule, transport: TransportKind.ipc },
    debug: {
      module: serverModule,
      transport: TransportKind.ipc,
      options: debugOptions,
    },
  };
  const clientOptions: LanguageClientOptions = {
    // Register the server for plain text documents
    documentSelector: [
      { scheme: "file", language: "html" },
      { scheme: "file", language: "latex" },
      { scheme: "file", language: "review" },
      { scheme: "file", language: "plaintext" },
      { scheme: "file", language: "markdown" },
    ],
    synchronize: {
      // Notify the server about file changes to '.clientrc files contain in the workspace
      fileEvents: workspace.createFileSystemWatcher("**/.clientrc"),
    },
  };
  client = new LanguageClient(
    "languageServerTextlint",
    "Language Server Textlint",
    serverOptions,
    clientOptions,
  );
  client.start();
};

export const deactivate = (): Thenable<void> | undefined => {
  if (!client) {
    return undefined;
  }
  return client.stop();
};


================================================
FILE: src/index.d.ts
================================================
// Textlintのプラグインのモジュール宣言。ライブラリが提供していないので、自分で宣言する必要がある。
declare module "textlint-plugin-html";
declare module "textlint-plugin-latex2e";
declare module "textlint-plugin-review";


================================================
FILE: src/rules/rule-data.ts
================================================
/**
 * ルールのデフォルト設定
 */
export interface DefaultExtensionRuleType {
  /** モジュールのパッケージ名です。 */
  ruleId: string;
  /** デフォルトでルールを有効にするか? */
  enabled: boolean;
  /** package.jsonのconfigurationの名前と同一 */
  ruleName: string;
}


================================================
FILE: src/rules/rule.ts
================================================
import { DefaultExtensionRuleType } from "./rule-data";

/**
 * テキスト校正くんで使用する、「拡張機能のデフォルトルール」です。
 * 関連する機能に以下があります。
 * 「VSCodeのユーザー設定ルール」: VSCode設定画面で設定できます。
 * 「ICS MEDIA校正ルール」: GitHubで提供されている辞書とルールのセットです。
 *
 * ルールに関して、同じルールがある場合、「拡張機能のデフォルトルール」より「VSCodeのユーザー設定ルール」が優先されます。
 *

 * 「ICS MEDIA校正ルール」の辞書は、「拡張機能のデフォルトルール」内に組み込まれています。
 */
export const DEFAULT_EXTENSION_RULES: readonly DefaultExtensionRuleType[] = [
  {
    ruleName: "読点の数",
    ruleId: "preset-japanese/max-ten",
    enabled: true,
  },
  {
    ruleName: "逆接の「が」の複数回出現",
    ruleId: "preset-japanese/no-doubled-conjunctive-particle-ga",
    enabled: true,
  },
  {
    ruleName: "接続詞の連続",
    ruleId: "preset-japanese/no-doubled-conjunction",
    enabled: true,
  },
  {
    ruleName: "二重否定",
    ruleId: "preset-japanese/no-double-negative-ja",
    enabled: true,
  },
  {
    ruleName: "助詞の連続",
    ruleId: "preset-japanese/no-doubled-joshi",
    enabled: true,
  },
  {
    ruleName: "ら抜き言葉",
    ruleId: "preset-japanese/no-dropping-the-ra",
    enabled: true,
  },
  {
    ruleName: "ですます調",
    ruleId: "preset-japanese/no-mix-dearu-desumasu",
    enabled: true,
  },
  {
    ruleName: "不自然な濁点",
    ruleId: "preset-japanese/no-nfd",
    enabled: true,
  },
  {
    ruleName: "制御文字",
    ruleId: "preset-japanese/no-invalid-control-character",
    enabled: true,
  },
  {
    ruleName: "ゼロ幅スペース",
    ruleId: "preset-japanese/no-zero-width-spaces",
    enabled: true,
  },
  {
    ruleName: "康煕部首",
    ruleId: "preset-japanese/no-kangxi-radicals",
    enabled: true,
  },
  {
    ruleName: "誤字",
    ruleId: "prh/誤字",
    enabled: true,
  },
  {
    ruleName: "重言",
    ruleId: "prh/重言",
    enabled: true,
  },
  {
    ruleName: "ひらく漢字",
    ruleId: "prh/ひらく漢字",
    enabled: true,
  },
  {
    ruleName: "冗長な表現",
    ruleId: "prh/冗長な表現",
    enabled: true,
  },
  {
    ruleName: "外来語カタカナ表記",
    ruleId: "prh/外来語カタカナ表記",
    enabled: true,
  },
  {
    ruleName: "固有名詞",
    ruleId: "prh/固有名詞",
    enabled: true,
  },
  {
    ruleName: "技術用語",
    ruleId: "prh/技術用語",
    enabled: true,
  },
  {
    /**
     * 有効の場合:
     * 句読点には全角の「、」と「。」を使います。和文の句読点としてピリオド(.)とカンマ(,)を使用しません。
     *
     * テキスト校正くんでは、和文の句読点として半角ピリオド(.)と半角カンマ(.)が使用されているかチェックするために使用します。
     */
    ruleName: "ピリオドとカンマの使用(半角)",
    ruleId: "preset-jtf-style/1.2.1.句点(。)と読点(、)",
    enabled: true,
  },
  {
    /**
     * 有効の場合:
     * 欧文で表記する組織名などの固有名詞や数字にピリオド(.)やカンマ(,)が含まれる場合は、和文中でもピリオド(.)とカンマ(,)を使用します。
     *
     * テキスト校正くんでは、和文の句読点として全角ピリオド(.)と全角カンマ(,)が使用されているかチェックするために使用します。
     * 注意点として、1行に1文字のみ検知するようになっています。
     */
    ruleName: "ピリオドとカンマの使用(全角)",
    ruleId: "preset-jtf-style/1.2.2.ピリオド(.)とカンマ(,)",
    enabled: true,
  },
  {
    ruleName: "算用数字",
    ruleId: "preset-jtf-style/2.1.8.算用数字",
    enabled: true,
  },
  {
    ruleName: "アルファベット",
    ruleId: "preset-jtf-style/2.1.9.アルファベット",
    enabled: true,
  },
  {
    ruleName: "算用数字と漢数字の使い分け",
    ruleId: "preset-jtf-style/2.2.2.算用数字と漢数字の使い分け",
    enabled: true,
  },
  {
    ruleName: "一部の助数詞の表記",
    ruleId: "preset-jtf-style/2.2.3.一部の助数詞の表記",
    enabled: true,
  },
  {
    ruleName: "全角文字と半角文字の間",
    ruleId: "preset-jtf-style/3.1.1.全角文字と半角文字の間",
    enabled: true,
  },
  {
    ruleName: "全角文字どうし",
    ruleId: "preset-jtf-style/3.1.2.全角文字どうし",
    enabled: true,
  },
  {
    ruleName: "かっこ類と隣接する文字の間のスペースの有無",
    ruleId: "preset-jtf-style/3.3.かっこ類と隣接する文字の間のスペースの有無",
    enabled: true,
  },
  {
    ruleName: "疑問符(?)",
    ruleId: "preset-jtf-style/4.2.2.疑問符(?)",
    enabled: true,
  },
  {
    ruleName: "ハイフン(-)",
    ruleId: "preset-jtf-style/4.2.6.ハイフン(-)",
    enabled: true,
  },
  {
    ruleName: "ダッシュ(-)",
    ruleId: "preset-jtf-style/4.2.9.ダッシュ(-)",
    enabled: true,
  },
  {
    ruleName: "丸かっこ()",
    ruleId: "preset-jtf-style/4.3.1.丸かっこ()",
    enabled: true,
  },
  {
    ruleName: "大かっこ[]",
    ruleId: "preset-jtf-style/4.3.2.大かっこ[]",
    enabled: true,
  },
] as const;


================================================
FILE: src/server.ts
================================================
/* eslint-disable prettier/prettier */
import * as path from "path";
// eslint-disable-next-line import/named
import { TextlintMessage, TextlintResult } from "@textlint/kernel";
import { createLinter, loadTextlintrc } from "textlint";
import { TextDocument } from "vscode-languageserver-textdocument";
import { configPath } from "textlint-rule-preset-icsmedia";
import {
  createConnection,
  Diagnostic,
  DiagnosticSeverity,
  DidChangeConfigurationNotification,
  InitializeParams,
  Position,
  ProposedFeatures,
  Range,
  TextDocuments,
  TextDocumentSyncKind,
  CodeActionKind,
  CodeAction,
  TextDocumentEdit,
  TextEdit,
  CodeActionParams,
} from "vscode-languageserver/node";
import { URI } from "vscode-uri";
import * as HTMLPlugin from "textlint-plugin-html";
import LatexPlugin from "textlint-plugin-latex2e";
import ReviewPlugin from "textlint-plugin-review";
import { DEFAULT_EXTENSION_RULES } from "./rules/rule";

const APP_NAME = "テキスト校正くん";

// サーバーへの接続を作成(すべての提案された機能も含む)
const connection = createConnection(ProposedFeatures.all);
// テキストドキュメントを管理するクラスを作成します。
const documents: TextDocuments<TextDocument> = new TextDocuments(TextDocument);

let hasConfigurationCapability = false;

connection.onInitialize((params: InitializeParams) => {
  const capabilities = params.capabilities;
  hasConfigurationCapability =
    (capabilities.workspace && !!capabilities.workspace.configuration) ?? false;

  return {
    capabilities: {
      textDocumentSync: TextDocumentSyncKind.Incremental,
      codeActionProvider: true, // connection.onCodeAction を有効にする
    },
  };
});

connection.onInitialized(() => {
  if (hasConfigurationCapability) {
    connection.client.register(
      DidChangeConfigurationNotification.type,
      undefined,
    );
  }
});

/**
 * コードアクションのハンドラです。
 * クイックフィックス機能の追加を行っています。
 */
connection.onCodeAction((params: CodeActionParams) => {
  const textDocument = documents.get(params.textDocument.uri);
  // コードアクションの種類にクイックフィックスが存在するか?
  const hasQuickFix = params.context.only?.some((kind) => kind === CodeActionKind.QuickFix) ?? false;
  if (!textDocument || !hasQuickFix) {
    return;
  }

  // この拡張機能の診断結果を取得
  const diagnostics = params.context.diagnostics.filter(v => v.source === APP_NAME);
  // 修正可能な診断結果は、クイックフィックスを追加
  const quickFixActions = diagnostics.filter(v => v.data !== undefined).map((diagnostic) => {
    return createQuickFixAction(diagnostic, textDocument);
  });
  return quickFixActions;
});

const getDefaultTextlintSettings = () => {
  const mySettings: { [key: string]: boolean } = {};

  DEFAULT_EXTENSION_RULES.forEach((value) => {
    mySettings[value.ruleName] = value.enabled;
  });

  return mySettings;
};

const defaultSettings: ITextlintSettings = {
  maxNumberOfProblems: 1000,
  textlint: getDefaultTextlintSettings(),
};
let globalSettings: ITextlintSettings = defaultSettings;
const documentSettings: Map<string, Thenable<ITextlintSettings>> = new Map();

connection.onDidChangeConfiguration((change) => {
  if (hasConfigurationCapability) {
    // Reset all cached document settings
    documentSettings.clear();
  } else {
    globalSettings = (change.settings["japanese-proofreading"] ||
      defaultSettings) as ITextlintSettings;
  }

  // Revalidate all open text documents
  documents.all().forEach(validateTextDocument);
});

/**
 * VSCode側の設定を取得します。
 */
const getDocumentSettings = (resource: string): Thenable<ITextlintSettings> => {
  if (!hasConfigurationCapability) {
    return Promise.resolve(globalSettings);
  }
  let result = documentSettings.get(resource);
  if (!result) {
    result = connection.workspace.getConfiguration({
      scopeUri: resource,
      section: "japanese-proofreading",
    });
    documentSettings.set(resource, result);
  }
  return result;
};

// Only keep settings for open documents
documents.onDidClose((close) => {
  documentSettings.delete(close.document.uri);
  resetTextDocument(close.document);
});

// ドキュメントを初めて開いた時と内容に変更があった際に実行します。
documents.onDidChangeContent(async (change) => {
  validateTextDocument(change.document);
});

// バリデーション(textlint)を実施
const validateTextDocument = async (
  textDocument: TextDocument,
): Promise<void> => {
  // VSCode側の設定を取得
  const settings = await getDocumentSettings(textDocument.uri);

  const document = textDocument.getText();

  // ICS MEDIAのルールのtextlintの設定ファイルを読み込み
  const defaultDescriptor = await loadTextlintrc({
    configFilePath: configPath,
  });

  // デフォルトのプラグイン設定を取得。テキスト・マークダウン用のプラグインなどが入っている想定
  const defalutPluginSettings = defaultDescriptor.toKernelOptions().plugins;

  // 追加のプラグイン設定
  const extendPlugins = [
    {
      pluginId: "@textlint/textlint-plugin-html",
      plugin: HTMLPlugin,
    },
    {
      pluginId: "@textlint/textlint-plugin-latex2e",
      plugin: LatexPlugin,
    },
    {
      pluginId: "@textlint/textlint-plugin-review",
      plugin: ReviewPlugin,
    },
  ];

  let descriptor;

  if (defalutPluginSettings) {
    descriptor = defaultDescriptor.shallowMerge({
      plugins: [...defalutPluginSettings, ...extendPlugins],
    });
  } else {
    descriptor = defaultDescriptor.shallowMerge({
      plugins: [...extendPlugins],
    });
  }

  // ファイルの拡張子
  const ext: string = path.extname(textDocument.uri);
  // サポートされている拡張子
  const targetExtension = descriptor.availableExtensions.find((i) => i === ext) ?? null;

  // 対応していない拡張子の場合、バリデーションを実行しない
  if (targetExtension === null) {
    return;
  }

  const linter = createLinter({
    descriptor,
  });
  const results: TextlintResult = await linter.lintText(
    document,
    URI.parse(textDocument.uri).fsPath,
  );
  const diagnostics: Diagnostic[] = [];

  // エラーが存在する場合
  if (results.messages.length) {
    // エラーメッセージ一覧を取得
    const messages: TextlintMessage[] = results.messages;
    const l: number = messages.length;
    for (let i = 0; i < l; i++) {
      const message: TextlintMessage = messages[i];
      const text = `${message.message}(${message.ruleId})`;

      // 有効とされているエラーか?
      if (!isTarget(settings, message.ruleId, message.message)) {
        continue;
      }

      // エラー範囲の開始位置のズレ
      let startCharacterDiff = 0;

      // エラーのルールが「不自然な濁点」か?
      const isRuleNoNfd = message.ruleId === "japanese/no-nfd";
      if(isRuleNoNfd) {
        // ルール「不自然な濁点」は、修正テキストを1文字ずらして生成していると思われるため、エラー開始位置も1文字ずらしたい
        startCharacterDiff = -1;
      }

      // エラーの文字数を取得します。
      // 文字数が存在しない場合の値は1になります。
      const posRange = message.fix?.range
        ? message.fix.range[1] - message.fix.range[0]
        : 1;
      // エラーの開始位置を取得します。
      const startPos = Position.create(
        Math.max(0, message.loc.start.line - 1),
        Math.max(0, message.loc.start.column - 1 + startCharacterDiff),
      );
      // エラーの終了位置を取得します。
      const endPos = Position.create(
        Math.max(0, message.loc.end.line - 1),
        Math.max(0, message.loc.start.column - 1 + startCharacterDiff + posRange),
      );
      const canAutofixMessage = message.fix ? "🪄 " : "";
      // 診断結果を作成
      const diagnostic: Diagnostic = {
        severity: toDiagnosticSeverity(message.severity),
        range: Range.create(startPos, endPos),
        message: canAutofixMessage + text,
        source: APP_NAME,
        code: message.ruleId,
        data: message.fix?.text,
      };
      diagnostics.push(diagnostic);
    }
  }
  // 診断結果をVSCodeに送信し、ユーザーインターフェースに表示します。
  connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
};

/**
 * 設定で有効としているエラーかどうか判定します。
 * @param settings VSCode側の設定
 * @param targetRuleId エラーのルールID
 * @param message エラーメッセージ
 * @returns
 */
const isTarget = (
  settings: ITextlintSettings,
  targetRuleId: string,
  message: string,
): boolean => {
  let bool = false;
  DEFAULT_EXTENSION_RULES.forEach((rule) => {
    if (targetRuleId === "prh") {
      // prhのルールの場合

      // ruleIdからprh内の細かいルールを取得できないのでmessageに含まれているか取得している
      const ruleIdSub = rule.ruleId.split("/")[1];
      if (message.includes(`(${ruleIdSub})`)) {
        // VSCodeの設定に存在しないルールは、デフォルト設定を使用します。
        bool = settings.textlint[rule.ruleName] ?? rule.enabled;
      }
    } else if (rule.ruleId.includes(targetRuleId)) {
      // 使用するルールのIDとエラーのルールIDが一致する場合

      // VSCodeの設定に存在しないルールは、デフォルト設定を使用します。
      // 例: ですます調、jtf-style/1.2.2
      bool = settings.textlint[rule.ruleName] ?? rule.enabled;
    }
  });
  return bool;
};

/**
 * validate済みの内容を破棄します。
 * @param textDocument
 */
const resetTextDocument = async (textDocument: TextDocument): Promise<void> => {
  const diagnostics: Diagnostic[] = [];
  connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
};

const toDiagnosticSeverity = (severity: number) => {
  switch (severity) {
    case 0:
      return DiagnosticSeverity.Information;
    case 1:
      return DiagnosticSeverity.Warning;
    case 2:
      return DiagnosticSeverity.Error;
  }
  return DiagnosticSeverity.Information;
};

/**
 * 診断結果の自動修正が可能な場合、クイックフィックスのコードアクションを作成します。
 * @param diagnostic
 * @param textDocument
 */
const createQuickFixAction = (diagnostic: Diagnostic, textDocument: TextDocument) => {
  const textEdits: TextEdit[] = [TextEdit.replace(diagnostic.range, diagnostic.data)];
  const documentChanges = {
    documentChanges: [
      TextDocumentEdit.create(
        {
          uri: textDocument.uri,
          version: textDocument.version
        },
        textEdits,
      )
    ],
  };

  const fixAction = CodeAction.create(
    "問題を自動修正する(テキスト校正くん)",
    documentChanges,
    CodeActionKind.QuickFix
  );

  // 作成したクイックフィックスのアクションを診断結果と紐付ける
  fixAction.diagnostics = [diagnostic];

  return fixAction;
}

// Make the text document manager listen on the connection
// for open, change and close text document events
documents.listen(connection);

// Listen on the connection
connection.listen();

/**
 * VSCode側の設定
 */
interface ITextlintSettings {
  /** 問題を表示する最大数 */
  maxNumberOfProblems: number;
  /**
   * textlintの設定
   * trueとなっているルールを適用します。
   */
  textlint: { [key: string]: boolean };
}


================================================
FILE: tsconfig.json
================================================
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "ES2020",
    "outDir": "out",
    "lib": [
      "ES2020"
    ],
    "sourceMap": true,
    "rootDir": "src",
    /* Strict Type-Checking Option */
    "strict": true,   /* enable all strict type-checking options */
    /* Additional Checks */
    "noImplicitAny": true,
    "noUnusedLocals": true, /* Report errors on unused locals. */
    "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
    "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
    "noUnusedParameters": true,  /* Report errors on unused parameters. */

  },
  "exclude": [
    "node_modules",
  ]
}
Download .txt
gitextract_15gqhu90/

├── .editorconfig
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .prettierrc
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   ├── settings.json
│   └── tasks.json
├── .vscodeignore
├── CHANGELOG.md
├── DEVELOPMENT.md
├── EXAMPLES.md
├── LICENSE.txt
├── README.md
├── images/
│   └── icon.psd
├── package.json
├── src/
│   ├── extension.ts
│   ├── index.d.ts
│   ├── rules/
│   │   ├── rule-data.ts
│   │   └── rule.ts
│   └── server.ts
└── tsconfig.json
Download .txt
SYMBOL INDEX (4 symbols across 3 files)

FILE: src/rules/rule-data.ts
  type DefaultExtensionRuleType (line 4) | interface DefaultExtensionRuleType {

FILE: src/rules/rule.ts
  constant DEFAULT_EXTENSION_RULES (line 14) | const DEFAULT_EXTENSION_RULES: readonly DefaultExtensionRuleType[] = [

FILE: src/server.ts
  constant APP_NAME (line 31) | const APP_NAME = "テキスト校正くん";
  type ITextlintSettings (line 358) | interface ITextlintSettings {
Condensed preview — 23 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (51K chars).
[
  {
    "path": ".editorconfig",
    "chars": 207,
    "preview": "# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_"
  },
  {
    "path": ".eslintrc.js",
    "chars": 793,
    "preview": "module.exports = {\n  root: true,\n  parser: \"@typescript-eslint/parser\",\n  parserOptions: {\n    ecmaVersion: 6,\n    sourc"
  },
  {
    "path": ".gitattributes",
    "chars": 77,
    "preview": "# Set default behavior to automatically normalize line endings.\n* text=auto\n\n"
  },
  {
    "path": ".gitignore",
    "chars": 76,
    "preview": "out\nnode_modules\n.vscode-test/\n*.vsix\n\n.DS_Store\nThumbs.db\n.idea\n\nyarn.lock\n"
  },
  {
    "path": ".prettierrc",
    "chars": 56,
    "preview": "{\n  \"trailingComma\": \"all\",\n  \"arrowParens\": \"always\"\n}\n"
  },
  {
    "path": ".vscode/extensions.json",
    "chars": 168,
    "preview": "{\n\t// See http://go.microsoft.com/fwlink/?LinkId=827846\n\t// for the documentation about the extensions.json format\n\t\"rec"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 1224,
    "preview": "// A launch configuration that compiles the extension and then opens it inside a new window\n// Use IntelliSense to learn"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 444,
    "preview": "// Place your settings in this file to overwrite default and user settings.\n{\n    \"files.exclude\": {\n        \"out\": fals"
  },
  {
    "path": ".vscode/tasks.json",
    "chars": 494,
    "preview": "// See https://go.microsoft.com/fwlink/?LinkId=733558\n// for the documentation about the tasks.json format\n{\n    \"versio"
  },
  {
    "path": ".vscodeignore",
    "chars": 118,
    "preview": ".vscode/**\nout/test/**\nout/**/*.map\nsrc/**\n.gitignore\ntsconfig.json\nvsc-extension-quickstart.md\neslintrc.json\n*/**.psd"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 1380,
    "preview": "# Change Log\n\n## 1.3.0(2023.04.07)\n\n- 内部の構成をリファクタリング\n- 初期設定では、校正ルール「助詞の連続」をオフに変更\n- 自動修正が可能な校正ルールにクイックフィックスを追加\n\n## 1.2.0("
  },
  {
    "path": "DEVELOPMENT.md",
    "chars": 754,
    "preview": "# 「テキスト校正くん」の開発について\n\n## 開発環境の構築\n\n1. VS Codeで本プロジェクトのルートディレクトリを開いてください。\n2. ターミナルから`npm i`で必要なパッケージをインストールしてください。\n3. VS Co"
  },
  {
    "path": "EXAMPLES.md",
    "chars": 2100,
    "preview": "# テキスト校正くんチェック事例\nこちらに書かれている内容はテキスト校正くんにて検出される**NG例**です。\n\n## 「ですます」調と「である」調の混在\nこれは素敵です。あれは平凡である。\n\n---\n補足:ですます調の検出には[textl"
  },
  {
    "path": "LICENSE.txt",
    "chars": 1065,
    "preview": "MIT License\n\nCopyright (c) 2018 ICS INC.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
  },
  {
    "path": "README.md",
    "chars": 1280,
    "preview": "# テキスト校正くん\n\nVS Code上でテキストファイル・Markdownファイル・Re:VIEWファイルの日本語の文章をチェックする拡張機能です。該当のファイルを開いた時、更新した時に自動で校正のチェックを行い、文章内の問題のある箇所を"
  },
  {
    "path": "package.json",
    "chars": 8214,
    "preview": "{\n  \"name\": \"japanese-proofreading\",\n  \"displayName\": \"テキスト校正くん\",\n  \"description\": \"VS CodeでテキストファイルやMarkdownファイルの日本語の文章"
  },
  {
    "path": "src/extension.ts",
    "chars": 1510,
    "preview": "import * as path from \"path\";\nimport { ExtensionContext, workspace } from \"vscode\";\nimport {\n  LanguageClient,\n  Languag"
  },
  {
    "path": "src/index.d.ts",
    "chars": 178,
    "preview": "// Textlintのプラグインのモジュール宣言。ライブラリが提供していないので、自分で宣言する必要がある。\ndeclare module \"textlint-plugin-html\";\ndeclare module \"textlint-"
  },
  {
    "path": "src/rules/rule-data.ts",
    "chars": 221,
    "preview": "/**\n * ルールのデフォルト設定\n */\nexport interface DefaultExtensionRuleType {\n  /** モジュールのパッケージ名です。 */\n  ruleId: string;\n  /** デフォル"
  },
  {
    "path": "src/rules/rule.ts",
    "chars": 3921,
    "preview": "import { DefaultExtensionRuleType } from \"./rule-data\";\n\n/**\n * テキスト校正くんで使用する、「拡張機能のデフォルトルール」です。\n * 関連する機能に以下があります。\n * 「"
  },
  {
    "path": "src/server.ts",
    "chars": 9975,
    "preview": "/* eslint-disable prettier/prettier */\nimport * as path from \"path\";\n// eslint-disable-next-line import/named\nimport { T"
  },
  {
    "path": "tsconfig.json",
    "chars": 730,
    "preview": "{\n  \"compilerOptions\": {\n    \"module\": \"commonjs\",\n    \"target\": \"ES2020\",\n    \"outDir\": \"out\",\n    \"lib\": [\n      \"ES20"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the ics-creative/project-japanese-proofreading GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 23 files (34.2 KB), approximately 12.9k tokens, and a symbol index with 4 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!