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 #7283 from mono/backport-pr-7282-to-release-7.8
Browse files Browse the repository at this point in the history
[release-7.8] Retrieve editor markup on the UI thread. Fixes F# tooltips.
  • Loading branch information
slluis committed Mar 4, 2019
2 parents 13e0e5b + 70617f5 commit 2c3605c
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 2c3605c

Please sign in to comment.