lejsue / symbols-navigator

Symbols navigator for Atom.io
MIT License
13 stars 3 forks source link

symbols tab is empty #3

Closed joachim-n closed 6 years ago

joachim-n commented 7 years ago

I've installed this package, and it adds a Symbols tab alongside the project file listing, but the tab is completely empty.

lejsue commented 7 years ago

Hi joachim-n,

Thanks for using this package. Would you mind to provide more information? Such as the platform and language(C/Javascript/PHP or others) you are using, and if there any error message in the Console of Developer Tools?

joachim-n commented 7 years ago

I'm on OS X, and my files are in PHP.

There is message in the console which may be relevant:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.execute (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/services/php-proxy.coffee:48:40)
    at Object.methods (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/services/php-proxy.coffee:201:20)
    at Object.getMemberContext (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:688:27)
    at FunctionProvider.module.exports.FunctionProvider.extractAnnotationInfo (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/method-provider.coffee:17:27)
    at FunctionProvider.module.exports.AbstractProvider.placeAnnotation (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/abstract-provider.coffee:103:27)
    at FunctionProvider.<anonymous> (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/abstract-provider.coffee:92:18)
    at FunctionProvider.module.exports.AbstractProvider.registerAnnotations (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/abstract-provider.coffee:91:13)
    at /Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/abstract-provider.coffee:26:14
    at Workspace.observeTextEditors (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:725:15)
    at FunctionProvider.module.exports.AbstractProvider.init (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/abstract-provider.coffee:22:24)
    at AnnotationManager.module.exports.AnnotationManager.init (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/annotation/annotation-manager.coffee:17:22)
    at Object.activate (/Users/joachim/.atom/packages/atom-autocomplete-php/lib/peekmo-php-atom-autocomplete.coffee:83:28)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:253:25)
    at /Applications/Atom.app/Contents/Resources/app/src/package.js:225:38
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:99:21)
    at /Applications/Atom.app/Contents/Resources/app/src/package.js:218:32
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:215:40)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:645:40)
    at /Applications/Atom.app/Contents/Resources/app/src/package-manager.js:626:35
    at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/config.js:367:24)
    at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:621:25)
    at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:603:52)
    at /Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:843:36
25php-file-parser.coffee [sm]:699 Failed to get methods for Drush\Commands\CodeBuilder\CodeBuilderCommands : Unexpected end of JSON input
lejsue commented 7 years ago

Hi joachim,

From the message you provided, it seems that some problems in the atom-autocomplete-php package. Would you mind to disable package first and then see if it is ok for symbols-navigator package?

Or do you have more message about symbols-navigator package?

joachim-n commented 7 years ago

I've just tried installing the latest release, 1.1.0, and I've disabled atom-autocomplete-php.

The symbols tab is still completely blank.

There's nothing in the console.

lejsue commented 7 years ago

Hi Joachim, Thanks for your response. I have no idea about it, but could you help me to do the test:

  1. open your terminal and change to atom package location. (should be ~/.atom/package in default)
  2. change to symbols-navigator/vendor directory.
  3. create test.php <?php function test() {} ?>
  4. and run this command: ./universal-ctags-darwin -x --_xformat={line:%n,name:%N,kind:%K,scopeKind:%p,scope:%s,access:%a,signature:%S} test.php
  5. see if there is error? if there is no problem, you should see: {line:1,name:test,kind:function,scopeKind:,scope:,access:-,signature:()}

BTW, could you also let me know your OSX version?

Thanks!

joachim-n commented 7 years ago

Here's the output:

~/.atom/packages/symbols-navigator/vendor joachim$ more test.php
<?php function test() {} ?>
~/.atom/packages/symbols-navigator/vendor joachim$  ./universal-ctags-darwin -x --_xformat={line:%n,name:%N,kind:%K,scopeKind:%p,scope:%s,access:%a,signature:%S} test.php
Illegal instruction: 4
~/.atom/packages/symbols-navigator/vendor joachim$

My version of OS X is 10.11.6 (15G1510).

lejsue commented 6 years ago

Thanks for the response!

The universal-ctags-drawin binary file was built by my MacOS, and it is OSX 10.12.6 on VMware. I used homebrew to build it. I'm not sure if it is the root cause.

Therefore, I built the binary file by myself (use autotools, document is in universal-ctags repository, ctags/docs/autotools.rst) and committed it into 1.2.0 version.

Please let me know if it works correct. If there is still empty, could you help me do one more test? run this command: ./universal-ctags-drawin test.php (with no any options) If this binary file is worked, it will output simple symbols in a file with 'tags' filename. And the file will contain such as:

!_TAG_FILE_FROMAT 2 ......
!_TAG_FILE_SORTED 1 ......
!_TAG_OUTPUT_MODE ......
......
test XXX/test.php /^>?php function test() {} ?> $/;" f

Thanks a lot!

joachim-n commented 6 years ago

With the new version I get a tags file output, with this as the content:

joachim$ more tags
!_TAG_FILE_FORMAT       2       /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE       u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR    Universal Ctags Team    //
!_TAG_PROGRAM_NAME      Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL       https://ctags.io/       /official site/
!_TAG_PROGRAM_VERSION   0.0.0   //
test    test.php        /^<?php function test() {} ?>$/;"       f
lejsue commented 6 years ago

Sounds great! It means this new version binary file is workable on your macOX, Do you see any symbols for test.php in symbols tab? BTW, I forgot to ask you about your version of Atom. Could you help to check it? Thanks a lot!

joachim-n commented 6 years ago

I'm on 1.22.1

I've just re-enabled this add-on and it's working!

joachim-n commented 6 years ago

Thanks very much for sorting it out!!

lejsue commented 6 years ago

No problem, if you find some bugs, just let me know!