Giter Site home page Giter Site logo

uctakeoff / vscode-counter Goto Github PK

View Code? Open in Web Editor NEW
145.0 0.0 20.0 2.41 MB

VS Code extension: counts blank lines, comment lines, and physical lines of source code in many programming languages.

License: MIT License

TypeScript 100.00%
vscode vscode-extension typescript

vscode-counter's Issues

Wrong results when there is a 2nd directory which has the requested name included

When I execute "count lines in directory" on a directory e.g. named "swcMatrix" and there is a 2nd directory which has the same name included, e.g. "swcMatrixLedController", the 2nd directory is counted additionally in the result, here the file result.md:
`# Summary

Date : 2021-02-04 06:31:49

Directory u:\app\swcMatrix

Total : 21 files, 5348 codes, 1184 comments, 1025 blanks, all 7557 lines

details

Languages

language files code comment blank total
C 10 4,520 966 816 6,302
C++ 11 828 218 209 1,255

Directories

path files code comment blank total
. 21 5,348 1,184 1,025 7,557
.. 15 3,924 493 727 5,144
..\swcMatrixLedController 15 3,924 493 727 5,144
..\swcMatrixLedController\include 8 741 166 169 1,076
..\swcMatrixLedController\src 7 3,183 327 558 4,068
include 3 87 52 40 179
src 3 1,337 639 258 2,234

details`

VS Code Counter version: v2.2.1
Could this issue please be fixed?

Unable to resolve nonexistent file

Hello.
When i am trying to use the extension, i encounter the following error message in console and nothing happens:

rejected promise not handled within 1 second: EntryNotFound (FileSystemError): Unable to resolve nonexistent file 'd:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\test-stuff\.VSCodeCounter'

stack trace: EntryNotFound (FileSystemError): Unable to resolve nonexistent file 'd:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\test-stuff\.VSCodeCounter'

Some info:
Operating System: Windows 10 Pro
Architecture: 64 Bit
VSCode Version: 1.63.2 (user setup)
Extension Version: 3.0.0

should only enable extension when run commands

remove *:

"activationEvents": [
    "*",
    "onCommand:extension.vscode-counter.countInFile",
    "onCommand:extension.vscode-counter.countInDirectory",
    "onCommand:extension.vscode-counter.countInWorkspace",
    "onCommand:extension.vscode-counter.outputAvailableLanguages"
  ]

[VSCodeCounter] There was no target file.

My Vscode version is 1.43.2. and Programming language is PHP. When I click to "count line in the Directory " is show me this message "[VSCodeCounter] there was no target file." this is an excellent extension, could you please fix the issue.

Cannot detect js file

I click count line in the Directory, it show me [VSCodeCounter] there was no target file. In this directory, there are just serveral js files. I try other usage given by doc and still not working with js file.

I execute VSCodeCounter: Check Available Language and the javascript config is aliases[JavaScript,javascript,js], extensions[.js,.es6,.mjs,.cjs,.pac], filenames:[jakefile].

I'm confused about filenames:[jakefile]. I'm not sure whether the jakefile causing js files undetectable. I don't know how to override the property filename in settings.json.

language based on folder name

Is it possible to designate JSON files inside a folder a different language?
I see that filename is an option but not folder name, and I understand there's a directory view below.
This will give me control to create a better summary view up top.

Extension Fails on Mac OS

Latest version on Mac OS Latest.

[2020-09-03 11:42:05.070] [renderer1] [error] command failed with error code 2: error parsing glob '!/{/.gitignore,/.vscode/,/node_modules/,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter}': nested alternate groups are not allowed
: Error: command failed with error code 2: error parsing glob '!/{
/.gitignore,/.vscode/,/node_modules/,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter}': nested alternate groups are not allowed

at Object.t.deserializeSearchError (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5072:889)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5152:906
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5151:8

[2020-09-03 11:42:55.330] [renderer1] [info] Setting search error: XHR timeout: 5000ms
[2020-09-03 11:42:55.331] [renderer1] [info] Setting search error: XHR timeout: 5000ms
[2020-09-03 11:43:00.333] [renderer1] [info] Setting search error: XHR timeout: 5000ms
[2020-09-03 11:43:00.333] [renderer1] [info] Setting search error: XHR timeout: 5000ms
[2020-09-03 11:43:05.896] [renderer1] [info] Setting search error: XHR timeout: 5000ms
[2020-09-03 11:43:05.973] [renderer1] [info] Setting search error: XHR timeout: 5000ms
[2020-09-03 11:44:24.672] [renderer1] [error] command failed with error code 2: error parsing glob '!/{/.gitignore,/.vscode/,/node_modules/,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter}': nested alternate groups are not allowed
: Error: command failed with error code 2: error parsing glob '!/{
/.gitignore,/.vscode/,/node_modules/,/.git,/.svn,/.hg,/CVS,/.DS_Store,/.js: { "when": "$(basename).ts" },.VSCodeCounter,/.git,/.svn,/.hg,/CVS,/.DS_Store,/.js: { "when": "$(basename).ts" },.VSCodeCounter}': nested alternate groups are not allowed

at Object.t.deserializeSearchError (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5072:889)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5152:906
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5151:8

[2020-09-03 11:46:41.734] [renderer1] [error] command failed with error code 2: error parsing glob '!/{/.gitignore,/.vscode/,/node_modules/,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter}': nested alternate groups are not allowed
: Error: command failed with error code 2: error parsing glob '!/{
/.gitignore,/.vscode/,/node_modules/,/.git,/.svn,/.hg,/CVS,/.DS_Store,/.js: { "when": "$(basename).ts" },.VSCodeCounter,/.git,/.svn,/.hg,/CVS,/.DS_Store,/.js: { "when": "$(basename).ts" },.VSCodeCounter,/.git,/.svn,/.hg,/CVS,/.DS_Store,/*.js: { "when": "$(basename).ts" },.VSCodeCounter}': nested alternate groups are not allowed

at Object.t.deserializeSearchError (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5072:889)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5152:906
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5151:8

How to ignore directories

Hi,

I see this issue was raised and closed before but I can't seem to get VSCodeCounter to ignore directories or files. In my user and workspace settings.json files I have placed the following:

  "files.exclude": {
    "**/.git": true, // this is a default value
    "**/.DS_Store": true, // this is a default value
    "**/data/PCAP/**": true,
    "**/data/PCAP/extract_files/**": true,
    "**/data/CSV/**": true,
    "**/data/failed_code_samples/**": true
  },

  "VSCodeCounter.useGitignore": true,
  "VSCodeCounter.useFilesExclude": true

When I run VSCodeCounter it shows all the CSV/JavaScript/HTML files even though all of these directories are listed in "files.exclude" and are stored in .gitignore (although I see on the last issue about this that the .gitignore functionality wasn't actually implemented)

Any ideas what's wrong? It could very well be settings syntax but I'm struggling to find any good examples online..

Thanks,
CryptoCat

Real time counter for workspace

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.

Auto ignore the .VSCodeCounter directory

Hi, I like this extension, it's pretty awesome!

I just have one request, I have to do this:

"VSCodeCounter.exclude": [
     // ignore the output directory or it will be counted it on subsequent counts
    ".VSCodeCounter"
]

or if I run it again it adds the output files from running this extension to the totals.

Filter feature

I happy to use it.
I just to request one more feature. If you provide filter more strong product.
It is similar question #1 issue but If user can filter out UI. It will be more convenient.

Example) I want to filter out some specific folder.
\bin
\obj
\obj\Debug
\obj\Release
\packages

[VSCodeCounter] Error has occurred. on counting lines in directory.

Hi!
I'm on Ubuntu Linux using VS Code 1.40.0 and VSCode Counter 1.2.1.
When I try to count lines in a directory, I get the following error message:
[VSCodeCounter] Error has occurred.

The console log shows the following:
console.ts:137 [Extension Host] [VSCodeCounter] countLinesInDirectory : /home/chross/Dropbox/Codebase, Project.Sys/ihg console.ts:137 [Extension Host] [VSCodeCounter] associations : 1[*.xml,xml] console.ts:137 [Extension Host] [VSCodeCounter] target : 545 files console.ts:137 [Extension Host] [VSCodeCounter] use gitignore : /home/chross/Dropbox/Codebase, Project.Sys/project_shared/phpword/.gitignore console.ts:137 [Extension Host] [VSCodeCounter] use gitignore : /home/chross/Dropbox/Codebase, Project.Sys/project_shared/phpword/samples/results/.gitignore console.ts:137 [Extension Host] [VSCodeCounter] target : 545 files notificationsAlerts.ts:40 [VSCodeCounter] Error has occurred. onDidNotificationChange @ notificationsAlerts.ts:40 (anonymous) @ notificationsAlerts.ts:26 fire @ event.ts:580 addNotification @ notifications.ts:171 notify @ notificationService.ts:101 (anonymous) @ mainThreadMessageService.ts:83 _showMessage @ mainThreadMessageService.ts:44 $showMessage @ mainThreadMessageService.ts:38 _doInvokeHandler @ rpcProtocol.ts:398 _invokeHandler @ rpcProtocol.ts:383 _receiveRequest @ rpcProtocol.ts:299 _receiveOneMessage @ rpcProtocol.ts:226 (anonymous) @ rpcProtocol.ts:101 fire @ event.ts:580 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:580 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:200 addChunk @ _stream_readable.js:294 readableAddChunk @ _stream_readable.js:275 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166

Could the dir name be the reason?

Can it auto-start ?

I need to start this extension from the panel every time after restart VSCode. I haven't found a related option in the settings.

Could you please add an option to toggle to autostart of this extension? Thanks!

How to ignore directories

How do you make it ignore some directories? Seems like it might be ignoring node_modules already, is there a way to control this and add more directories to that ignore list?

Count lines in workspace does not work

When I select Count lines in workspace, it prompts for a folder selection and if you select a folder, it only counts lines in that folder. I would think it should not prompt for anything and just iterate over all folders in the workspace.

no support for windows1252

I tried this extension, and crashes on graceful-fs becasue: The value "windows1252" is invalid for option "encoding"

image

In settings.json of workspace I have:

{
    "files.encoding": "windows1252"
}

It is a VSCode value.

Does not work

Environment

  • OS: macOS 12.3
  • VS Code: 1.60.2

Steps to Reproduce

  1. Install extension
  2. Open a folder in VS Code
  3. Run command "VSCodeCounter: Count Lines in Directory/Workspace"
  4. Observe status bar progress indicator appears and completes

Expected behavior

A new tab appears like in the README GIF

Actual behavior

Nothing happens

Handling symlinks

Cool looking plugin! Unfortunately my source code is behind a symlink, and it looks like this doesn't work with symlinks. Here's the output of the Developer Console when I try to run "Count Line in Directory":

[Extension Host] [VSCodeCounter] 2020-03-31T18:30:12.112Z uctakeoff.vscode-counter ver.1.3.3 now active! : c:\Users\A9FZGZZ\.vscode\extensions\uctakeoff.vscode-counter-1.3.3
console.ts:137 [Extension Host]% Object
t.log @ console.ts:137
console.ts:137 [Extension Host]% Object
t.log @ console.ts:137
console.ts:137 [Extension Host]% Object
t.log @ console.ts:137
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.249Z build CodeCounter start
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.257Z associations : 1[*.json,jsonc]
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.261Z create CodeCounter end
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.262Z countLinesInDirectory : file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface/src/app, output dir: file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface/.VSCodeCounter
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.263Z includes : "**/*"
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.263Z excludes : "**/.gitignore", "**/.vscode/**", "**/node_modules/**", "**/.git", "**/.svn", "**/.hg", "**/CVS", "**/.DS_Store", "[App]sal-user-interface/.VSCodeCounter"
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.535Z target : 124 files -> use .gitignore
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.751Z target : 124 files
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.877Z count 124 files
console.ts:137 [Extension Host] [VSCodeCounter] 2020-03-31T18:31:08.877Z OutputDir : file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface/.VSCodeCounter
console.ts:137 [Extension Host] makeDirectories file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface/.VSCodeCounter
console.ts:137 [Extension Host] makeDirectories file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface
console.ts:137 [Extension Host] Unhandled Rejection:  file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface is not directory.
console.ts:137 [Extension Host] rejected promise not handled within 1 second: file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface is not directory.
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:587
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:587
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:203
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:276
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
log.ts:197   ERR file:///c%3A/AIMDev/Projects/StreamlinedActiveLearning/Web/Applications/sal-user-interface is not directory.

