Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–91 unchanged (91 lines)
92 int charno = error.getCharno();
93
94 // padding equal to the excerpt and arrow at the end
95 // charno == sourceExpert.length() means something is missing
96 // at the end of the line
97 if (excerpt.equals(LINE)
98 && 0 <= charno && charno < sourceExcerpt.length()) {
99 for (int i = 0; i < charno; i++) {
100 char c = sourceExcerpt.charAt(i);
101 if (Character.isWhitespace(c)) {
102 b.append(c);
103 } else {
104 b.append(' ');
…lines 105–178 unchanged (74 lines)

After

…lines 1–91 unchanged (91 lines)
92 int charno = error.getCharno();
93
94 // padding equal to the excerpt and arrow at the end
95 // charno == sourceExpert.length() means something is missing
96 // at the end of the line
97 if (excerpt.equals(LINE)
98 && 0 <= charno && charno <= sourceExcerpt.length()) {
99 for (int i = 0; i < charno; i++) {
100 char c = sourceExcerpt.charAt(i);
101 if (Character.isWhitespace(c)) {
102 b.append(c);
103 } else {
104 b.append(' ');
…lines 105–178 unchanged (74 lines)

Before

program
block_comment "/*\n * Copyright 2007 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
; ";"
import_declaration (+23 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CheckLevel"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "SourceExcerptProvider"
. "."
identifier "ExcerptFormatter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "SourceExcerptProvider"
. "."
identifier "SourceExcerpt"
; ";"
block_comment "/**\n * Lightweight message formatter. The format of messages"...
class_declaration
modifiers
public "public"
class "class"
identifier "LightweightMessageFormatter"
superclass
extends "extends"
type_identifier "AbstractMessageFormatter"
class_body
{ "{"
field_declaration
modifiers
private "private"
type_identifier "SourceExcerpt"
variable_declarator
identifier "excerpt"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "ExcerptFormatter"
variable_declarator
identifier "excerptFormatter"
= "="
object_creation_expression
new "new"
type_identifier "LineNumberingFormatter"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * A constructor for when the client doesn't care abou"...
constructor_declaration (+26 nodes collapsed)
constructor_declaration (+22 nodes collapsed)
constructor_declaration (+43 nodes collapsed)
method_declaration
modifiers
static "static"
type_identifier "LightweightMessageFormatter"
identifier "withoutSource"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "LightweightMessageFormatter"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration (+25 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration
modifiers
private "private"
type_identifier "String"
identifier "format"
formal_parameters
( "("
formal_parameter
type_identifier "JSError"
identifier "error"
, ","
formal_parameter
boolean_type "boolean"
identifier "warning"
) ")"
block
{ "{"
line_comment "// extract source excerpt"
local_variable_declaration
type_identifier "SourceExcerptProvider"
variable_declarator
identifier "source"
= "="
method_invocation
identifier "getSource"
argument_list
( "("
) ")"
; ";"
local_variable_declaration (+34 nodes collapsed)
line_comment "// formatting the message"
local_variable_declaration
type_identifier "StringBuilder"
variable_declarator
identifier "b"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
if_statement (+79 nodes collapsed)
expression_statement (+26 nodes collapsed)
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
string_literal
" "\""
string_fragment " - "
" "\""
) ")"
; ";"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
field_access
identifier "error"
. "."
identifier "description"
) ")"
; ";"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
character_literal "'\\n'"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "sourceExcerpt"
!= "!="
null_literal "null"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
identifier "sourceExcerpt"
) ")"
; ";"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
character_literal "'\\n'"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "charno"
= "="
method_invocation
identifier "error"
. "."
identifier "getCharno"
argument_list
( "("
) ")"
; ";"
line_comment "// padding equal to the excerpt and arrow at the end"
line_comment "// charno == sourceExpert.length() means something is missin"...
line_comment "// at the end of the line"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
method_invocation
identifier "excerpt"
. "."
identifier "equals"
argument_list
( "("
identifier "LINE"
) ")"
&& "&&"
binary_expression
decimal_integer_literal "0"
<= "<="
identifier "charno"
&& "&&"
binary_expression
identifier "charno"
< "<"
method_invocation
identifier "sourceExcerpt"
. "."
identifier "length"
argument_list
( "("
) ")"
) ")"
block (+95 nodes collapsed)
} "}"
return_statement
return "return"
method_invocation
identifier "b"
. "."
identifier "toString"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Formats a region by appending line numbers in front"...
class_declaration (+469 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2007 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
; ";"
import_declaration (+23 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CheckLevel"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "SourceExcerptProvider"
. "."
identifier "ExcerptFormatter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "SourceExcerptProvider"
. "."
identifier "SourceExcerpt"
; ";"
block_comment "/**\n * Lightweight message formatter. The format of messages"...
class_declaration
modifiers
public "public"
class "class"
identifier "LightweightMessageFormatter"
superclass
extends "extends"
type_identifier "AbstractMessageFormatter"
class_body
{ "{"
field_declaration
modifiers
private "private"
type_identifier "SourceExcerpt"
variable_declarator
identifier "excerpt"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "ExcerptFormatter"
variable_declarator
identifier "excerptFormatter"
= "="
object_creation_expression
new "new"
type_identifier "LineNumberingFormatter"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * A constructor for when the client doesn't care abou"...
constructor_declaration (+26 nodes collapsed)
constructor_declaration (+22 nodes collapsed)
constructor_declaration (+43 nodes collapsed)
method_declaration
modifiers
static "static"
type_identifier "LightweightMessageFormatter"
identifier "withoutSource"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "LightweightMessageFormatter"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration (+25 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration
modifiers
private "private"
type_identifier "String"
identifier "format"
formal_parameters
( "("
formal_parameter
type_identifier "JSError"
identifier "error"
, ","
formal_parameter
boolean_type "boolean"
identifier "warning"
) ")"
block
{ "{"
line_comment "// extract source excerpt"
local_variable_declaration
type_identifier "SourceExcerptProvider"
variable_declarator
identifier "source"
= "="
method_invocation
identifier "getSource"
argument_list
( "("
) ")"
; ";"
local_variable_declaration (+34 nodes collapsed)
line_comment "// formatting the message"
local_variable_declaration
type_identifier "StringBuilder"
variable_declarator
identifier "b"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
if_statement (+79 nodes collapsed)
expression_statement (+26 nodes collapsed)
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
string_literal
" "\""
string_fragment " - "
" "\""
) ")"
; ";"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
field_access
identifier "error"
. "."
identifier "description"
) ")"
; ";"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
character_literal "'\\n'"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "sourceExcerpt"
!= "!="
null_literal "null"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
identifier "sourceExcerpt"
) ")"
; ";"
expression_statement
method_invocation
identifier "b"
. "."
identifier "append"
argument_list
( "("
character_literal "'\\n'"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "charno"
= "="
method_invocation
identifier "error"
. "."
identifier "getCharno"
argument_list
( "("
) ")"
; ";"
line_comment "// padding equal to the excerpt and arrow at the end"
line_comment "// charno == sourceExpert.length() means something is missin"...
line_comment "// at the end of the line"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
method_invocation
identifier "excerpt"
. "."
identifier "equals"
argument_list
( "("
identifier "LINE"
) ")"
&& "&&"
binary_expression
decimal_integer_literal "0"
<= "<="
identifier "charno"
&& "&&"
binary_expression
identifier "charno"
<= "<="
method_invocation
identifier "sourceExcerpt"
. "."
identifier "length"
argument_list
( "("
) ")"
) ")"
block (+95 nodes collapsed)
} "}"
return_statement
return "return"
method_invocation
identifier "b"
. "."
identifier "toString"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Formats a region by appending line numbers in front"...
class_declaration (+469 nodes collapsed)
} "}"