Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Issues #178 and #174 . "Symbol not found" due to 1) issue with escape char in tag 2) default ctags missing ES2015-style function definition #179

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
10 changes: 7 additions & 3 deletions lib/ctags-config
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@
--regex-perl=/^\=head2[ \t]+(.+)/-- \1/p,pod,Plain Old Documentation/
--regex-perl=/^\=head[3-5][ \t]+(.+)/---- \1/p,pod,Plain Old Documentation/

--regex-JavaScript=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]*\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-JavaScript=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*\([^)]*\)/\1/,function/
--JavaScript-kinds=-pf
--regex-JavaScript=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]*\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*function[ \t]+([A-Za-z0-9_$]+)[ \t]*\([^)]*\)/\2/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*static[ \t]+([A-Za-z0-9_$]+)[ \t]*=/\2/,variable/
--regex-JavaScript=/(,|^|\*\/|export|export default)[ \t]*class[ \t]+([A-Za-z0-9._$]+)[ \t]*/\2/,class/
--regex-JavaScript=/(,|^|\*\/)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*function[ \t]*\(/\2/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*(static[ \t]+)?(while|if|for|function|([A-Za-z_$][A-Za-z0-9_$]+))[ \t]*\([^)]*\)[ \t]*\{/\2\4/,function/
--regex-JavaScript=/([A-Za-z0-9_$]+)[ \t]*[=:][ \t]*\([^)]*\)[ \t]*=>/\1/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*(static[ \t]+)?(while|if|for|function|([A-Za-z_$][A-Za-z0-9_$]+))[ \t]*\([^)]*\)[ \t]*\{/\4/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*get[ \t]+([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*\([ \t]*\)[ \t]*\{/get \2/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*set[ \t]+([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*\([ \t]*([A-Za-z_$][A-Za-z0-9_$]+)?[ \t]*\)[ \t]*\{/set \2/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*async[ \t]+([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*\([ \t]*([A-Za-z_$].+)?[ \t]*\)[ \t]*\{/\2/,function/
Expand Down
4 changes: 2 additions & 2 deletions lib/symbols-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class SymbolsView extends SelectListView
@focusFilterEditor()

getTagLine: (tag) ->
# Remove leading /^ and trailing $/
pattern = tag.pattern?.replace(/(^^\/\^)|(\$\/$)/g, '').trim()
# Remove leading /^ , trailing $/ , and escape char (\)
pattern = tag.pattern?.replace(/(^^\/\^)|(\$\/$)|(\\)/g, '').trim()

return unless pattern
file = path.join(tag.directory, tag.file)
Expand Down