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

Commit

Permalink
Retrieve editor markup on the UI thread. Fixes F# tooltips.
Browse files Browse the repository at this point in the history
Fixes VSTS #802684 (#7254)
  • Loading branch information
nosami authored and monojenkins committed Mar 1, 2019
1 parent 13e0e5b commit 70617f5
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 70617f5

Please sign in to comment.