Skip to content

Commit 1a8cfe9

Browse files
committed
Merge branch 'development' of https://github.com/fdorg/flashdevelop into development
2 parents e0bc7df + cbc8fc7 commit 1a8cfe9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

External/Plugins/ASCompletion/Context/ASContext.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ static public void RebuildClasspath()
513513
/// </summary>
514514
public virtual void ReleaseClasspath()
515515
{
516+
PathExplorer.BeginUpdate();
517+
516518
if (started && classPath != null)
517519
{
518520
foreach (PathModel aPath in classPath) aPath.InUse = false;
@@ -529,6 +531,8 @@ public virtual void FinalizeClasspath()
529531
foreach (PathModel aPath in classPath) aPath.InUse = true;
530532
}
531533
PathModel.Compact();
534+
535+
PathExplorer.EndUpdate();
532536
}
533537

534538
/// <summary>

External/Plugins/ASCompletion/Model/PathExplorer.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static public bool IsWorking
2626
}
2727

2828
static private bool uistarted;
29+
static private bool contextUpdating;
2930
static private Queue<PathExplorer> waiting = new Queue<PathExplorer>();
3031
static private volatile Thread explorerThread;
3132
static private volatile bool stopExploration;
@@ -69,6 +70,16 @@ static public void ClearAll()
6970
lock (waiting) { waiting.Clear(); }
7071
}
7172

73+
static public void BeginUpdate()
74+
{
75+
contextUpdating = true;
76+
}
77+
78+
static public void EndUpdate()
79+
{
80+
contextUpdating = false;
81+
}
82+
7283
static public void ClearPersistentCache()
7384
{
7485
string cacheDir = GetCachePath();
@@ -145,6 +156,12 @@ private static void ExploreInBackground()
145156
{
146157
PathExplorer next = null;
147158

159+
if (contextUpdating)
160+
{
161+
Thread.Sleep(100);
162+
continue;
163+
}
164+
148165
lock (waiting)
149166
{
150167
if (waiting.Count > 0) next = waiting.Dequeue();

0 commit comments

Comments
 (0)