PrestonKnopp / language-gdscript

gdscript language grammar package for atom.io
https://atom.io/packages/lang-gdscript
MIT License
32 stars 9 forks source link

Missing export variable #7

Closed JimmyJames707 closed 7 years ago

JimmyJames707 commented 7 years ago

Hi, I am new to Atom and just noticed this. I am not sure if you are the right one to ask, but in the 'Symbols Tree View' package, type_1 below is not visible, while type_2 is.

Does this mean Atom does not see the symbol, if the export variable is spread across more than one line?


export (int,   \
    "TYPE_A",    \
    "TYPE_B",  \
    "TYPE_C",   \
    "TYPE_D", \
    "TYPE_E")    \
var _type_1 = 0

export (int, "TYPE_A",  "TYPE_B", "TYPE_C", "TYPE_D", "TYPE_E") var _type2 = 0
PrestonKnopp commented 7 years ago

Hi, thanks for posting an issue! I'm definitely sure that would have something to do with lang-gdscript. I never accounted for export statements being separated onto multiple lines.

I'll look in to this when I get some free time this week.

JimmyJames707 commented 7 years ago

Thank you. :)

PrestonKnopp commented 7 years ago

Hey @JimmyJames707, sorry it's been so long. I checked out the package and I thought it used the grammar definition to get symbols, but, y'know, it uses ctags.

I use syskrank/vim-gdscript-ctags as well and I see you already posted an issue there. I'm going to close this issue as it's not related to lang-gdscript. However, it should be a simple change to gdscript's ctags regex as it is just because it doesn't identify non-exported variables.

PrestonKnopp commented 7 years ago

@JimmyJames707 Add this to your .ctags file for non-exported variables:

--regex-gdscript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*/\1/v,variable/i