Doing line counts for the whole project also doesn't work. Thanks for a cool line counter!

Vscode Counterで行数がカウントできません。"The "input" argument must be an instance of ArrayBuffer or ArrayBufferView. Received null"

Visual Code Studio version: 1.60.2 (user setup)
VS Code Counter version: V2.3.0

CloneをLocalに作成して、コードのカウントを行おうとしましたが、
ディレクトリ内のコードが数えられません。コードファイルは存在します。
Error MSG="The "input" argument must be an instance of ArrayBuffer or ArrayBufferView. Received null"
何が原因か分かりません。

Simply does not work after v1.3.0!

No matter what I try, be it workspace, directory I get the error: [VSCodeCounter] There was no target file.

Version is showing as 2.2.1 and I'm using the latest fully-up-to-date version of VSCode

I "walked back" the versions... anything below 1.3.1 works , nothing above 1.3.0 works, all failing with the error above

comment lines of tsx is incorrect

In tsx files, comment in element was not counted.

      {/* Bulletin Board Card */}
      <BulletinBoardCard
        title={title}
        content={content}
        address={address}
        contributor={contributor}
        publishStart={publishStart}
        publishEnd={publishEnd}
        onClick={onClick}
      />

comment like {/* Bulletin Board Card*/} was not recognized to comment.

How to add addtional File Types

Is there a way to add file types to the "known" file types? I would like to be able to count Razor files (*.cshtml, .vbhtml), and Web Form files (.aspx, *.ashx).

Maybe this could be added as a configuration setting so the extension doesn't have to know all of them?

[VSCodeCounter] There was no target file.

I'm trying this extensipn and when pick the option 'count lines in directory' I get the message: [VSCodeCounter] There was no target file.
I'm using the extension with .prg - harbour - files.
Can you help me ?

Regards

How to set ignores for local project?

How to use a customized setting for different project, and not use the global setting?

For example, my global settings.json is configured as below
global settings.json file path: ~/Library/Application Support/Code/User/settings.json

{
    "VSCodeCounter.exclude": [
        "**/node_modules/**",
    ]}

but I want ignore "**/static/**" in my local project, when I configure in local settings.json, it does not work.
local settings.json file path: /Users/xxx/local_project/.vscode/settings.json

{
    "VSCodeCounter.exclude": [
        "**/node_modules/**",
        "**/static/**"
    ]
}

Is there a way to set ignores for local project? Thank you.

Error on large code bases

I'm receiving the following on workspaces with large numbers of files when running "VSCodeCounter: Count lines in workspace"...

<path to file> Read Error : EMFILE: too many open files, open <path to file>

I have been able to get around in some projects with excludes, but would be nice to not have to exclude files.

Amazing !! You deserve appreciation!

I had this desire from long but wasn't able to get the stats like this. Amazing work dude. You made it much easy <3
Loved the way it generates the reports seriously <3

jupyter output lines are counted

Sometimes when you have a large table or graph output, the number of output lines dominates the whole project. Should the notebook outputs be excluded from the count?

CSV could be more strictly formed

My project has a lot of files with commas in the names.

eg xml files that are used for test cases
if the test case is "TestStatusForType(1,2,3)"
then there will be a file "TestStatusForType(1,2,3)_expectedresult.xml"

This causes a problem because the commas are not in synch with the expected output in CSV format

The result would be better if the filename is always wrapped in double quotes for CSV output
(but possibly you would need to also remove/escape quotes that are embedded in the filename :) )

Counting .h as C++ code

I worked on a project for a college assignment, it's written entirely in C (and a single python script), and VS Code Counter is considering my C header files (.h) as C++ code:
image

(I checked the headers' number of lines, they match the C++ column)

VSCodeCounter: Unsupported

There is no action or response when I press command+shift+p & choose VSCodeCounter: Count lines in workspace in my vscode version 1.47.3. I have no idea what's going wrong. Am I missing some configuration or installed other extensions which may cause conflicts?
image

Adding a "custom" regex to count for

Hello,
great extension.
It would be great as an improvement/added feature if it could be possible to count for a custom text or a regexpr.
Would that be possible?
The end goal would be to count for called function ecc, that would make the tool even more complete.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.