Skip to content

Fixes https://github.com/fdorg/flashdevelop/issues/444 - #510

Closed
default0 wants to merge 1 commit into
fdorg:developmentfrom
default0:development
Closed

default0 wants to merge 1 commit into
fdorg:developmentfrom
default0:development

Conversation

@default0

Copy link
Copy Markdown

Also discovered that the ASFileParser does not seem to play nice with stuff like

public function test(p_str:String = "let's use \"quotation marks\" in a string!"):void

But that thing looked far too monolithic and scary to attempt working that out...
Anyways, for the issue posted in the forum (http://www.flashdevelop.org/community/viewtopic.php?f=6&t=11969), this fix should be fine, and if the ASFileParser gets an update to deal with escaped quotation marks inside default parameters, this fix should still be fine since it takes escaping into account :)

@elsassph

elsassph commented Dec 2, 2014

Copy link
Copy Markdown
Member

Actually ASFileParser is parsing the declarations correctly (it only misses the escaped quotes in the string value).
The problem is in ASComplete when showing the method call tip: the highlight stops at the first coma, but that's only a visual artifact.

Our implementation of FindNearSymbolInFunctDefis quite bad (a badly reviewed code contribution) but your PR doesn't push it in the right direction.

@default0

default0 commented Dec 3, 2014

Copy link
Copy Markdown
Author

The escaped quotes were what I was referring to when I said it doesn't play nice with that :)
The code isn't nice from a conceptual level to begin with: There's an ASFileParser that does the parsing, why reimplement parsing in ASComplete where we should probably only consume parsed information? I just went with what was there to try and make a non-intrusive fix for that, instead of trying to mess with the underlying issue (for which I'd need a more complete overview of the codebase), naturally resulting in a poor fix for an embarassing bug :)

@elsassph

elsassph commented Dec 3, 2014

Copy link
Copy Markdown
Member

Let's say that it's complicated - this has grown organically, based on the initial choice that using a proper parser with AST and all was a complexity we couldn't afford (it really has considerable consequences). So ASFileParser only builds superficial models and ASComplete has to do some local parsing. That kind of crappy I admit.

Now the real problem here is the method's hint highlighting: it is applied on the text of the hint (which requires parsing) instead of the hint text+highlighting tags being constructed from the method's model that we have also at this point in the code.

@elsassph elsassph closed this Dec 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants