- 論壇徽章:
- 0
|
Source Insight(以下簡(jiǎn)稱(chēng)SI)是非常強(qiáng)勁的代碼閱讀工具,安裝后也就才3M大小,但在閱讀別人的代碼的時(shí)候?qū)嵲谑翘奖懔耍绕湓诓檎翌?lèi),函數(shù)的相關(guān)定義的時(shí)候。
SI標(biāo)準(zhǔn)內(nèi)置的語(yǔ)言主要在c/c++/Java/C#等,但就是沒(méi)有PHP。這次有個(gè)比較大的PHP的項(xiàng)目代碼需要接手,用UE看了一段,里面的函數(shù)跳來(lái)跳去,實(shí)在是麻煩。后來(lái)g了以下,發(fā)現(xiàn)SI官方網(wǎng)站自己帶了PHP的語(yǔ)言定義文件,按照網(wǎng)站上的說(shuō)明,倒入,配置了以下。類(lèi),函數(shù)等關(guān)聯(lián)操作都已經(jīng)可以了,就是語(yǔ)法的高亮沒(méi)有;旧暇椭挥袔讉(gè)流程控制if,else高亮顯示,看起來(lái)累就一個(gè)字。
從SI的language中導(dǎo)出的PHP語(yǔ)言定義,發(fā)現(xiàn)只配置了很少的流程控制字為keyword,所以只有這些是高亮的。這下好辦了,從UltraEdit的wordfile.txt中把php的高亮配置導(dǎo)出,做了一些處理,分成內(nèi)置function,keyword,control,operator四類(lèi),寫(xiě)成一個(gè)新的文本,然后再倒入進(jìn)語(yǔ)言定義。
接著在顏色style中配置了對(duì)這四類(lèi)的顏色顯示,一切就OK了。
為了方便大家,我把自己做好的PHP語(yǔ)言定義文件和style文件上傳,方便大家使用。
使用方法:
==》》解壓縮,里面有兩個(gè)文件:PHP Script.CLF,PHP-Styles.CF3
==》》語(yǔ)言文件:PHP Script.CLF
按照這個(gè)頁(yè)面的提示:http://www.sourceinsight.com/public/index.html
Custom Language files for adding new language support to Source Insight.
To import a custom language file into Source Insight
1. Select Options > Preferences. Click the Languages tab.
2. Click the Import button. Select and load the custom language file (.CLF)
3. You should now see the new language in the list of languages.
4. Click the Document Types button to open the Document Options dialog box.
5. If you don't have a document type already created for the type of language file, you will need to create one now. If you already have a document type created, select it in the list and go to step 7.
6. Click the Add Type button to create a new document type. Give it a name that describes the type of file. For example, "Ant File". Click OK and then fill in the file filter text box with a wildcard. For example, "*.ant".
7. In the Parsing section of the Document Options dialog box, select the newly imported language in the language drop-down list. This is what associates your document type with the custom language.
8. Click the Close button to close Document Options. Then click OK to close the Preferences dialog box.
==》》style文件:PHP-Styles.CF3
菜單“options”-》“Style Properties”,在彈出窗口中,選擇“l(fā)oad”,選中style文件:PHP-Styles.CF3。確定后,你可以在左側(cè)的“Style Name”列表中看見(jiàn)增加了四個(gè)新的php-function,php-keyword,php-control,php-operator。在點(diǎn)擊“Done”確定后,就好了。
以上沒(méi)什么技術(shù)含量,就是體力活。用過(guò)SI,你會(huì)更喜歡它,沒(méi)有用過(guò),推薦你用。 |
-
-
si-php.zip
2006-03-31 11:42 上傳
點(diǎn)擊文件名下載附件
15.67 KB, 下載次數(shù): 8724
SI的PHP配置文件
|