mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Merge #3388
3388: Remove inlay hint in diff views r=matklad a=vbfox If the left side of a diff view that contain the old version of the file apply inlays they are misplaced and produce a weird display:  After the change:  The detection is done by blacklisting the url schemes used by git and subversion scm extensions, whitelisting `file` is also possible but neither is perfect as VSCode now support both pluggable scm extensions and pluggable remote filesystems. But I suspect that the list of scm extensions is more easily manageable. **Note**: I can rebase on #3378 if needed as it touches the same lines of code Co-authored-by: Julien Roncaglia <julien@roncaglia.fr>
This commit is contained in:
commit
b55d22e060
5 changed files with 25 additions and 15 deletions
|
@ -4,7 +4,7 @@ import * as ra from './rust-analyzer-api';
|
|||
import { ColorTheme, TextMateRuleSettings } from './color_theme';
|
||||
|
||||
import { Ctx } from './ctx';
|
||||
import { sendRequestWithRetry } from './util';
|
||||
import { sendRequestWithRetry, isRustDocument } from './util';
|
||||
|
||||
export function activateHighlighting(ctx: Ctx) {
|
||||
const highlighter = new Highlighter(ctx);
|
||||
|
@ -36,7 +36,7 @@ export function activateHighlighting(ctx: Ctx) {
|
|||
|
||||
vscode.window.onDidChangeActiveTextEditor(
|
||||
async (editor: vscode.TextEditor | undefined) => {
|
||||
if (!editor || editor.document.languageId !== 'rust') return;
|
||||
if (!editor || !isRustDocument(editor.document)) return;
|
||||
if (!ctx.config.highlightingOn) return;
|
||||
const client = ctx.client;
|
||||
if (!client) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue