Closed Zercerium closed 7 months ago
Hi, I've just checked and I have the same issue. Interesting note is that it works under CLion. This appears to be a bug in rust analyzer.
Ok it seems that the generated timezones.rs
file ist just to big and rust-analyzer gives up.
If I reduce the entries in tzfiles
and don't generate the static WIN_TIMEZONES
everything works as expected. (Sometimes you have to restart rust-analyzer after the changes to pick up again)
if it's only a file size problem I could try to divide up the generator in multiple files.
I'm not sure what exactly triggers (file size, symbols in file, ...) the problem and couldn't find a similar issue with a first search.
a novice try with generating the file multiple times with different names and included these files under different mods, got some errors due to the different mods now, worked. (autocompletion and type inference)
the possibility to Limiting the Timezone Table to Zones of Interest like chrono_tz could also help, even if most of unused things should be stripped away at the build process? (probably another issue)
There is apparently a token limit but the error does not show up under macOS systems: https://github.com/rust-lang/rust-analyzer/issues/15335
fixed upstream in rust-analyzer thanks to https://github.com/rust-lang/rust-analyzer/pull/15819
Hi,
is it expected that there is no type inference happening? For example if I use
let berlin = timezones::db::europe::BERLIN;
it shows&{unknown}
and also everything behinddb::
is not recognised. I'm on Mac and tried the current and the pre-release version of rust-analyzer with rust 1.71. I didn't changed the rust-analyzer settings (rust-analyzer.cargo.buildScripts.enable
is true, like default). Builds works fine. Any Suggestion what I could try out?