uctakeoff / vscode-counter

VS Code extension: counts blank lines, comment lines, and physical lines of source code in many programming languages.
MIT License
151 stars 20 forks source link

Real time counter for workspace #10

Open bernardoadc opened 4 years ago

bernardoadc commented 4 years ago

Create option to choose wheter real time counter is for current file or whole workspace (all file extensios). Futurely, file extensions could be chosen too.

uctakeoff commented 4 years ago

That's an interesting idea. If the counter is always counting, the load will be high, so I think that it is good to make the whole count only the first time and then only the file being edited. However, if you do so, the edits made in other editors will not be reflected, but is there any better way?

bernardoadc commented 4 years ago

That's a good point. (but wouldn't that be a rather uncommon situation?)

I can only think of two solutions: 1) watch file updates. This can also be costly, so I thought about vscode events who should already monitor project's file tree. I don't know much about that, but couldn't find it here at least: https://code.visualstudio.com/api/references/activation-events

2) time delays. Check all files at regular intervals, which could possibly be long enough by default, and maybe configurable (if it doesn't compromise extension by adding yet another setting).

If I may add another suggestion in this issue (I know I'm stretching the line here), I think real time line count of current file is good but could easily be seen manually. What could be more useful, IMHO, are blank and comment counts for the current file. That would be a pain to do manually. So two modes for user to choose from: real time whole workspace line count, or real time blanks and comments line count for current file.