-
Notifications
You must be signed in to change notification settings - Fork 305
Neomake - workspaces are broken #259
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
Comments
The same problem happens eg. in VSCode BTW. |
As for Neomake, it should probably |
@blueyed I'd like to help, but I am so confused that I don't know how to answer any part of your question.
The problem is that with Rust workspaces the is "root workspace dir" and bunch of "root crate dirs". inside it. When I use When I start a workspace things work only if the current dir is the workspace root. Not sure if it's any help. |
All credit to @blueyed . This fixes rust-lang#260 The investigation is in the corresponding Neomake issue: neomake/neomake#2080 This is also related to: rust-lang#259
Does it also affect |
My naive understanding is that If it is of any help, there is a topic about how to detect workspace dir: rust-lang/cargo#4933 . I'm also happy to assist as a guinea pig. It looks like it's just a matter of calling
key in the JSON output. |
All credit to `@blueyed`. This fixes rust-lang#260 The investigation is in the corresponding Neomake issue: neomake/neomake#2080 This is also related to: rust-lang#259
All credit to `@blueyed`. This fixes rust-lang#260 The investigation is in the corresponding Neomake issue: neomake/neomake#2080 This is also related to: rust-lang#259
@dpc We could certainly change this to use the metadata, although that's an extra call etc (but looking for the |
Both crates and workspaces itself have a |
@dpc |
@blueyed I don't know the asnwer, but I expect |
Similarly to what other reformatters plugins do, we should use a combination of setline() and line deletion command to carefully replace the lines of the buffer(). There's issue #236 that seems to not regress in this fix - the problem with '1,$d _' is that it deleted the entire buffer. We should only delete for line numbers that beyond the newly applied buffer content. This has a side effect of handling #260 and #259, as expand('%') is not relied upon.
* rust: cargo: use cargo's metadata for workspace_root Ref: rust-lang/rust.vim#259 (comment) * Factor out neomake#utils#temp_cd
Yes, I also bumped in the past with the "Paths are workspace-relative rather crate-relative if a workspace exists regardless of where you run The parsing of I wonder how ALE is handling this, because it seems to be handling workspaces correctly, and it uses neither methods. |
Re ALE: see https://github.com/w0rp/ale/blob/e0fe97e0a8e929bef9bd4d677c066968be70e914/ale_linters/rust/cargo.vim#L13-L21 and https://github.com/w0rp/ale/blob/e0fe97e0a8e929bef9bd4d677c066968be70e914/ale_linters/rust/cargo.vim#L50-L60. They appear to also look for Cargo.toml. |
Yes, however this code does not take into account whether there's an additional upper Cargo.toml which sets a workspace. Looking more into this, I figured out why it works - ALE looks into the JSON output for each warning and error, where it find absolute paths, and it appears to be matching them with the absolute paths of open buffers. So under these conditions, relative paths and current directory settings don't matter. |
So there are absolute paths in there? However grepping for |
* rust: cargo: use cargo's metadata for workspace_root Ref: rust-lang/rust.vim#259 (comment) * Factor out neomake#utils#temp_cd
@dpc is this issue still relevant? Thanks |
I've been working on my workspace enabled project for a while now, and I forgot the issue still exists, so I guess everything was fixed. |
I'm opening this issue just to get some visibility of people that are both Rust user and VimL-versed.
neomake/neomake#1916
Let's say you have project
a
witha/b
subcrate.If you
cd a/b
andvim
, neomake stops working well, becauserustc
still displays error paths asb/src/lib.rs
(relative to workspace root) while neomake/Vim would like them to be relative to current dir, so justsrc/lib/rs
.All it takes to fix (I think) is fixing the path somewhere here: https://github.com/neomake/neomake/blob/master/autoload/neomake/makers/ft/rust.vim#L136 by stripping the prefix.
But it's currently beyond me, how to do it right, and I don't have time to dedicate to figure it out.
Please, someone take a look. :)
The text was updated successfully, but these errors were encountered: