BowlerHatLLC / BowlerHatLLC/vscode-as3mxml

Conditional compilation causes incorrect auto-import placement

Open
#846 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.