Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement decorations as an interval tree #36410

Merged
merged 65 commits into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
648e6f6
Implement a relative interval tree
alexdima Oct 12, 2017
bc76ef8
Implement interval searching
alexdima Oct 12, 2017
8e6968f
Eliminate RelativeInterval
alexdima Oct 12, 2017
a324329
Reorganize code
alexdima Oct 12, 2017
d902ab8
Simplify IModelDecorationsChangedEvent
alexdima Oct 12, 2017
6023aee
Reduce usages of IModelDecorationsChangedEvent.changedDecorations
alexdima Oct 12, 2017
a47159b
Eliminate IModelDecorationsChangedEvent.changedDecorations
alexdima Oct 12, 2017
479958b
IntervalTree.insert gets passed in the node to be inserted
alexdima Oct 13, 2017
80859dd
IntervalNode implements IModelDecoration
alexdima Oct 13, 2017
452e0ed
Reduce usage of `Interval`
alexdima Oct 13, 2017
6b374f3
Implement interval searching to be non recursive and not use a stack
alexdima Oct 13, 2017
fedf6fd
Add a flag that switches between decorations implementations
alexdima Oct 13, 2017
76c68ae
some cleanup in intervalTree.ts
alexdima Oct 13, 2017
c2da406
Document current decoration behaviour
alexdima Oct 16, 2017
10c5d96
Fix issue in IntervalTree.resolveNode
alexdima Oct 16, 2017
e7ae7d7
Fix issue in changeDecoration
alexdima Oct 16, 2017
bfedda7
Adjust tests for USE_NEW_DECORATIONS
alexdima Oct 16, 2017
167c2e7
Always emit a model decorations changed event when the model is being…
alexdima Oct 16, 2017
1a37562
Implement IntervalTree.acceptReplace
alexdima Oct 16, 2017
b179e24
Update interval tree when edits occur
alexdima Oct 16, 2017
d4408e2
Optimize deltaDecorations
alexdima Oct 16, 2017
3246501
Add fast path for vscode.TextEditor.setDecorations
alexdima Oct 16, 2017
5aff04b
Capture current side editing behaviour
alexdima Oct 17, 2017
400afdb
Reduce reliance on _addMarker for cursor tracking
alexdima Oct 17, 2017
a939531
Further reduce reliance on _addMarker for editing commands selection …
alexdima Oct 17, 2017
7b9e4ae
Flip the switch
alexdima Oct 17, 2017
40f61d0
Remove old decorations implementation
alexdima Oct 17, 2017
a0a5f18
Remove TextModelWithMarkers
alexdima Oct 17, 2017
d882dec
Delete LineMarker and associated code
alexdima Oct 17, 2017
bf8282b
Simplify TextModelWithDecorations
alexdima Oct 17, 2017
1262a98
Simplify usage of lineStarts in model
alexdima Oct 17, 2017
4616b4c
Small tweaks
alexdima Oct 17, 2017
6574365
Emit a decoration change event only when methods are called on the ch…
alexdima Oct 17, 2017
8b4d883
Add ModelDecorationOverviewRulerOptions._resolvedColor
alexdima Oct 18, 2017
fe2841c
Remove ClassName duplication
alexdima Oct 18, 2017
93393b3
Binary encode node color
alexdima Oct 18, 2017
cc3ccb2
Binary encode node.visited
alexdima Oct 18, 2017
bc2ff77
Binary encode node.isForValidation
alexdima Oct 18, 2017
1d8e120
Binary encode node.stickiness
alexdima Oct 18, 2017
509eecf
Update decorations when there is an EOL change
alexdima Oct 18, 2017
ba81d4a
Fix range caching logic in decorations
alexdima Oct 18, 2017
16294b4
Do not emit events when deltaDecorations is a no-op
alexdima Oct 19, 2017
568f810
Fix NPE in decorations changed listener
alexdima Oct 19, 2017
ea948fb
Avoid NPE in removeAllDecorationsWithOwnerId
alexdima Oct 19, 2017
4b53050
Fix typo
alexdima Oct 19, 2017
76f2d8f
Track if decoration is in the overview ruler in IntervalNode.metadata
alexdima Oct 19, 2017
0d1c1e6
Store decorations in two trees, one with all decorations that appear …
alexdima Oct 19, 2017
caa5593
Reimplement the decorations overview ruler
alexdima Oct 19, 2017
69952f2
Handle integer overflow around delta in the IntervalTree; also, make …
alexdima Oct 19, 2017
30e2d20
Move getAllOverviewRulerDecorations to IViewModelLinesCollection
alexdima Oct 20, 2017
b6d492b
Encode overview ruler decorations in a number array
alexdima Oct 20, 2017
69ab7b1
More aggressive merging of overview ruler decorations
alexdima Oct 20, 2017
34e74ba
Tweak the way find decorations are managed
alexdima Oct 20, 2017
c01d8c1
Approximate find matches in the overview ruler if there are a high nu…
alexdima Oct 20, 2017
9146ff3
Query model for decorations only for visible model lines in the viewp…
alexdima Oct 20, 2017
819c005
Simplify ViewModelDecoration
alexdima Oct 20, 2017
f2d47bc
Improve message
alexdima Oct 20, 2017
9073cc1
Bump find limit to 20k given all the perf work around decorations
alexdima Oct 20, 2017
93157c2
Avoid flickering by painting the overview ruler with colors in the sa…
alexdima Oct 20, 2017
b45c8b8
Renames
alexdima Oct 20, 2017
3c2db90
More overflow checks
alexdima Oct 20, 2017
a0982eb
Avoid needless checks
alexdima Oct 20, 2017
3212c45
Increase slow test timeout
alexdima Oct 20, 2017
057714e
SelectionHighlighter should not highlight the exact same matches as t…
alexdima Oct 20, 2017
5f85622
Merge remote-tracking branch 'origin/master' into alex/interval-tree
alexdima Oct 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/vs/editor/browser/viewParts/decorations/decorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ export class DecorationsOverlay extends DynamicViewOverlay {
let decorations: ViewModelDecoration[] = [], decorationsLen = 0;
for (let i = 0, len = _decorations.length; i < len; i++) {
let d = _decorations[i];
if (d.source.options.className) {
if (d.options.className) {
decorations[decorationsLen++] = d;
}
}

// Sort decorations for consistent render output
decorations = decorations.sort((a, b) => {
let aClassName = a.source.options.className;
let bClassName = b.source.options.className;
let aClassName = a.options.className;
let bClassName = b.options.className;

if (aClassName < bClassName) {
return -1;
Expand Down Expand Up @@ -120,13 +120,13 @@ export class DecorationsOverlay extends DynamicViewOverlay {
for (let i = 0, lenI = decorations.length; i < lenI; i++) {
let d = decorations[i];

if (!d.source.options.isWholeLine) {
if (!d.options.isWholeLine) {
continue;
}

let decorationOutput = (
'<div class="cdr '
+ d.source.options.className
+ d.options.className
+ '" style="left:0;width:100%;height:'
+ lineHeight
+ 'px;"></div>'
Expand All @@ -148,12 +148,12 @@ export class DecorationsOverlay extends DynamicViewOverlay {
for (let i = 0, lenI = decorations.length; i < lenI; i++) {
const d = decorations[i];

if (d.source.options.isWholeLine) {
if (d.options.isWholeLine) {
continue;
}

const className = d.source.options.className;
const showIfCollapsed = d.source.options.showIfCollapsed;
const className = d.options.className;
const showIfCollapsed = d.options.showIfCollapsed;

let range = d.range;
if (showIfCollapsed && range.endColumn === 1 && range.endLineNumber !== range.startLineNumber) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class GlyphMarginOverlay extends DedupOverlay {
let r: DecorationToRender[] = [], rLen = 0;
for (let i = 0, len = decorations.length; i < len; i++) {
let d = decorations[i];
let glyphMarginClassName = d.source.options.glyphMarginClassName;
let glyphMarginClassName = d.options.glyphMarginClassName;
if (glyphMarginClassName) {
r[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, glyphMarginClassName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class LinesDecorationsOverlay extends DedupOverlay {
let r: DecorationToRender[] = [], rLen = 0;
for (let i = 0, len = decorations.length; i < len; i++) {
let d = decorations[i];
let linesDecorationsClassName = d.source.options.linesDecorationsClassName;
let linesDecorationsClassName = d.options.linesDecorationsClassName;
if (linesDecorationsClassName) {
r[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, linesDecorationsClassName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class MarginViewLineDecorationsOverlay extends DedupOverlay {
let r: DecorationToRender[] = [], rLen = 0;
for (let i = 0, len = decorations.length; i < len; i++) {
let d = decorations[i];
let marginClassName = d.source.options.marginClassName;
let marginClassName = d.options.marginClassName;
if (marginClassName) {
r[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, marginClassName);
}
Expand Down
Loading