vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

Suggestion: Add a "delay" option when linting with RLS

Open gabdube opened this issue 7 years ago • 3 comments

Version of VSCode: 1.13.0 Version of the extension: 0.3.14 OS: Windows 10

Description:

If I'm not mistaken, the RLS linting is called whenever a key is pressed in the editor. This brings two issues:

1: RLS returns when I'm still typing and it gives wrong results. 2: When I start typing, there is always 1 core that is used at 100%, and my cpu don't like it (very noticeable on my weak laptop / barely noticeable on my tower).

Allowing a delay in ms in the configuration would fix these issues. For example, if I set the delay to 1000 ms, source linting will only be called after I stopped typing for 1 sec.

Example:

"rust.rls": {
    "linting_delay": 1000,
}

gabdube avatar Jun 10 '17 15:06 gabdube

@nrc, @jonathanturner I suppose currently it is half a second: https://github.com/rust-lang-nursery/rls/blob/master/src/build.rs#L108 Could you help me with that I am not aware of RLS internals.

KalitaAlexey avatar Jun 20 '17 16:06 KalitaAlexey

I filed https://github.com/rust-lang-nursery/rls/issues/364 for this, it is a good suggestion.

nrc avatar Jun 20 '17 20:06 nrc

Thank you.

KalitaAlexey avatar Jun 20 '17 20:06 KalitaAlexey