javascript
Notepad++ JSON关键字自动提示
Notepad++關(guān)鍵字自動(dòng)提示
2017-08-31
目錄
1 插件安裝
2 往JSON中加關(guān)鍵字
3 智能提示
最近接口測(cè)試自動(dòng)化框架的的case是json格式,用例的json的格式是固定的,定義專門的關(guān)鍵字(比如Request、ResponseAnalyze、DBAnalzye、PreSet、PostSet、Dependence、Variables等)和一些方法(Ssn()、Tel()、CurrentDate(yyyy-MM-dd))。在這些關(guān)鍵字和方法較多的時(shí)候,就比較容易忘記。
目前用Notepad++寫case,它有插件JSON Viewer插件和自帶關(guān)鍵字自動(dòng)提示功能。
1 插件安裝
?返回
下載后,把NPPJSONViewer.dll放到notepad++安裝目錄plugins下
重啟后,顯示如下
圖1 驗(yàn)證Json Viewer安裝成功
2 往JSON中加關(guān)鍵字
?返回
JSON沒有關(guān)鍵字,如何加JSON關(guān)鍵字
在notepad++安裝目錄plugins\APIs下有關(guān)鍵字配置文件,隨便拷貝一個(gè),重命名為json.xml(名字一定要和語言一樣),然后根據(jù)需要加關(guān)鍵字(有些字符不能添加到關(guān)鍵字里,比如%,:,\等)
<?xml version="1.0" encoding="Windows-1252" ?> <NotepadPlus><AutoComplete language="json"><KeyWord name="AddDate(2017-6-2613-14-15,yyyy-MM-ddHH-mm-ss,7)" /> <KeyWord name="CurrentDate(yyyy-MM-dd)" /><KeyWord name="Email(9)" /><KeyWord name="LengthSequence(6)" /><KeyWord name="placeholder" /><KeyWord name="Ssn()" /><KeyWord name="Tel()" /><KeyWord name="TimeSequence()" /> <KeyWord name="Content-Type" /> <KeyWord name="application/json" /> <KeyWord name="acceptpattern" /><KeyWord name="args" /><KeyWord name="clazz" /><KeyWord name="compares" /><KeyWord name="contain" /><KeyWord name="dbCompare" /><KeyWord name="dbCondition" /><KeyWord name="dbConnectionName" /><KeyWord name="dependence" /><KeyWord name="dependenceCondition" /><KeyWord name="dependsOnGroups" /><KeyWord name="dependsOnMethods" /><KeyWord name="description" /><KeyWord name="equal" /><KeyWord name="expectvalue" /><KeyWord name="files" /><KeyWord name="form" /><KeyWord name="global" /><KeyWord name="groups" /><KeyWord name="headers" /><KeyWord name="json" /><KeyWord name="like" /><KeyWord name="method" /><KeyWord name="module" /><KeyWord name="path" /><KeyWord name="postSetting" /><KeyWord name="request" /><KeyWord name="responseCompare" /><KeyWord name="retryTimes" /><KeyWord name="settings" /><KeyWord name="sourcepath" /><KeyWord name="sourcetemplet" /><KeyWord name="sql" /><KeyWord name="statuscode" /><KeyWord name="targetpath" /><KeyWord name="targettemplet" /><KeyWord name="templet" /><KeyWord name="testcase" /><KeyWord name="timeInterval" /><KeyWord name="url" /><KeyWord name="variables" /></AutoComplete> </NotepadPlus> View Code點(diǎn)擊notepad++->菜單“設(shè)置”->首選項(xiàng)->自動(dòng)完成
?
圖2設(shè)置自動(dòng)完成
3 智能提示
?返回
選擇json語言:菜單“語言”->J->JSON
輸入字母,若開始部分與關(guān)鍵一致,會(huì)智能顯示匹配字符串,如下圖:
圖3 智能提示?
?
轉(zhuǎn)載于:https://www.cnblogs.com/Ming8006/p/7458763.html
總結(jié)
以上是生活随笔為你收集整理的Notepad++ JSON关键字自动提示的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转载】MyBatis报错Invalid
- 下一篇: 收集Java面试题知识点(Java基础部