close

1. 安裝 ctags    cscope

sudo apt-get update

sudo apt-get ctags cscope

 

ctags與cscope的區別: ctags是跳轉到標籤定義的地方,

但是如果查找函數在哪裡定義過或標籤在哪裡出現過那麼ctags就無能為力了,這時就需要功能強大的cscope了。

 

2.  VSCode Extension 安裝:  CTags Support    scope4code

Extension^% CTags Support - u-boot-rkproduct - Visual Studio Code_004.png

 

002.PNG

 

3. ctags

打開terminal後進入源碼目錄下,鍵入

ctags -R -f .tags

產生.tags檔案

 

4. cscope

打開VSCode,並開啟源碼目錄,按"F1"選擇Cscope: Build database

u-boot-rkproduct - Visual Studio Code_005.png

 

5. Hotkey

Ref: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf

ctags: <ctrl+t>            跳轉到標籤定義的地方

          <ctrl+shift+t>   列出歷史標籤

          <ctrl+alt+->      go back

          <ctrl+shift+->   go forward

 

cscope: 按F1後選擇相對應功能

或設定相應對熱鍵

File -> Preferences -> Keyboard Shortcuts 可以自定義hotkey

下列設定供參考

001.PNG

arrow
arrow
    文章標籤
    editor
    全站熱搜
    創作者介紹
    創作者 HAHAHAN 的頭像
    HAHAHAN

    HELEN-HAN的部落格

    HAHAHAN 發表在 痞客邦 留言(0) 人氣()