clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
237 stars 86 forks source link

Commented out lines in the xml project file are treated as not being commented out. #107

Closed johnfn closed 9 years ago

johnfn commented 11 years ago

If I leave stuff like this in my project xml file:

    <!--<haxelib name="flixel-addons"/>-->
    <!--<haxelib name="some-other-library"/>-->
    <!--<haxelib name="herp-derp"/>-->

Sublime Haxe will include these libraries for autocompletion (and will complain if I haven't installed them). Now, that may not seem so bad, but it seems like under some circumstances, including the same library twice may break autocompletion. For example, an xml file that includes the following:

<haxelib name="openfl" />
<haxelib name="flixel"/>
<haxelib name="flixel-addons"/>
<!--<haxelib name="flixel-addons"/>-->
<!--<haxelib name="flixel-ui"/>-->
<!--<haxelib name="nape"/>-->

breaks autocompletion on flixel-addons. Drove me crazy until I figured out why!

clemos commented 11 years ago

Yeah, currently we parse NME/openFL build files using regexps, that's why it ignores comments... This part needs a quite significant refactoring to use proper XML parsing, or even better, NME/openFL's display command... Meanwhile, you can still delete these lines, or just change <haxelib> to some other element name...

johnfn commented 11 years ago

Yes, now that I know how to fix it it's very easy to avoid. I mostly bring it up because I could imagine it could stump a lot of noobs.

I see that switching out to an XML parser would be a lot of work. As a stopgap, how about just putting something to ensure that lines don't start with "<!--" when you're looking for libraries?

ghost commented 9 years ago

Should be fixed. Because autocompletion uses openfl's display command to parse project.xml.