gediminasz / ctags-companion

A Visual Studio Code symbols provider based on Ctags
https://marketplace.visualstudio.com/items?itemName=gediminaszlatkus.ctags-companion
MIT License
25 stars 7 forks source link

search result moves cursor to line 0 #30

Closed scarf005 closed 1 year ago

scarf005 commented 1 year ago

https://user-images.githubusercontent.com/54838975/231213258-f79914a1-db54-4464-a67f-7a9d3affcf0d.mp4

extension correctly finds the file but does not move the cursor to definition.

excerpt from .tags file:

folding_stock   data/json/items/gunmod/stock.json   /^ *"id": "folding_stock"/
grep -nE '^ *"id": "folding_stock"' data/json/items/gunmod/stock.json
24:    "id": "folding_stock",

grep correctly finds line of definition.

gediminasz commented 1 year ago

@scarf005 I see your tags file is missing the line number. Could you try running ctags with this option: --fields=+n?

scarf005 commented 1 year ago

i was using custom ctags generator and must've missed it. after rewriting generator to write line:{N} at the end in extended format, the extension works flawlessly.

food    data/json/item_category.json    /"id": "food"/;"    line:46

thanks for the help!