Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use inside of a function / impl block doesn't highlight imported items #4581

Closed
q2p opened this issue May 23, 2020 · 1 comment
Closed

use inside of a function / impl block doesn't highlight imported items #4581

q2p opened this issue May 23, 2020 · 1 comment

Comments

@q2p
Copy link

q2p commented May 23, 2020

If you write use some::module::or::member; inside of an impl block, or a function block, VSCode won't highlight imported items, won't provide documentation on hover, and won't provide auto-complete suggestions.

Screenshot:
image

Example code:

pub enum FileExtensions {
	PNG,
	APNG,
	WEBP,
	WEBM,
	MP4,
	M4A,
	JPEG,
	WAVE,
	MP3,
	GIF,
	OGG,
	SWF,
	Torrent,
	MatroskaVideo,
}

impl TryFrom<&str> for FileExtensions {
	type Error = ();
	fn try_from(extension: &str) -> Result<FileExtensions, ()> {
		use FileExtensions::*;
		Ok(match extension {
			"png"     => PNG,
			"apng"    => APNG,
			"webp"    => WEBP,
			"webm"    => WEBM,
			"mp4"     => MP4,
			"m4a"     => M4A,
			"ogg"     => OGG,
			"swf"     => SWF,
			"torrent" => Torrent,
			"jpeg"    => JPEG,
			"jpg"     => JPEG,
			"gif"     => GIF,
			"wav"     => WAVE,
			"wave"    => WAVE,
			"mp3"     => MP3,
			"mkv"     => MatroskaVideo,
			_ => return Err(()),
		})
	}
}
@lnicola
Copy link
Member

lnicola commented May 23, 2020

Duplicate of #1165.

@lnicola lnicola closed this as completed May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants