Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7282 from mono/fix-802684
Browse files Browse the repository at this point in the history
Retrieve editor markup on the UI thread. Fixes F# tooltips.
  • Loading branch information
slluis committed Mar 4, 2019
2 parents 4d67738 + 617ce3d commit de1c2b7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,16 @@ module Highlight =
|> Async.AwaitTask
|> Async.RunSynchronously

let syntaxHighlight s =
Runtime.RunInMainThread(fun() -> editor.Text <- s) |> Async.AwaitTask |> Async.RunSynchronously
let getHighlightedMarkup s =
editor.Text <- s
let data = editor.GetContent<ITextEditorDataProvider>().GetTextEditorData()
data.GetMarkup(0, s.Length, false, true, false, true)

let syntaxHighlight s =
Runtime.RunInMainThread (fun () -> getHighlightedMarkup s)
|> Async.AwaitTask
|> Async.RunSynchronously

let asUnderline = sprintf "_STARTUNDERLINE_%s_ENDUNDERLINE_" // we replace with real markup after highlighting

module SymbolTooltips =
Expand Down

0 comments on commit de1c2b7

Please sign in to comment.