anchor.diff:              | PreprocessorKeyword -> style.Preprocessor
               | _ -> style.PlainText
    
  -        let seg = ColoredSegment(line.Offset + token.LeftColumn, token.RightColumn - token.LeftColumn + 1, chunkStyle.Name)
  +        let seg = ColoredSegment(lineOffset + token.LeftColumn, token.RightColumn - token.LeftColumn + 1, chunkStyle.Name)
           //Uncomment to visualise tokens segments
           //LoggingService.LogInfo (sprintf """Segment: %s S:%i E:%i L:%i - "%s" """ seg.ColorStyleKey seg.Offset seg.EndOffset seg.Length (editor.GetTextBetween (seg.Offset, seg.EndOffset)) )
           seg
  
positive.code:         | None -> scheme.KeywordTypes
  
  module Tokens =
      let (|InactiveCode|_|) = function
          | token when token.ColorClass = FSharpTokenColorKind.InactiveCode -> Some token
          | _ -> None
  
      let (|InactiveCodeSection|_|) = function
         | InactiveCode x :: xs -> 
             let rec loop ts acc = 
                 match ts with 
                 | InactiveCode head :: rest ->
                     loop rest (head :: acc) 
                 | _ -> List.rev acc, ts
             Some (loop xs [x])
         | _ -> None
  
      let CollapseInactiveTokens tokens =
          let rec loop tokens =
              [   match tokens with
                  | InactiveCodeSection (inactiveSegs, rest) ->
                      //collapse inactivesegs
                      let startSeg = inactiveSegs |> List.head
                      let endSeg = inactiveSegs |> List.last
                      let combinedToken =
                          {startSeg with RightColumn = endSeg.RightColumn
                                         FullMatchedLength = endSeg.RightColumn - startSeg.LeftColumn}
                      yield combinedToken
                      yield! loop rest
                  | head::tail -> yield head
                                  yield! loop tail
                  | [] -> () ]
          loop tokens
  
  
  type FSharpSyntaxMode(editor, context) =
      inherit MonoDevelop.Ide.Editor.Highlighting.SemanticHighlighting(editor, context)
  
      let mutable segments = [||]
  
      let makeChunk symbolsInFile colourisations (line: IDocumentLine) (style: ColorScheme) (token: FSharpTokenInfo) =
          let lineNumber = line.LineNumber
          let symbol =
              if isSimpleToken token.ColorClass then None else
              match symbolsInFile with
  
negative.code:                     try Async.RunSynchronously (pd.GetAllUsesOfAllSymbolsInFile(), ServiceSettings.maximumTimeout)
                      with _ -> None 
                  let colourisations = pd.GetExtraColorizations ()
                  let lineDetails = editor.GetLines() |> Seq.map (fun line -> line.LineNumber, line.Offset, editor.GetLineText line)
                  let defines = CompilerArguments.getDefineSymbols context.Name (Some(context.Project))
                                      
                  let processedTokens =
                      let style = getColourScheme ()
                      let ttt = Tokens.getTokens lineDetails context.Name defines
                      ttt |> Array.map (fun (lineNumber, lineOffset, chunks) -> chunks |> List.map (makeChunk symbolsInFile colourisations lineNumber lineOffset style))
                  segments <- processedTokens
                  Gtk.Application.Invoke (fun _ _ -> x.NotifySemanticHighlightingUpdate())
              | None -> ()
  