mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +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
@ -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 New Issue
Block a user