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

Is the linter using the correct directory? #24

Open
akatechis opened this issue Jun 16, 2016 · 2 comments · May be fixed by #35
Open

Is the linter using the correct directory? #24

akatechis opened this issue Jun 16, 2016 · 2 comments · May be fixed by #35

Comments

@akatechis
Copy link

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

@oschwald
Copy link
Owner

What settings are you using?

@akatechis
Copy link
Author

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.

@FichteFoll FichteFoll linked a pull request Dec 2, 2018 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants