diff options
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 29 |
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'; | |||
2 | import { | 2 | import { |
3 | Range, | 3 | Range, |
4 | TextDocumentChangeEvent, | 4 | TextDocumentChangeEvent, |
5 | TextDocumentContentChangeEvent, | ||
6 | TextEditor | 5 | TextEditor |
7 | } from 'vscode'; | 6 | } from 'vscode'; |
8 | import { TextDocumentIdentifier } from 'vscode-languageclient'; | 7 | import { 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 |