BowlerHatLLC / BowlerHatLLC/vscode-as3mxml
Conditional compilation causes incorrect auto-import placement
- Dominant language
- Java
- Stars
- 282
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
For example:
```as
import x.display.SmartLoader;
import x.events.EventPriority;
import x.geom.Area;
runtime::air
{
import x.codecs.bitmap.webp.WebP;
}
public class ...
```
If I write `var errorEvent:ErrorEvent` and select `ErrorEvent` from code completion. The code becomes:
```as
import x.display.SmartLoader;
import x.events.EventPriority;
import x.geom.Area;
runtime::air
{
import x.codecs.bitmap.webp.WebP;
import flash.events.ErrorEvent;
}
public class ...
```
This is not what I expected. The code should be:
```as
import x.display.SmartLoader;
import x.events.EventPriority;
import x.geom.Area;
runtime::air
{
import x.codecs.bitmap.webp.WebP;
}
import flash.events.ErrorEvent;
public class ...
```
Thanks!
Contributor guide
Research direction
No source file or test is named. Start at the ActionScript auto-import and code-completion implementation, reproduce the example with the runtime::air block, and verify that the generated import is placed outside conditional compilation while the existing imports remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100