Open artisdom opened 7 years ago
If I understand well, you'd like to have a new binary. Do you know where is it possible to fetch a new one (for linux)? In the meanwhile you can use the related symbols-tree-nav setting to use your new local binary, instead of the one shipped with the extension (also had trouble with it).
https://github.com/universal-ctags/ctags-win32 https://github.com/universal-ctags/homebrew-universal-ctags
looks like both win32 and osx has their dedicated repo to download or build the binary, not include linux.
After trying out a local build using the latest code of universal-ctags, there's still some parsing problem with C++. Now I have switched to the original "Exuberant Ctags", which works quite well for my case.
Thanks for the suggestion and this great package.
By the way, I've made this local change to get the behavior that whenever a tag is clicked in the tree view, the text editor always scroll the corresponding code to the center of the screen. Do you think it would be possible to make this a default behavior, or add a configurable options to enable it dynamically ?
$ git diff
diff --git a/lib/symbols-tree-nav.coffee b/lib/symbols-tree-nav.coffee
index 7835e40..9445737 100644
--- a/lib/symbols-tree-nav.coffee
+++ b/lib/symbols-tree-nav.coffee
@@ -26,8 +26,8 @@ module.exports =
{top, left, height, width} = editor.element.pixelRectForScreenRange(screenRange)
bottom = top + height
desiredScrollCenter = top + height / 2
- unless editor.element.getScrollTop() < desiredScrollCenter < editor.element.getScrollBottom()
- desiredScrollTop = desiredScrollCenter - editor.element.getHeight() / 2
+ # unless editor.element.getScrollTop() < desiredScrollCenter < editor.element.getScrollBottom()
+ desiredScrollTop = desiredScrollCenter - editor.element.getHeight() / 2
from = {top: editor.element.getScrollTop()}
to = {top: desiredScrollTop}
Yes, I will add an option in the next update (I do not have much time these days, but this should not be too long).
As to the binaries, thanks for the links. And well, updating the Windows one looks easy, but as there's no "official" binary for linux distributions nor OS X, I don't know what's the best to do. As to the linux one, I can compile one, but I do not want to provide a not compatible binary in a next release. As to the one for OS X, I even have no idea how I could compile it myself, at all.
That will be great, thanks.
And I'm with you about the binaries, it's not easy to make sure the locally-produced binary would work on all systems. As the ctags path can be configured, it's working quite well for me now.
Cheers.
Just as a note: before any update of the binaries, do not forget that some breaking changes have been introduced in universal-ctags (in short: support for a .ctags configuration file has been replaced by a support for a configuration directory), and this might make updates of the binaries quite more complicated (unless there's a way to create a "universal" binary for linux and anyway, it will become necessary to use a configuration directory instead of the .ctags file)... so this won't be for the next release. Hope this won't be necessary too soon.
The shipped ctags binary is built last year,
which does not support gcc "Attribute Syntax"
use this test file: test.cc
The tags file generated by the shipped binary:
The tags file generated by the newly built local binary: