LoginSignup
6
5

More than 5 years have passed since last update.

Atomのバージョンを1.17.0にするとremote-sync パッケージが使えなくなる問題

Last updated at Posted at 2017-05-18

Atomのremote-syncは、scpやsftpを使って、Atom上のプロジェクトとサーバー上のディレクトリをカジュアルに同期してくれる、何かと便利なプラグインです。使っている方も多いのではないでしょうか。

かれこれ1年くらい愛用しており、今日もこれを使って作業をしようとしたところ、
プロジェクトツリーで右クリックすれば出てくるはずの remote-sync用の選択項目( upload とかconfigure とか]が出てこない・・・。

Atom自体や、パッケージのアップデートを試みるもダメ。

色々と調べてみたところ・・・。

公式のバグ報告と修正方法

Github公式にIssueが上がっていました。

[Atom 1.17.0] Missing configuration option when right clicking project folder or specific file #388

どうやら、ATOMがアップデートでプロジェクトツリーのDOM構造が変わった事による影響のようです。

(引用)

[McNuggetSauce commented a day ago]
Okay so I digged into this a little bit. It's caused by the non-existing class name selector for the context menu.
Selector used is .tree-view.full-menu but the menu container only now has tool-panel and tree-view. Adding the full-menu back using the developer tool of Atom in <div class="tool-panel tree-view full-menu"
tabindex="-1" style="" brings back the context menu item (just to test). Of course, appropriate selectors must be applied to the context.cson file to fix the problem.

合わせて、解決法も掲載されていました。
まだ公式が対応していないとの事なので、 ~/.atom/packages/remote-sync/menus/context.cson を直接修正すると良いそうです。

[dtsdev commented 15 hours ago]
@McNuggetSauce solution works like a charm. To fix issue "permanently" before it comes in update, open context.cson (.atom/packages/remote-sync/menus) and change the following lines:

line 2: from 'atom-text-editor, .tree-view.full-menu .file':[ to 'atom-text-editor, .tool-panel.tree-view .file':[
line 13: from '.tree-view.full-menu .header.list-item':[ to '.tool-panel.tree-view .header.list-item':[
Restart Atom, done.

こちらを対応したところ、無事remote-syncが右クリックメニューから復活しました!

スクリーンショット 2017-05-18 15.19.22.png

修正内容

参考までに、修正後の context.cson を張っておきます。

'context-menu':
  'atom-text-editor, .tool-panel.tree-view .file':[
    label: 'Remote Sync',
    submenu:[
      {label: 'Upload File', command: 'remote-sync:upload-file'}
      {label: 'Download File', command: 'remote-sync:download-file'}
      {label: 'Diff File', command: 'remote-sync:diff-file'}
      {label: 'Delete File', command: 'remote-sync:delete-file'}
      {label: 'Monitor File (Upload on External Save)', command: 'remote-sync:monitor-file'}
    ]
  ]

  '.tool-panel.tree-view .header.list-item':[
    label: 'Remote Sync',
    submenu:[
      {label: 'Configure', command: 'remote-sync:configure'}
      {label: 'Upload Folder', command: 'remote-sync:upload-folder'}
      {label: 'Upload Folder Change', command: 'remote-sync:upload-git-change'}
      {label: 'Download Folder', command: 'remote-sync:download-folder'}
      {label: 'Diff Folder', command: 'remote-sync:diff-folder'}
      {label: 'Delete Folder', command: 'remote-sync:delete-folder'}
    ]
  ]

そのうち公式で修正パッチが出ると思いますが、それまではこの方法で対応してね、との事でした!

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5