xndcn / symbols-tree-view

A symbols view like taglist for Atom.io
MIT License
116 stars 48 forks source link

Haxe Support #12

Open ashes999 opened 9 years ago

ashes999 commented 9 years ago

Hi,

Please consider adding support for Haxe, which is similar to ActionScript (or a bit like Javascript).

xndcn commented 9 years ago

@ashes999 Thank you, now symbols are generated by ctags. Besides, there is a file lib/.ctags to support other languages. These files also exists in official repo https://github.com/atom/symbols-view/ . And I found the ctags description in http://old.haxe.org/com/ide , so I will fix it soon. However, the relationship among symbols will lost :-(

xndcn commented 9 years ago

Add Haxe Support in 1d306eec65e2fbe1077a66b4b631619cc310fa0f

xndcn commented 9 years ago

@ashes999 Please update to new version and check it again, thanks! But the relationship among symbols will lost :-(

ashes999 commented 9 years ago

@xndcn Thanks for doing this so quickly. It's great. I'm not sure what relationship among symbols you mean, though.

I also found a bug. In Haxe, "trace" traces something to the command-line. In the code below, the first trace (incorrectly) shows up in the tree view, while the second one doesn't:

private function hi() : Void {
  // Appears in symbol view
  trace(":");
  // Doesn't appear in symbol view
  trace("It's the colon that makes it appear");
}

I tried to get you a minimal code sample with this bug. It's the ":" in the trace that seems to trigger it.

Thanks again, I will start using this. Right. Now.

nicolashainaux commented 7 years ago

@ashes999 Hello, do you still use symbols-tree-view and haxe? I am trying to correct this issue in my forked package. So far, I notice that trace, as well as break and continue keywords are detected as "typedef". Don't know if it is correct (I do not know haxe), but it provides a workaround (using option autohide types or unselecting them with contextual menu).

If it's just definitely wrong to detect such keywords (what I can expect, because even if I don't know haxe, it looks strange to display such keywords in the tree view), it's possible to remove this detection.

Also, I have found a mean to fold variables and functions inside their classes, like this: haxe (example taken from a random file of an open source project)

ashes999 commented 7 years ago

@nicolashainaux I rarely use Atom for Haxe (I usually use VS Code, unless I'm on a machine where I can't install stuff).

I'm not an expert on Haxe either. I think trace, break, and continue shouldn't show up in the tree view, because they're just keywords (trace is like console.log in JS, break/continue are for aborting or skipping iteration in for-loops.)

Thanks for following up on this. I don't know if you want to pursue this (I may be the only person ever who tried symbols-tree-view with Haxe, and I don't want you to spend time supporting something that nobody will use.)

nicolashainaux commented 7 years ago

Well this can be setup really quickly, even if it's just a minimal support. Thanks for your feedback!