oschwald/SublimeLinter-contrib-rustc

Is the linter using the correct directory?

akatechis opened this issue · 2 comments

I've set up a simple rust crate in F:\workspace.
cargo new hello

And insert the following 2 files in the src directory of the new crate:

lib.rs

mod greet;

#[test]
pub fn it_greets_the_world_correctly () {
  assert_eq!("Hello, world!", greet::greet("world"));
}

greet.rs

pub fn greet (name: &str) -> String {
  format!("Hello, {}!", name)
}

When I press CTRL-`, I find the following logs, suggesting some issue with the directory set up for the linter?

c:\users\alexan~1\appdata\local\temp\SublimeLinter3-Alexandros\lib.rs:1:5: 1:10 error: file not found for module `greet`
c:\users\alexan~1\appdata\local\temp\SublimeLinter3-Alexandros\lib.rs:1 mod greet;
                                                                            ^~~~~
c:\users\alexan~1\appdata\local\temp\SublimeLinter3-Alexandros\lib.rs:1:5: 1:10 help: name the file either greet.rs or greet/mod.rs inside the directory "c:\\users\\alexan~1\\appdata\\local\\temp\\SublimeLinter3-Alexandros"

It seems to be looking for greet.rs in the temp directory, but not finding it.
If it helps, I've put the test repo at https://github.com/akatechis/hello-rust

What settings are you using?

This is what's in my SublimeLinter.sublime-settings file:

{
    "default": {
        "debug": true,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "mark_style": "outline",
        "no_column_highlights_line": true,
        "passive_warnings": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "python django": "python",
            "pythonimproved": "python",
            "magicpython": "python",
            "html 5": "html",
            "html (django)": "html",
            "html (rails)": "html",
            "javascript (babel)": "javascript",
            "php": "html"
        },
        "warning_color": "DDB700",
        "wrap_find": true,
        "linters": {
            "rustc": {
                "use-cargo": true,
                "use-cargo-check": true,
                "use-crate-root": true
            }
        }
    }
}

use-crate-root seems to be set to true.