Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>CodeBoostNew to Visual Studio Code? Get it now.
CodeBoost

CodeBoost

Hijizou

|
43 installs
| (0) | Free
This extension simplifies the maintenance and usage of snippets.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

作成中のコードに、自作コードファイルを組み込む機能

A feature to incorporate custom code files into the code being developed.

  • VSCodeにスニペット機能はありますが、長いコードを登録するのには面倒。変換サイトを使っても、修正するたびに変換作業の必要があります。

  • 一方、カスタムコードを自分のフォルダに置いても、コピー&ペーストするのは少し面倒です。また、修正やコードの検証のたびに、検証用のコードを付け加えて、修正後に消す、という作業も発生します。

  • The VSCode snippet feature is cumbersome for registering long code. Even if you use a conversion site, you need to convert it every time you make corrections.

  • Even if you place your custom code in your own folder, it’s a bit troublesome to copy and paste. This also causes back-and-forth when making corrections or verifying the code.

これを解決するための拡張機能です。

This extension solves the problems.

機能 / Features

  • ヘッダ部やフッタ部、実際のコーディングで用いる際には削除したい部分を明示することで、動作テストのコードと転記するコードを使い分けられます。

  • コードの途中にローカルテスト用のコードを(特定の)コメントで挟んで記述しておくことで、実際のファイルでは検証コードを削除することなく使用できます。

  • By indicating the parts you want to delete when using them in actual coding, such as the header and footer sections, you can differentiate between the code for testing and the code to be transcribed.

  • By embedding local test code within specific comments in the middle of the code, you can use the actual file without removing the verification code.

Requirements

  • なし / Nothing

簡単な使い方 / Getting Start

準備 / Preperation

フォルダ / Folder

自分の使いたいスニペットファイルが入っているフォルダのパスを codeboost.folderPath に設定します

Set the path of the folder containing the snippet files you want to use to codeboost.folderPath.

言語ごとのコメント記法 / Language Profiles

codeboost.languages で、拡張子のグループと行コメント記号を設定できます。同じプロファイルに登録した拡張子は、スニペット候補として相互に表示されます。初期設定では Python の .py と C++ の .cpp, .cc, .cxx, .h, .hpp, .hh, .hxx が登録されています。

"codeboost.languages": {
  "python": {
    "extensions": [".py"],
    "comment": "#"
  },
  "cpp": {
    "extensions": [".cpp", ".cc", ".cxx", ".h", ".hpp", ".hh", ".hxx"],
    "comment": "//"
  }
}

comment には行コメント記号を指定します。マーカーはこの記号を使って自動生成されます(例: // -- main block -- //)。別の言語を追加する場合は、その言語のプロファイルを登録してください。どのプロファイルにも登録されていない拡張子では、従来の codeboost.mainMarker などのマーカー設定を使い、候補は作業中ファイルと同じ拡張子に限定されます。

スニペットファイル / Snippet Files

対象ファイルに対応するプロファイルの行コメント記号でマーカーを記述します。Python の既定プロファイルでは #、C++ の既定プロファイルでは // を使用します。

This is the default setting. Initially, it assumes Python files (commented out with #).

  • 引用時に削除したいヘッダ部のあと(残したい部分の前)に -- main block -- を囲んだマーカーを挿入します / Insert the generated main block marker after the header section you want to remove.
  • 引用時に削除したいフッタ部のまえ(残したい部分の後ろ)に -- test block -- を囲んだマーカーを挿入します / Insert the generated test block marker before the footer section you want to remove.

コードを呼び出す / Calling Code

  • コードの作成中に、カーソルが挿入したい場所にある状態で、右クリックメニューから 'Insert Snippet' を呼び出します / While creating code, with the cursor at the desired insertion point, call ‘Insert Snippet’ from the right-click menu.

  • 上部の入力窓から呼び出したいファイルを指定します / Specify the file you want to call from the input window at the top.

ヘッダ、フッタが削除された状態で、スニペットファイルの内容が貼り付けられます

The content of the snippet file will be pasted with the header and footer removed.

マーカーを挿入する / Insert Markers

  • コードの作成中に、カーソルが挿入したい場所にある状態で、右クリックメニューから 'Insert Markers' を呼び出します / While creating code, with the cursor at the desired insertion point, call ‘Insert Markers’ from the right-click menu.

拡張設定 / Extension Settings

5種類の削除方法と、6種類の削除マーカがあります。登録済み言語では、マーカー挿入コマンドも作業中ファイルの言語プロファイルに合わせた行コメント記号を使用します。 There are five types of deletion methods (with six deletion markers).

  • ヘッダ部(動作テスト用の変数定義など)の削除 Removing variable definitions used as prerequisites or in test code -設定キーとファイルの初期設定マーカーは次の通りです

    • キー key : codeboost.mainMarker
    • 初期マーカー marker: # -- main block -- #
    • メインブロックの始まり位置を示します which signifies the start of the main block of code.
    • つまり、このマーカーがある行から前が削除されます In other words, everything before this marker will be removed.
  • フッタ部(動作テスト用の実行命令など)の削除 Removing sections used for output or similar purposes in test code

    • キー key : codeboost.testMarker
    • 初期マーカー default marker : # -- test block -- #
    • メインブロックの終わり位置を示します which signifies the start of the output test block of code.
    • つまり、このマーカーのある行から後ろが削除されます In other words, everything after this marker will be removed.
  • テストで使用するコードの削除 Removing sections within the main code that are used for testing purposes

    • キー key : codeboost.fromMarker, codeboost.toMarker
    • 初期マーカー default marker : # -- tmp From -- #, # -- tmp To -- #
    • メインブロック中で、本来動作には不要なコードの場所を示します which signify that the code between these markers is used for test outputs or required by the test problem.
    • つまり、このマーカーの行の間が削除されます In other words, the code between these markers will be removed.
  • 行の削除 Removing entire lines of code

    • キー key : codeboost.lineMarker
    • 初期マーカー default marker : # ----
    • その行だけ消したい場合に使います The default marker is # ---- , which indicates that both the comment and the code should be excluded.
  • コメントの削除 Removing only comments while keeping the code intact

    • キー key : codeboost.commentMarker
    • 初期マーカー default marker : # ==
    • スニペット使用時に消したいコメント(作成時の覚書など)がある場合に使用します。同じ行にコードがある場合は、そのコードは削除されません。 which indicates that the comment should not be included in the final submission.

これらの設定は、設定にて変更して下さい。 These settings can be customized by writing codeboost.* in the settings.json file.

登録済み言語では、これらのマーカー設定ではなく、プロファイルの行コメント記号から生成したマーカーが使われます。これらの設定は未登録の拡張子で使われます。 For registered languages, markers are generated from the profile's line-comment syntax; these settings are used for unregistered extensions.

Known Issues

  • 行コメントのみ対応しています。ブロックコメントには対応していません。 / Only line comments are supported; block comments are not.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft