helm-gtags uses (thing-at-point 'symbol) to get a symbol in some places.
However (thing-at-point 'symbol) does not work well with generic types, such as List<TypeA>.
It would be useful if the function which is used to find a symbol could be customized to support better support of generics or other types of syntax that are not handled by (thing-at-point 'symbol).
This pull request adds a helm-gtags-symbol-at-point-function to support this. This allows for example:
(defun ph-find-symbol-at-point ()
"Find symbol at point.
If the symbol matches a generic type in
C++/C#/Kotlin/Java (e.g. List<TypeA<TypeB>>), then the function
returns the word at point."
(let ((token (thing-at-point 'symbol 'no-text-props)))
(if (string-match "\\([^<>]+\\)<\\(.+\\)>" token)
(thing-at-point 'word 'no-text-props)
token)))
(setq helm-gtags-symbol-at-point-function 'ph-find-symbol-at-point)
helm-gtags uses
(thing-at-point 'symbol)
to get a symbol in some places.However
(thing-at-point 'symbol)
does not work well with generic types, such asList<TypeA>
.It would be useful if the function which is used to find a symbol could be customized to support better support of generics or other types of syntax that are not handled by
(thing-at-point 'symbol)
.This pull request adds a
helm-gtags-symbol-at-point-function
to support this. This allows for example: