-2

I'm not sure if this question belongs to Stack Overflow or somewhere else. Sorry if it doesn't belong here.

My question is, in an IDE, does its linter, check the whole source code every time (whenever a user update the code or periodically), or does it check only the code that has been added/removed?

2
  • 1
    The broadness of the question is not in asking about both linters and formatters, but rather in asking about all the possible methods that those could work. Commented Jan 2, 2020 at 9:40
  • 1
    Ok. Thanks. I just wanted that reason instead of downvotes everytime Commented Jan 2, 2020 at 17:04

1 Answer 1

1

One of the benefits of an IDE is that ... it's integrated. Unlike a CLI tool that has no choice but to run on an entire file (unless it maintains some cache and can do diffing, but that's complex), an IDE knows precisely what you've edited (even without saving to disk), so that it can run linters/formatters on local scopes without needing to parse everything again.

Now that's theoretical. Whether or not real IDEs do that can vary. One of the difficulties here is that you need to be able to parse subsections of a file of code, and modify the existing AST (the one generated from before your edit) to change its nodes that correspond to the area you edited. That might be tricky, so I image a lot of IDEs would have linters/formatters that parse the entire file, every time, and then just apply changes only to the area you selected.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.