└── README.md /README.md: -------------------------------------------------------------------------------- 1 | ![banner](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/banner.png) 2 | 3 | [![Discord](https://img.shields.io/discord/666020457568403505?logo=discord&style=flat-square)](https://discord.gg/EbdseuS) 4 | [![GitHub Actions](https://img.shields.io/github/workflow/status/SPGoding/vscode-datapack-helper-plus/Release?logo=github&style=flat-square)](https://github.com/SPGoding/vscode-datapack-helper-plus/actions) 5 | [![VSCode Marketplace](https://img.shields.io/visual-studio-marketplace/v/SPGoding.datapack-language-server.svg?logo=visual-studio-code&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) 6 | [![VSCode Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/SPGoding.datapack-language-server.svg?logo=visual-studio-code&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) 7 | [![VSCode Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/SPGoding.datapack-language-server.svg?logo=visual-studio-code&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) 8 | [![VSCode Marketplace Rating](https://img.shields.io/visual-studio-marketplace/stars/SPGoding.datapack-language-server.svg?logo=visual-studio-code&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) 9 | [![License](https://img.shields.io/github/license/SPGoding/vscode-datapack-helper-plus.svg?style=flat-square)](https://github.com/SPGoding/vscode-datapack-helper-plus/blob/master/LICENSE) 10 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) 11 | [![Gitmoji](https://img.shields.io/badge/gitmoji-%20%F0%9F%98%9C%20%F0%9F%98%8D-FFDD67.svg?style=flat-square)](https://gitmoji.carloscuesta.me/) 12 | 13 | #### [English\(original\)](https://github.com/SPGoding/vscode-datapack-helper-plus/blob/master/README.md) / 日本語 / [简体中文](https://github.com/SPGoding/vscode-datapack-helper-plus/blob/master/README-zh_Hans.md) 14 | 15 | Data-pack Helper Plusは、advancements, dimensions, dimension types, functions, loot tables, predicates, recipes, あらゆる種類のtags, worldgen設定を含むデータパック内のドキュメントのための強力な言語機能を提供します。 16 | 17 | この拡張機能を気に入ったら、私を[支援](https://github.com/sponsors/SPGoding)することも検討してください。他にもバグの報告, 機能の提案, 翻訳のサポートも可能です! 詳細については[CONTRIBUTING.md](https://github.com/SPGoding/datapack-language-server/blob/master/CONTRIBUTING.md)を参照してください。 18 | 19 | - [免責事項](#免責事項) 20 | - [インストール方法](#インストール方法) 21 | - [機能](#機能) 22 | - [ワークスペースサポート](#ワークスペースサポート) 23 | - [複数言語のサポート](#複数言語のサポート) 24 | - [セマンティックハイライト](#セマンティックハイライト) 25 | - [記入情報](#記入情報) 26 | - [補完](#補完) 27 | - [コードスニペット](#コードスニペット) 28 | - [宣言コメント](#宣言コメント) 29 | - [エイリアスコメント](#エイリアスコメント) 30 | - [診断とコードアクション](#診断とコードアクション) 31 | - [フォーマットと校閲](#フォーマットと校閲) 32 | - [折りたたみ範囲](#折りたたみ範囲) 33 | - [Call Hierarchy](#call-hierarchy) 34 | - [カラーインフォメーション](#カラーインフォメーション) 35 | - [ホバーインフォメーション](#ホバーインフォメーション) 36 | - [名前空間パスの移動](#名前空間パスの移動) 37 | - [定義への移動](#定義への移動) 38 | - [参照の検索](#参照の検索) 39 | - [名前の変更](#名前の変更) 40 | - [構成設定](#構成設定) 41 | - [キャッシュの再生成](#キャッシュの再生成) 42 | 43 | # 免責事項 44 | 45 | > [MIT License](https://github.com/SPGoding/vscode-datapack-helper-plus/blob/master/LICENSE) 46 | 47 | 私たちはあなたのデータパックを安全に保つために最善を尽くしています。しかし、ドキュメントはDHPによって特定の極端な状況下で破損する可能性があり、発生した場合はサポートを提供できません。大切な作業データはクラウドストレージにアップロードするなど、随時**バックアップ**してください。これは、DHPを使用しない場合でも非常に重要です。 48 | 49 | # インストール方法 50 | 51 | DHPはVSCode Marketplaceからインストール出来ます: [![VSCode Marketplace](https://img.shields.io/visual-studio-marketplace/v/SPGoding.datapack-language-server.svg?logo=visual-studio-code&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) 52 | 53 | もしくは、VSCodeで`Ctrl + P`を入力し`ext install spgoding.datapack-language-server`を実行します。 54 | 55 | **注**: DHPが動作するにはVSCodeのバージョンが最低でも1.44.0以上である必要があります。VSCodeがこのバージョンより新しいことを確認してください。 56 | 57 | # 機能 58 | 59 | ## ワークスペースサポート 60 | 61 | データパックのルートフォルダ(`data`フォルダと`pack.mcmeta`ファイルがある階層)をワークスペースのルートフォルダとして使用することで、DHPが最高の機能を提供できるようになります。 62 | 63 | さらに、DHPはVSCodeのマルチルートワークスペース機能を完全にサポートしています。`data`フォルダと`pack.mcmeta`ファイルを含むすべてのルートはデータパックと見なされ、補完が提供されます。その他のルートフォルダはDHPの影響を受けません。 64 | 65 | 同じワークスペース内にある限り、どのルートのコンテンツにもアクセスできます。ワークスペース内のルートの順序は、DHPにおけるこれらのデータパックの優先度に影響します。最初のルートが最初にロードされ、最後のルートが最後にロードされます。これは、Minecraft がデータパックをロードして、同じ名前空間 ID を持ち、同じカテゴリにあるファイルの場合、どちらが別のファイルを上書きするかを決定する方法と全く同じです。例えば、マルチルートのワークスペースが下記のようになっているとしましょう。 66 | 67 | ``` 68 | ─── (Root) Datapack A 69 | ├── data 70 | | └── spgoding 71 | | └── functions 72 | | └── foo.mcfunction 73 | └── pack.mcmeta 74 | ─── (Root) Datapack B 75 | ├── data 76 | | └── spgoding 77 | | └── functions 78 | | └── foo.mcfunction 79 | └── pack.mcmeta 80 | ``` 81 | 82 | そして、mcfunctionファイルで`F2`を押してmcfunctionの`spgoding:foo`を`wtf:foo`に名前を変更すると、Datapack A(`Datapack A/data/spgoding/functions/foo.mcfunction`)に同じ名前空間IDを持つmcfunctionがあったとしても、Datapack B(`Datapack B/data/spgoding/functions/foo.mcfunction`)のファイルだけが、Datapack B(`Datapack B/data/wtf/functions/foo.mcfunction`)に移動してしまいます。 83 | 84 | これらのコマンドをMinecraftで実行しようとすると、Datapack Bの関数が実行されていることにも気付くことができます。 85 | ```mcfunction 86 | datapack enable "file/Datapack A" first 87 | datapack enable "file/Datapack B" last 88 | function spgoding:foo 89 | ``` 90 | 91 | このように動作することにより、DHPはデータパックを処理する順序がMinecraftと一致することを保証します。 92 | 93 | **注**: VSCodeにルートフォルダーをドラッグして配置すると、順序を並べ替えることができます。DHPは、ルートフォルダーの優先度をそれに応じて更新します。これは非常に便利です。 94 | 95 | ## 複数言語のサポート 96 | 97 | DHPは複数の言語をサポートしています。現在これらの言語が利用可能です: 98 | 99 | | 言語 | VSCode 言語 ID | 100 | | --------------- | -------------- | 101 | | ドイツ語 | `de` | 102 | | 英語 | `en` | 103 | | フランス語 | `fr` | 104 | | イタリア語 | `it` | 105 | | 日本語 | `ja` | 106 | | 中国語 (簡体字) | `zh-cn` | 107 | 108 | このプロジェクトを他の言語に翻訳していただけると助かります。詳細については[CONTRIBUTING.md](https://github.com/SPGoding/datapack-language-server/blob/master/CONTRIBUTING.md)を参照してください。 109 | 110 | ## セマンティックハイライト 111 | 112 | > Wiki: https://github.com/ChenCMD/datapack-helper-plus-JP-Wiki/wiki/Semantic-Coloring 113 | 114 | すべてのコマンド引数に意味を持った色を付けることができます。[Arcensoth](https://github.com/Arcensotj)の[language-mcfunction拡張機能](https://github.com/Arcensoth/language-mcfunction)をインストールして、カラーリングのフィードバックを高速に取得することもお勧めします。 115 | 116 | ![semantic-coloring](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/semantic-coloring.png) 117 | 118 | ## 記入情報 119 | 120 | 入力中にコマンドの引数に関するヒントを得ることができます。スペースを入力すると記入情報が自動的に表示されます。 121 | 122 | または、`Ctrl + Shift + Space`(またはその他の構成済みのホットキー)を使用して、記入情報を手動で表示することもできます。 123 | 124 | ![signature-help](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/signature-help.gif) 125 | 126 | ## 補完 127 | 128 | 拡張機能は、コマンドを入力するときに補完を提供します。次のいずれかの文字を入力すると、補完が自動的に表示されます 129 | 130 | `[' ', ',', '{', '[', '=', ':', '/', '!', "'", '"', '.', '@']`. 131 | 132 | または、`Ctrl + Space`(またはその他の構成済みのホットキー)を使用して、補完を手動で表示することもできます。 133 | 134 | DHPは、単純なコマンドの補完を提供できます。 135 | ![simple-completions](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/simple-completions.gif) 136 | 137 | より複雑なNBTタグの補完は[Yurihaia](https://github.com/Yurihaia)の[mc-nbtdoc](https://github.com/Yurihaia/mc-nbtdoc)の助けを借りて 138 | ![nbt-tag-completions](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/nbt-tag-completions.gif) 139 | 140 | また、NBTPathや 141 | ![nbt-path-completions](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/nbt-path-completions.gif) 142 | 143 | また、テキストコンポーネントや 144 | ![text-component-completions](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/text-component-completions.gif) 145 | 146 | そして、それらのネストされたコマンドにも 147 | ![ohhhhh-completions](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/ohhhhh-completions.gif) 148 | 149 | ## コードスニペット 150 | 151 | DHPはいくつかの有用なコードスニペットを提供します。コードスニペットの詳細については、[VSCodeの公式ドキュメント](https://code.visualstudio.com/docs/editor/userdefinedsnippets)をご覧ください。DHPとVSCodeはどちらもコードスニペットをカスタマイズでき、DHPはVSCodeに基づいているため同じ構文を使用します。 152 | 153 | mcfunctionファイルの場合、DHPによって追加されたコードスニペットは、カーソルがコマンドの先頭にあるときにのみ補完リストに表示されますが、VSCodeのファイル`Code/User/snippets/mcfunction.json`によって追加されたスニペットはファイル内のどこにでも表示されます。 154 | 155 | VSCodeのコードスニペットをカスタマイズする場合は[公式ドキュメント](https://code.visualstudio.com/docs/editor/userdefinedsnippets)を、DHPのスニペットをカスタマイズする場合は、[構成設定](#構成設定)セクションを参照してください。 156 | 157 | ![code-snippets](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/code-snippets.gif) 158 | 159 | ## 宣言コメント 160 | 161 | > Wiki: https://github.com/ChenCMD/datapack-helper-plus-JP-Wiki/wiki/Declare-Comment 162 | 163 | `#declare|#define []`を記入すると補完, シンボルの名前変更, およびDHPによる参照/定義の検索に使用される文字列を宣言できます。 164 | 165 | ゲーム内では宣言コメントを通常のコメントとして扱います。 166 | 167 | ![declaration-comments](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/declaration-comments.png) 168 | 169 | ## エイリアスコメント 170 | 171 | > Wiki: https://github.com/ChenCMD/datapack-helper-plus-JP-Wiki/wiki/Alias-Comment 172 | 173 | `#alias `を記入すると特定の引数の補完に表示される文字列を定義できます。これにより、選択したときに別の値が挿入されます。 174 | 175 | ![alias-comments](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/alias-comments.gif) 176 | 177 | ## 診断とコードアクション 178 | 179 | > Wiki for code actions: https://github.com/ChenCMD/datapack-helper-plus-JP-Wiki/wiki/Code-Actions 180 | 181 | DHPは、コマンドに関するリアルタイムの診断を提供します。Minecraftと同様に構文エラーを表示し、さらに詳細な警告を表示することも可能です。 182 | 183 | 一部の診断には対応するクイックフィックスアクションもあり、簡単に修正できます。 184 | 185 | ![diagnostics](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/diagnostics.gif) 186 | 187 | ## フォーマットと校閲 188 | 189 | > Wiki: https://github.com/ChenCMD/datapack-helper-plus-JP-Wiki/wiki/Lint-Rules 190 | 191 | `Shift + Alt + F`(またはその他の構成済みのホットキー)を押すことにより、現在の機能をフォーマットできます。 192 | 193 | また、構成設定で設定できる校正ルールがいくつかあります。DHPは、ユーザーの設定に従わないコマンドのエラーを報告します。 194 | 195 | ![formatting](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/formatting.gif) 196 | 197 | ## 折りたたみ範囲 198 | 199 | コメント(#regionおよび#endregion)を使用して折りたたみ範囲を作成できます。これにより、mcfunctionファイルの構造がより明確になります。 200 | 201 | ```mcfunction 202 | #region This is a block of commands 203 | execute if score @s test matches 1 run say 1 204 | execute if score @s test matches 2 run say 2 205 | execute if score @s test matches 3 run say 3 206 | execute if score @s test matches 4 run say 4 207 | execute if score @s test matches 5 run say 5 208 | #endregion 209 | ``` 210 | 211 | または、異なる値のハッシュ記号に続いて少なくとも1つの空白を使用して、異なるレベルの折りたたみ範囲を作成できます。 212 | 213 | ```mcfunction 214 | #region This is a block of commands 215 | # One 216 | ## One - 1 217 | execute if score @s foo matches 1 run say 1 218 | execute if score @s foo matches 2 run say 2 219 | ## One - 2 220 | execute if score @s bar matches 1 run say 1 221 | execute if score @s bar matches 2 run say 2 222 | # Two 223 | execute if score @p test matches 1 run say 1 224 | #endregion 225 | ``` 226 | 227 | ![folding-ranges](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/folding-ranges.gif) 228 | 229 | ## Call Hierarchy 230 | 231 | この機能は、インサイダーバージョンでのみ使用可能な、提案されたAPIを使用しています。 232 | 233 | Call Hierarchyは、関数をナビゲートするための優れた方法です。この機能を使用してfunction, functionTag, AdvancememntRewardsのすべての呼び出し元/呼び出し先を取得できます。この機能のデフォルトのホットキーは`Shift + Alt + H`です。 234 | 235 | ![call-hierarchy](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/call-hierarchy.gif) 236 | 237 | ## カラーインフォメーション 238 | 239 | DHPはNBTの`dust`パーティクルと`color`タグの色を表示します。カーソルを合わせる事で色を変更出来ます。 240 | 241 | ![color-information](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/color-information.gif) 242 | 243 | ## ホバーインフォメーション 244 | 245 | この機能は製作段階のものです。 246 | 247 | DHPはfunctionの名前空間ID,tag,teamなどの特定の引数にカーソルを合わせると、ユーザー定義のドキュメントを表示します。 248 | 249 | 250 | 251 | ## 名前空間パスの移動 252 | 253 | 名前空間IDをCtrlキーを押しながらクリックすると advancements, loot tables, functions, predicates, あらゆる種類のtagsに移動できます。 254 | 255 | ![document-link](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/document-link.gif) 256 | 257 | ## 定義への移動 258 | 259 | `Ctrl`キーを押しながらobjectives, entities, tags, teams, bossbars, and data storagesをクリックすると定義に移動できます。 260 | 261 | ![goto-definition](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/goto-definition.gif) 262 | 263 | ## 参照の検索 264 | 265 | `Shift + F12`(またはその他の構成済みのホットキー)を押すと、ワークスペースでobjectives, entities, tags, teams, bossbars, data storages, advancements, functions, loot tables, predicates, recipes, あらゆる種類のtagsの参照を見つけることができます。 266 | 267 | ![peek-references](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/peek-references.gif) 268 | 269 | ## 名前の変更 270 | 271 | entity, tags, teams, bossbars, data storages, advancements, functions, loot tables, predicates, recipes, あらゆる種類のtagsの名前を変更するには、それらの名前にカーソルを合わせ`F2`またはその他の構成済みキーを押します。 272 | 273 | ワークスペース全体で同じシンボルのすべての参照の名前が変更されます。 274 | 275 | ![rename-objective](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/rename-objective.gif) 276 | 277 | さらに、ファイル定義を使用して名前空間付きID(例: advancements, functions, loot tables, predicates, recipes, Tagsの)の名前を変更すると、ワークスペース内の対応するファイルも名前変更/移動されます。 278 | 279 | ![rename-function](https://raw.githubusercontent.com/SPGoding/vscode-datapack-helper-plus/master/img/rename-function.gif) 280 | 281 | **ただし**、ワークスペース内のファイルの名前を手動で変更しても、ファイルの名前空間IDは更新されず、キャッシュに問題が発生する可能性があります。 282 | その場合は[キャッシュの再生成](#キャッシュの再生成)を実行してください。 283 | 284 | ## 構成設定 285 | 286 | `Ctrl + ,`(またはその他の構成済みのホットキー)を押してVSCodeの[設定]ページを開き、`datapack`と入力しDHPが提供するすべての構成設定を検索します。独自のコードスニペットを追加し、必要に応じて校閲の設定と環境情報を設定できます。これらの構成は、現在のユーザーまたはワークスペースに対して変更できます。設定の構成について詳しくは、[VSCodeの公式ドキュメント](https://code.visualstudio.com/docs/getstarted/settings)をご覧ください。 287 | 288 | ## キャッシュの再生成 289 | 290 | DHPはキャッシュを使用して、名前の変更、参照/定義の検索、ドキュメントリンクなどのプロセスを高速化します。しかし、さまざまな理由によりキャッシュが古くなり奇妙な動作を引き起こす可能性があります。その場合`Datapack: Regenerate Cache`コマンド(日本語名: `Datapack: キャッシュを再生成する`, ID: `datapack.regenerateCache`)を使用して、キャッシュを手動で再生成できます。 291 | 292 | - - - 293 | 翻訳: [ちぇん](https://twitter.com/CMD__Cat) 294 | 295 | 翻訳に気になる点がありましたら気軽に連絡ください。 296 | --------------------------------------------------------------------------------