aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2019-07-24 21:30:18 +0100
committerKirill Bulatov <[email protected]>2019-07-25 13:17:28 +0100
commitbd904247bad2d213c25c0649ebd5e7a31e97135a (patch)
tree304492a0cd2dc940d75a2d6fb15ec3e1f5d2b5c3 /editors
parent583f5c961239c806e9467da346967e75c87f6618 (diff)
Remove unnecessary hacks
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/commands/inlay_hints.ts29
1 files changed, 0 insertions, 29 deletions
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts
index 056d7c8e3..0ce3edcbf 100644
--- a/editors/code/src/commands/inlay_hints.ts
+++ b/editors/code/src/commands/inlay_hints.ts
@@ -2,7 +2,6 @@ import * as vscode from 'vscode';
2import { 2import {
3 Range, 3 Range,
4 TextDocumentChangeEvent, 4 TextDocumentChangeEvent,
5 TextDocumentContentChangeEvent,
6 TextEditor 5 TextEditor
7} from 'vscode'; 6} from 'vscode';
8import { TextDocumentIdentifier } from 'vscode-languageclient'; 7import { TextDocumentIdentifier } from 'vscode-languageclient';
@@ -66,40 +65,12 @@ export class HintsUpdater {
66 return; 65 return;
67 } 66 }
68 67
69 // If the dbg! macro is used in the lsp-server, an endless stream of events with `cause.contentChanges` with the dbg messages.
70 // Should not be a real situation, but better to filter such things out.
71 if (
72 cause !== undefined &&
73 cause.contentChanges.filter(changeEvent =>
74 this.isEventInFile(document.lineCount, changeEvent)
75 ).length === 0
76 ) {
77 return;
78 }
79 return await this.updateDecorationsFromServer( 68 return await this.updateDecorationsFromServer(
80 document.uri.toString(), 69 document.uri.toString(),
81 editor 70 editor
82 ); 71 );
83 } 72 }
84 73
85 private isEventInFile(
86 documentLineCount: number,
87 event: TextDocumentContentChangeEvent
88 ): boolean {
89 const eventText = event.text;
90 if (eventText.length === 0) {
91 return (
92 event.range.start.line <= documentLineCount ||
93 event.range.end.line <= documentLineCount
94 );
95 } else {
96 return (
97 event.range.start.line <= documentLineCount &&
98 event.range.end.line <= documentLineCount
99 );
100 }
101 }
102
103 private async updateDecorationsFromServer( 74 private async updateDecorationsFromServer(
104 documentUri: string, 75 documentUri: string,
105 editor: TextEditor 76 editor: TextEditor