Stream: t-compiler/wg-rls-2.0

Topic: issue with notify crate


Gerred Dillon (Jul 18 2019 at 11:33, on Zulip):

Hey all, has anyone noticed that completion with notify doesn't work at all? I think it's because the actual implementations are hidden behind target_os cfgs. is there any way to set what I want a certain cfg to be for the purposes of rust-analyzer?

Gerred Dillon (Jul 18 2019 at 11:34, on Zulip):

https://github.com/passcod/notify/blob/main/src/lib.rs#L184-L194

Gerred Dillon (Jul 18 2019 at 11:35, on Zulip):

ah looks like this is a similar issue: https://github.com/rust-analyzer/rust-analyzer/issues/1527

Gerred Dillon (Jul 18 2019 at 11:35, on Zulip):

and looks like this was already discussed here! so nm. :) https://github.com/rust-analyzer/rust-analyzer/issues/1073

Florian Diebold (Jul 18 2019 at 12:41, on Zulip):

we actually completely ignore cfgs currently, so the problem isn't that anything is hidden behind cfgs, but probably some other problem with whatever implementation actually gets chosen

Florian Diebold (Jul 18 2019 at 12:42, on Zulip):

1527 is actually just about the cargo-watch integration

Gerred Dillon (Jul 18 2019 at 12:42, on Zulip):

ah interesting.

Gerred Dillon (Jul 18 2019 at 12:43, on Zulip):

how would an implementation get chosen there then as far as rust-analyzer is concerned? is rust-analyzer considering _all_ of the mods/crates used for something like notify?

Florian Diebold (Jul 18 2019 at 12:45, on Zulip):

yes, basically it's currently considering all the mods, and what gets chosen for e.g. the RecommendedWatcher type is pretty much random, probably either the first or the last definition

Gerred Dillon (Jul 18 2019 at 12:46, on Zulip):

got it :+1:

Gerred Dillon (Jul 18 2019 at 12:46, on Zulip):

is there any feature there that's being considered or issue that I can track? want to make sure I'm keeping an eye on the right thing if this is being looked at more.

Florian Diebold (Jul 18 2019 at 12:47, on Zulip):

notify is using some traits, maybe something's not yet working there, although I don't immediately see anything that would explain it

Gerred Dillon (Jul 18 2019 at 12:47, on Zulip):

it's interesting it was trying to code complete to locally defined "new" fns that I had elsewhere in the project.

Gerred Dillon (Jul 18 2019 at 12:47, on Zulip):

or rather, when I would jump to definition.

Gerred Dillon (Jul 18 2019 at 12:47, on Zulip):

so it didn't associate Watcher::new, for example, with the trait's new function.

Florian Diebold (Jul 18 2019 at 12:47, on Zulip):

1073 could probably serve as tracking issue for that, though it might also be about cargo-watch

Florian Diebold (Jul 18 2019 at 12:48, on Zulip):

yeah, it falls back to searching by symbol if it can't resolve the name properly

Gerred Dillon (Jul 18 2019 at 12:48, on Zulip):

ahhhh that makes sense

Florian Diebold (Jul 18 2019 at 12:48, on Zulip):

which can be rather annoying for names like new ;)

Gerred Dillon (Jul 18 2019 at 12:49, on Zulip):

haha yeah

Gerred Dillon (Jul 18 2019 at 13:07, on Zulip):

test

Gerred Dillon (Jul 18 2019 at 13:07, on Zulip):

ok good making sure zulip connected my github login with my email. :D

Last update: Nov 12 2019 at 15:40UTC