Skip to content

Commit

Permalink
commented out, failed attempt at completion callback. See #23
Browse files Browse the repository at this point in the history
  • Loading branch information
gojimmypi committed May 3, 2020
1 parent 929efd0 commit 0e909a2
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Highlighting/HighlightWordTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,45 @@ public HighlightWordTagger(ITextView view,
this.View.LayoutChanged += ViewLayoutChanged;
}

#region Non-working callback attempt
// See https://github.com/gojimmypi/VerilogLanguageExtension/issues/23#issuecomment-623129817
// https://stackoverflow.com/questions/19048492/notify-when-thread-is-complete-without-locking-calling-thread

//private void Start()
//{
// System.Diagnostics.Debug.WriteLine("1. Call thread task");

// StartMyLongRunningTask();

// System.Diagnostics.Debug.WriteLine("2. Do something else");
//}

//private void StartMyLongRunningTask()
//{

// System.Threading.ThreadStart starter = myLongRunningTask;

// starter += () =>
// {
// myLongRunningTaskDone();
// };

// System.Threading.Thread _thread = new System.Threading.Thread(starter) { IsBackground = true };
// _thread.Start();
//}

//private void myLongRunningTaskDone()
//{
// System.Diagnostics.Debug.WriteLine("3. Task callback result");
//}

//private void myLongRunningTask()
//{
// string thisFile = VerilogLanguage.VerilogGlobals.GetDocumentPath(SourceBuffer.CurrentSnapshot);
// VerilogGlobals.Reparse(SourceBuffer, thisFile); // note that above, we are checking that the e.After is the same as the _buffer
//}
#endregion

// Step 4: The event handlers both call the UpdateAtCaretPosition method.
void ViewLayoutChanged(object sender, TextViewLayoutChangedEventArgs e)
{
Expand All @@ -69,7 +108,12 @@ void ViewLayoutChanged(object sender, TextViewLayoutChangedEventArgs e)
// VerilogGlobals.ParseStatus_NeedReparse_SetValue(thisFile, true);
ParseStatusController.NeedReparse_SetValue(thisFile, true);
//VerilogGlobals.NeedReparse = true;


VerilogGlobals.Reparse(SourceBuffer, thisFile);

// See #region Non-working callback attempt
//StartMyLongRunningTask();
}
}

Expand Down

0 comments on commit 0e909a2

Please sign in to comment.