View unanswered posts | View active topics



Reply to topic  [ 1 post ] 
/*,*/"" treated as end of file 
Author Message
Member

Joined: Thu May 14, 2015 6:02 pm
Posts: 45
Reply with quote
This is the exact same behavior as my earlier bug, but with a different trigger.

When trying to find all references, FlashDevelop omits all references in a file if this pattern of characters is found at any point before the reference.

Examples of the pattern:
Code:
/*any characters,   */"any characters"
/*any characters,   */'any characters'
/*,*/""


It seems like FlashDevelop uses the same type of search when organizing imports. So you can reproduce the bug by following these steps.
1. Enter this code into an AS3 document:
Code:
package
{
   import flash.events.Event;
   public class MyClass
   {
      /* , */" ";
      Event;
   }
}

2. Right click > Refactor > Organize Imports
3. Observe that the import statement has been removed because FlashDevelop didn't see the class reference.
Code:
package
{
   public class MyClass
   {
      /* , */" ";
      Event;
   }
}


However, if you put //" after the pattern, FlashDevelop can still find the Event reference.

Just like with the other bug, this must be happening because FlashDevelop thinks there's an opening quote with no closing quote, and so it interprets the rest of the file as part of a string. Since the text editor knows it's not a string because it's able to display everything with the right colors, surely this could be fixed by getting the reference searcher to use the same criteria to determine where a string begins and where it ends.

Unlike the other bug which seems like an obvious mistake, this time I'm not sure why the reference searcher is interpreting text this way. It's especially curious that there needs to be a comma in there.

You may be wondering how I came across this bug. Well I had an array literal full of strings and one of the elements was commented out in the middle of the line.

I'm using FlashDevelop 5.2.0.3 for .NET 3.5 with 64-bit Windows 10.


Wed Jun 14, 2017 11:06 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.