Upgrade to Pro — share decks privately, control downloads, hide ads and more …

インデントの崩れる音がする

enkatsu
December 01, 2020

 インデントの崩れる音がする

第65回スタジオ・アルカナ社内勉強会
インデントの崩れる音を聴く試み

enkatsu

December 01, 2020
Tweet

More Decks by enkatsu

Other Decks in Programming

Transcript

  1. 原因 <div> <div> {{ $name }} </div> </div> 中の <div>

    を削除して、 ⌘ + Opt + l で整形 <div> {{ $name }} </div> bladeの構⽂は無視してHTMLのみ整形される
  2. プラグイン有効化ショートカットの設定 resources/META-INF/plugin.xml で設定できる <keyboard-shortcut keymap="$default" first-keystroke="shift meta F12"/> これで shift

    meta F12 を押すと、 com.intellij.openapi.actionSystem.AnActionEvent を継承したクラスの public void actionPerformed(AnActionEvent e) が実⾏される
  3. ファイルの変更時に処理を実⾏する public void actionPerformed(AnActionEvent e) で com.intellij.openapi.vfs.newvfs.BulkFileListener を 実装したクラスを設定する。 //

    this.createIndentPatrolListener() はBulkFileListener を実装したクラスを返すメソッド BulkFileListener listener = this.createIndentPatrolListener(project); this.connection = project.getMessageBus().connect(); this.connection.subscribe(VirtualFileManager.VFS_CHANGES, listener);
  4. class Main { public static void main(String[] args) { -

    System.out.println("Hello, World!!"); +System.out.println("Hello, World!!"); } } 差分を取って改⾏の後にスペースが削除されていることを検出する