<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>自動完成 &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/%E8%87%AA%E5%8B%95%E5%AE%8C%E6%88%90/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Wed, 06 Nov 2019 07:48:36 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>自動完成 &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Eclipse SSH 匯入遠端專案(RSE: Remote System Explorer)</title>
		<link>https://noter.tw/2615/eclipse-ssh-%e5%8c%af%e5%85%a5%e9%81%a0%e7%ab%af%e5%b0%88%e6%a1%88rse-remote-system-explorer/</link>
					<comments>https://noter.tw/2615/eclipse-ssh-%e5%8c%af%e5%85%a5%e9%81%a0%e7%ab%af%e5%b0%88%e6%a1%88rse-remote-system-explorer/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Wed, 02 Jan 2013 06:38:08 +0000</pubDate>
				<category><![CDATA[一般程式]]></category>
		<category><![CDATA[自動完成]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[click function]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Remote System Explorer]]></category>
		<category><![CDATA[RSE]]></category>
		<category><![CDATA[Target Management]]></category>
		<category><![CDATA[TM]]></category>
		<guid isPermaLink="false">http://wazai.net/?p=2615</guid>

					<description><![CDATA[<p>搭配【在 Eclipse 上開發 PHP 程式(以 Moodle、EGit、PDT 為例) @ 蛙齋】繼續把整個開發方式記錄下來。這篇文章記錄使用 Eclipse 搭配 Remote System E&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/2615/eclipse-ssh-%e5%8c%af%e5%85%a5%e9%81%a0%e7%ab%af%e5%b0%88%e6%a1%88rse-remote-system-explorer/" data-wpel-link="internal">Eclipse SSH 匯入遠端專案(RSE: Remote System Explorer)</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>搭配<strong><a href="http://wazai.net/2539/%E5%9C%A8eclipse%E4%B8%8A%E9%96%8B%E7%99%BCphp%E7%A8%8B%E5%BC%8F%E4%BB%A5moodle%E3%80%81egit%E3%80%81pdt%E7%82%BA%E4%BE%8B" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">【在 Eclipse 上開發 PHP 程式(以 Moodle、EGit、PDT 為例) @ 蛙齋】<span class="wpel-icon wpel-image wpel-icon-6"></span></a></strong>繼續把整個開發方式記錄下來。這篇文章記錄使用 Eclipse 搭配 <a href="http://www.eclipse.org/tm/" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">Remote System Explorer<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 這個插件，讓 Eclipse 可以直接透過 SSH 或其他方式直接操作遠端專案。<br />
<span id="more-2615"></span></p>
<h1 style="text-align: center;"><strong>【安裝 Remote System Explorer 插件】</strong></h1>
<p>開啟 Eclipse 後，找到上方選單列的&nbsp;Help -&gt; Install New Software&#8230; -&gt; Work with:&nbsp;<span style="color: #ff0000;"><strong>Juno &#8211; http://download.eclipse.org/releases/juno</strong></span> (這邊要把 juno 換成自己的版本名稱) -&gt; 搜尋 <strong><span style="color: #ff0000;">remote</span></strong> -&gt; 勾選下載以下兩個插件</p>
<pre>Remote System Explorer End-User Runtime
Remote System Explorer User Actions</pre>
<p><a title="001.png" href="http://lh5.ggpht.com/-TI0gJ5YNWlU/UOOz-r7fS8I/AAAAAAAAFPU/nL2OPUyfcAE/w640/001.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="001.png" src="//lh5.ggpht.com/-TI0gJ5YNWlU/UOOz-r7fS8I/AAAAAAAAFPU/nL2OPUyfcAE/001.png" alt="001.png"></a></p>
<h1 style="text-align: center;"><strong>【設定 Remote System Explorer 插件】</strong></h1>
<p>安裝完成會要求重新啟動 Eclipse，接著點選右上角的 <span style="color: #ff0000;"><strong>Open Perspective</strong></span> (有一個 + 的)，選擇 <strong><span style="color: #ff0000;">Remote System Explorer</span></strong> 之後就可以看到右上角多了一個<span style="color: #ff0000;"><strong> Remote System Exploer 的快速切換按鈕</strong></span>了。<br />
<a title="002.png" href="http://lh4.ggpht.com/-RLk2uv9yd1I/UOOz-jVqY9I/AAAAAAAAFPQ/A2IVX6I_gJg/w640/002.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="002.png" src="//lh4.ggpht.com/-RLk2uv9yd1I/UOOz-jVqY9I/AAAAAAAAFPQ/A2IVX6I_gJg/002.png" alt="002.png"></a><br />
切換到 Remote System Explorer perspective 後，看到左邊 Remote Systems 視窗中有一個 Define a connection to remote system 的按鈕。<br />
<a title="003.png" href="http://lh4.ggpht.com/-HbsagzdpACg/UOOz-vsaWUI/AAAAAAAAFPY/jmXvI4QTSq0/w640/003.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="003.png" src="//lh4.ggpht.com/-HbsagzdpACg/UOOz-vsaWUI/AAAAAAAAFPY/jmXvI4QTSq0/003.png" alt="003.png"></a><br />
選擇 SSH Only，如果要用其他的協定也可以在這邊使用自己要用的協定。<br />
<a title="004.png" href="http://lh5.ggpht.com/-KVacMniRIy0/UOOz_XvMjoI/AAAAAAAAFPc/FWXdIVY55R0/w640/004.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="004.png" src="//lh5.ggpht.com/-KVacMniRIy0/UOOz_XvMjoI/AAAAAAAAFPc/FWXdIVY55R0/004.png" alt="004.png"></a><br />
輸入遠端主機相關資訊，Parent profile 系統會自動產生，Host name 輸入遠端位址，填寫完畢後按下 Finish。<br />
<a title="005.png" href="http://lh6.ggpht.com/-1HAAaA6UIKg/UOOz_qbwEgI/AAAAAAAAFPg/Q00NMKtmi3A/w640/005.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="005.png" src="//lh6.ggpht.com/-1HAAaA6UIKg/UOOz_qbwEgI/AAAAAAAAFPg/Q00NMKtmi3A/005.png" alt="005.png"></a><br />
在 Remote Systems 可以看到剛剛新增的 remote_moodle 資訊，點進遠端資料夾後會提示登入資訊，登入成功後就可以瀏覽遠端資料夾了。<br />
<a title="006.png" href="http://lh5.ggpht.com/-wH14S4EMviQ/UOOz_8TeXfI/AAAAAAAAFPk/qiEqPh-JDdM/w640/006.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="006.png" src="//lh5.ggpht.com/-wH14S4EMviQ/UOOz_8TeXfI/AAAAAAAAFPk/qiEqPh-JDdM/006.png" alt="006.png"></a></p>
<h1 style="text-align: center;"><strong>【讓 Remote System Explorer 插件支援 PHP】</strong></h1>
<p>Remote System Explorer 剛安裝完成的時候，開啟 PHP 檔案時，自動完成的功能會有問題，從<a href="http://www.patrickjwaters.com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">參考資料2<span class="wpel-icon wpel-image wpel-icon-6"></span></a>中發現解法(裡面也包含了很多更詳細的設定)，需要做一些設定檔的修改才可以正常使用，首先設定讓所有的檔案都不隱藏(設定檔是隱藏檔)，Eclipse -&gt; Window -&gt; Preferences。<br />
<a title="007.png" href="http://lh4.ggpht.com/-YC9G1Q70CZw/UOO0APk8BiI/AAAAAAAAFPs/Cm3tgM4kUOk/w640/007.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="007.png" src="//lh4.ggpht.com/-YC9G1Q70CZw/UOO0APk8BiI/AAAAAAAAFPs/Cm3tgM4kUOk/007.png" alt="007.png"></a><br />
找到 Remote Systems -&gt; Files -&gt; 把 Show hidden files 打勾 -&gt; OK。<br />
<a title="008.png" href="http://lh6.ggpht.com/-f8sX6SqkUVQ/UOO0AVTZDNI/AAAAAAAAFPw/bLJ8s_hgDLc/w640/008.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="008.png" src="//lh6.ggpht.com/-f8sX6SqkUVQ/UOO0AVTZDNI/AAAAAAAAFPw/bLJ8s_hgDLc/008.png" alt="008.png"></a><br />
找到 Eclipse 的 workspace 路徑，以 XP 為例，Eclipse 預設在 「<strong>C:\Documents and Settings\<span style="color: #0000ff;">User</span>\workspace</strong>」(User 換成自己登入用的那個)，找到<span style="color: #ff0000;"><strong> workspace 下 RemoteSystemsTempFiles 資料夾</strong></span>，裡面有個 <span style="color: #ff0000;"><strong>.project</strong> </span>檔案。<br />
<a title="009.png" href="http://lh6.ggpht.com/-VpGUQr1e_4M/UOO0AuaQc0I/AAAAAAAAFP8/H8rCFBVhhPo/w640/009.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="009.png" src="//lh6.ggpht.com/-VpGUQr1e_4M/UOO0AuaQc0I/AAAAAAAAFP8/H8rCFBVhhPo/009.png" alt="009.png"></a><br />
開啟後加入以下兩行(<a href="http://www.patrickjwaters.com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">參考資料2<span class="wpel-icon wpel-image wpel-icon-6"></span></a>)</p>
<pre>&lt;nature&gt;org.eclipse.wst.jsdt.core.jsNature&lt;/nature&gt;
&lt;nature&gt;org.eclipse.php.core.PHPNature&lt;/nature&gt;</pre>
<p><a title="010.png" href="http://lh3.ggpht.com/-UV2ltbQL_o4/UOO0A2k0eZI/AAAAAAAAFQE/372KJ0woJ-M/w640/010.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="010.png" src="//lh3.ggpht.com/-UV2ltbQL_o4/UOO0A2k0eZI/AAAAAAAAFQE/372KJ0woJ-M/010.png" alt="010.png"></a><br />
存檔後重新啟動 Eclipse，開啟 PHP 檔案試試看，自動完成的功能可以使用囉！<br />
<a title="011.png" href="http://lh5.ggpht.com/-VfNgHP_St7E/UOO0BGyF_CI/AAAAAAAAFQI/lGTZSHam0Vc/w640/011.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="011.png" src="//lh5.ggpht.com/-VfNgHP_St7E/UOO0BGyF_CI/AAAAAAAAFQI/lGTZSHam0Vc/011.png" alt="011.png"></a><br />
&nbsp;<br />
<del>補充：小蛙發現這邊頂多做到自動完成，但其實有一個最最重要的功能並沒有辦法達到，就是 ctrl + click 點選 function 或變數名稱的時候沒辦法直接跳到該 function 或變數所在位置，後來在<a href="http://www.patrickjwaters.com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">參考資料2<span class="wpel-icon wpel-image wpel-icon-6"></span></a>中的問答中找到答案，難怪小蛙昨天試的時候還可以，今天再試就不行了，因為把昨天測試的 project 砍掉了 &gt;&lt;，做法就是 import 一份遠端的檔案到 PHP perspective 中，這樣在 Remote System Explorer 就可以直接有上述功能了！</del><br />
補充：要讓 RSE 可以直接透過 click + function 就跳到 function 所在的檔案，主要是該檔案必須要開啟過，也就是說如果有用到 get_username(); 這個 function，而這個 function 存在在 fun_lib.php 的話，那麼在開啟過 fun_lib.php 後，custom function 的自動完成以及 click to function 的功能就會自動跑出來囉！試了好久才發現這件事情，為什麼&#8221;開啟過&#8221;就會自動 link 呢？原因在於開啟之後，會在&nbsp;RemoteSystemsTempFiles 下面放置下載下來的檔案(開啟的時候 Eclipse 就做下載動作了)，最後一個有趣的事情來了，小蛙在編輯 moodle 頁面的時候，裡面有一大堆一大堆看都沒看過的 function，自然也就不知道要去開啟哪些檔案來讓 Eclipse link，後來找到一個方法，在 Remote System Explorer &nbsp;perspective 下，在要編輯的資料夾上點選滑鼠右鍵 -&gt; Synchronize Cache，這樣就可以把該資料夾下的所有檔案先抓一份回來，剩下的就不說囉(這邊如果檔案數量很大的話，可以透過&nbsp;Monitor (或 Show in Table 都可以)，在要抓回來的資料夾上點選滑鼠右鍵 -&gt; Synchronize Cache 也可以喔！</p>
<h1 style="text-align: center;"><strong>【Remote System Explorer 將遠端專案匯入成本機專案(補充)】</strong></h1>
<p>Remote System Explorer 也可以直接匯入遠端 Project 到本機中，但是這樣在本機修改之後就<strong>要自己想辦法&#8221;放&#8221;回遠端</strong>，之前已經做過一些設定，也一併記錄在這邊。<br />
先切換到 PHP perspective。</p>
<p style="text-align: center;"><a title="007.png" href="http://lh5.ggpht.com/-nA7UZ0mH8rs/UOPSto3X4oI/AAAAAAAAFRM/8tNQ8glBI7M/w640/007.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="alignnone" title="007.png" src="//lh5.ggpht.com/-nA7UZ0mH8rs/UOPSto3X4oI/AAAAAAAAFRM/8tNQ8glBI7M/007.png" alt="007.png"></a></p>
<p>新增一個 Project。<br />
<a title="008.png" href="http://lh4.ggpht.com/-Zmk3KbvG1B8/UOPStspeUvI/AAAAAAAAFRI/DmuG-AbnJ9c/w640/008.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="008.png" src="//lh4.ggpht.com/-Zmk3KbvG1B8/UOPStspeUvI/AAAAAAAAFRI/DmuG-AbnJ9c/008.png" alt="008.png"></a><br />
選擇 General -&gt; Project (一般專案)<br />
<a title="009.png" href="http://lh4.ggpht.com/-fHATYvE0xXg/UOPStt5OEPI/AAAAAAAAFRQ/CO17aDAXYnk/w640/009.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="009.png" src="//lh4.ggpht.com/-fHATYvE0xXg/UOPStt5OEPI/AAAAAAAAFRQ/CO17aDAXYnk/009.png" alt="009.png"></a><br />
輸入專案名稱後點選 Finish。<br />
<a title="010.png" href="http://lh3.ggpht.com/-iRgZyA4cs_E/UOPSuMxbPMI/AAAAAAAAFRU/OPz0tInfDVg/w640/010.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="010.png" src="//lh3.ggpht.com/-iRgZyA4cs_E/UOPSuMxbPMI/AAAAAAAAFRU/OPz0tInfDVg/010.png" alt="010.png"></a><br />
切換到 Remote System Explorer perspective 在要匯入的專案上點選滑鼠右鍵，選擇<span style="color: #ff0000;"><strong> Import To Project</strong></span>。<br />
<a title="011.png" href="http://lh5.ggpht.com/-EBPoI2ghVys/UOPSuuSHK_I/AAAAAAAAFRY/mpm6bfErazw/w640/011.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="011.png" src="//lh5.ggpht.com/-EBPoI2ghVys/UOPSuuSHK_I/AAAAAAAAFRY/mpm6bfErazw/011.png" alt="011.png"></a><br />
這邊卡了非常非常久，因為小蛙要匯入的專案很大，到這個頁面的時候，一直出現 <span style="color: #ff0000;"><strong>Enter or select a source folder.</strong> </span>的錯誤，導致 Finish 無法成功按下，後來才發現右下角有一個 Querying All 的進度條在跑，大一點的專案甚至可能要等超過十分鐘，Into folder: 這邊選擇要匯入的專案中(這邊例子是剛剛建立的 test)。<br />
<a title="012.png" href="http://lh4.ggpht.com/-P4ekAqGPzXA/UOPSumFejuI/AAAAAAAAFRc/I1NTOriNTnc/w640/012.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="012.png" src="//lh4.ggpht.com/-P4ekAqGPzXA/UOPSumFejuI/AAAAAAAAFRc/I1NTOriNTnc/012.png" alt="012.png"></a><br />
完成後切回 PHP perspective，就可以看到剛剛匯入的專案在這邊了(因為要抓太久，小蛙拿之前抓好的圖來替代)，在專案上點選滑鼠右鍵 -&gt; Configure -&gt; Add PHP Support &#8230; 讓專案變成 PHP 專案，大功告成！<br />
<a title="013.png" href="http://lh3.ggpht.com/-wDJDShcxgJs/UOPSvMFjtjI/AAAAAAAAFRo/6oRnNLOauYo/w640/013.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="aligncenter" title="013.png" src="//lh3.ggpht.com/-wDJDShcxgJs/UOPSvMFjtjI/AAAAAAAAFRo/6oRnNLOauYo/013.png" alt="013.png"></a><br />
<strong>參考資料：</strong></p>
<ol>
<li>在 Eclipse 上開發 PHP 程式(以 Moodle、EGit、PDT 為例) @ 蛙齋<br />
<address><a href="http://wazai.net/2539/%E5%9C%A8eclipse%E4%B8%8A%E9%96%8B%E7%99%BCphp%E7%A8%8B%E5%BC%8F%E4%BB%A5moodle%E3%80%81egit%E3%80%81pdt%E7%82%BA%E4%BE%8B" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">http://wazai.net/2539/%E5%9C%A8eclipse%E4%B8%8A%E9%96%8B%E7%99%BCphp%E7%A8%8B%E5%BC%8F%E4%BB%A5moodle%E3%80%81egit%E3%80%81pdt%E7%82%BA%E4%BE%8B<span class="wpel-icon wpel-image wpel-icon-6"></span></a></address>
</li>
<li>How to setup Eclipse with PHP PDT, Remote System Explorer, Theme Manager, and Drupal Plugins @ Patrick J Waters<br />
<address><a href="http://www.patrickjwaters.com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">http://www.patrickjwaters.com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35<span class="wpel-icon wpel-image wpel-icon-6"></span></a></address>
</li>
<li>Code Completion not working with remote file (with RSE) @ stackoverflow<br />
<address><a href="http://stackoverflow.com/questions/5896909/code-completion-not-working-with-remote-file-with-rse" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">http://stackoverflow.com/questions/5896909/code-completion-not-working-with-remote-file-with-rse<span class="wpel-icon wpel-image wpel-icon-6"></span></a></address>
</li>
</ol>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/2615/eclipse-ssh-%e5%8c%af%e5%85%a5%e9%81%a0%e7%ab%af%e5%b0%88%e6%a1%88rse-remote-system-explorer/" data-wpel-link="internal">Eclipse SSH 匯入遠端專案(RSE: Remote System Explorer)</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/2615/eclipse-ssh-%e5%8c%af%e5%85%a5%e9%81%a0%e7%ab%af%e5%b0%88%e6%a1%88rse-remote-system-explorer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
