mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Remove inlay in diff views
If the left side of a diff view that contain the old version of the file apply inlays they are misplaced. The detection is done by blacklisting the url schemes used by git and subversion scm extensions.
This commit is contained in:
parent
6db2da4993
commit
b95756d21b
1 changed files with 10 additions and 1 deletions
|
@ -4,6 +4,8 @@ import * as ra from './rust-analyzer-api';
|
|||
import { Ctx } from './ctx';
|
||||
import { log, sendRequestWithRetry } from './util';
|
||||
|
||||
const noInlayUriSchemes = ['git', 'svn'];
|
||||
|
||||
export function activateInlayHints(ctx: Ctx) {
|
||||
const hintsUpdater = new HintsUpdater(ctx);
|
||||
vscode.window.onDidChangeVisibleTextEditors(
|
||||
|
@ -90,7 +92,14 @@ class HintsUpdater {
|
|||
|
||||
private get allEditors(): vscode.TextEditor[] {
|
||||
return vscode.window.visibleTextEditors.filter(
|
||||
editor => editor.document.languageId === 'rust',
|
||||
editor => {
|
||||
if (editor.document.languageId !== 'rust') {
|
||||
return false;
|
||||
}
|
||||
const scheme = editor.document.uri.scheme;
|
||||
const hasBlacklistedScheme = noInlayUriSchemes.some(s => s === scheme);
|
||||
return !hasBlacklistedScheme;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue