equal
deleted
inserted
replaced
57 |
57 |
58 def diagnostics_output(results: List[Text.Info[Command.Results]]): List[Protocol.Diagnostic] = |
58 def diagnostics_output(results: List[Text.Info[Command.Results]]): List[Protocol.Diagnostic] = |
59 { |
59 { |
60 (for { |
60 (for { |
61 Text.Info(text_range, res) <- results.iterator |
61 Text.Info(text_range, res) <- results.iterator |
62 range = model.doc.range(text_range, model.text_length) |
62 range = model.doc.range(text_range) |
63 (_, XML.Elem(Markup(name, _), body)) <- res.iterator |
63 (_, XML.Elem(Markup(name, _), body)) <- res.iterator |
64 } yield { |
64 } yield { |
65 val message = Pretty.string_of(body, margin = diagnostics_margin) |
65 val message = Pretty.string_of(body, margin = diagnostics_margin) |
66 val severity = VSCode_Rendering.message_severity.get(name) |
66 val severity = VSCode_Rendering.message_severity.get(name) |
67 Protocol.Diagnostic(range, message, severity = severity) |
67 Protocol.Diagnostic(range, message, severity = severity) |
87 catch { case ERROR(_) => None } |
87 catch { case ERROR(_) => None } |
88 Line.Node_Range(File.platform_url(name), |
88 Line.Node_Range(File.platform_url(name), |
89 opt_text match { |
89 opt_text match { |
90 case Some(text) if range.start > 0 => |
90 case Some(text) if range.start > 0 => |
91 val chunk = Symbol.Text_Chunk(text) |
91 val chunk = Symbol.Text_Chunk(text) |
92 val doc = Line.Document(text) |
92 val doc = Line.Document(text, model.doc.text_length) |
93 def position(offset: Symbol.Offset) = |
93 doc.range(chunk.decode(range)) |
94 doc.position(chunk.decode(offset), model.text_length) |
|
95 Line.Range(position(range.start), position(range.stop)) |
|
96 case _ => |
94 case _ => |
97 Line.Range(Line.Position((line1 - 1) max 0)) |
95 Line.Range(Line.Position((line1 - 1) max 0)) |
98 }) |
96 }) |
99 } |
97 } |
100 } |
98 } |