Rust analyzer highlighting with nvim-lsp

Ouverte
#424 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
neovim, rust, vim

Piste de recherche

Start by reproducing the Rust Analyzer documentation highlighting in Neovim 0.5 with nvim-lsp and nvim-completion, using the reported after/ftplugin/rust.vim configuration. Compare which Rust documentation tokens receive Markdown highlights and which do not; the issue says attempts in before/ftplugin/markdown.vim and before/syntax/markdown.vim had no effect. Done means identifying and fixing the missing highlighting behavior.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

  • rust.vim version: Downloaded October,15th 2020

Steps to reproduce:

  • Running latest neovim 0.5
  • Using nvim-lsp and nvim-completion

Rust analyzer documentation gets treat as markdown and is mostly able to highlighted as markdown

image

However as you can see somethings are not able to highlighted with markdown highlights

I am using this in my after/ftplugin/rust.vim

function s:rustdoclsphilight()
	if &background ==# 'dark'
		let l:color = '#5d4d7a'
	else
		let l:color = '#e2e0ea'
	endif
	exec 'hi markdownItalic guibg='.l:color
	exec 'hi markdownAutomaticLink guibg='.l:color
	exec 'hi markdownBlockquote guibg='.l:color
	exec 'hi markdownBold guibg='.l:color
	exec 'hi markdownBoldDelimiter guibg='.l:color
	exec 'hi markdownBoldItalic guibg='.l:color
	exec 'hi markdownBoldItalicDelimiter guibg='.l:color
	exec 'hi markdownCode guibg='.l:color
	exec 'hi markdownCodeBlock guibg='.l:color
	exec 'hi markdownCodeDelimiter guibg='.l:color
	exec 'hi markdownError guibg='.l:color
	exec 'hi markdownEscape guibg='.l:color
	exec 'hi markdownFootnote guibg='.l:color
	exec 'hi markdownFootnoteDefinition guibg='.l:color
	exec 'hi markdownH1 guibg='.l:color
	exec 'hi markdownH2 guibg='.l:color
	exec 'hi markdownH3 guibg='.l:color
	exec 'hi markdownH4 guibg='.l:color
	exec 'hi markdownH5 guibg='.l:color
	exec 'hi markdownH6 guibg='.l:color
	exec 'hi markdownHeadingDelimiter guibg='.l:color
	exec 'hi markdownHeadingRule guibg='.l:color
	exec 'hi markdownId guibg='.l:color
	exec 'hi markdownIdDeclaration guibg='.l:color
	exec 'hi markdownIdDelimiter guibg='.l:color
	exec 'hi markdownItalic guibg='.l:color
	exec 'hi markdownItalicDelimiter guibg='.l:color
	exec 'hi markdownLineBreak guibg='.l:color
	exec 'hi markdownLineStart guibg='.l:color
	exec 'hi markdownLink guibg='.l:color
	exec 'hi markdownLinkDelimiter guibg='.l:color
	exec 'hi markdownLinkText guibg='.l:color
	exec 'hi markdownLinkTextDelimiter guibg='.l:color
	exec 'hi markdownListMarker guibg='.l:color
	exec 'hi markdownOrderedListMarker guibg='.l:color
	exec 'hi markdownRule guibg='.l:color
	exec 'hi markdownUrl guibg='.l:color
	exec 'hi markdownUrlDelimiter guibg='.l:color
	exec 'hi markdownUrlTitle guibg='.l:color
	exec 'hi markdownUrlTitleDelimiter guibg='.l:color
	exec 'hi markdownUrlValid guibg='.l:color
endfunction!

call <SID>rustdoclsphilight()

I have tried adding syn keyword blocks in before/ftplugin/markdown.vim and before/syntax/markdown.vim but it doesn't seem to change anything.

Langage dominant
Vim Script
Étoiles
4.2k
Forks
323
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de rust-lang/rust.vim

Toutes les issues de rust-lang/rust.vim

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.