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

language based on folder name #44

Closed yfengBTI closed 2 years ago

yfengBTI commented 3 years ago

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.

uctakeoff commented 3 years ago

I'm sorry. Your English is too difficult for me to understand, I'm not sure I could. Do you want to aggregate by folder? I don't think your idea is useful to many other people at the moment. You can get detailed statistics from the result.csv file. Isn't it possible to get the information you want by processing the CSV file?

uctakeoff commented 3 years ago

Alternatively, you could also add the summary information to the CSV file and output the language distribution of each directory.

yfengBTI commented 3 years ago

So let's say I have this folder structure:

objects/
├── processes/
│   ├── refresh-dimensions.json
│   ├── reload-data-files.json
│   ├── reload-env-var.json
│   └── reload-feeders.json
├── chores/
│   ├── on-server-startup.json
│   └── hourly.json

We use json files to define a lot of different object types, and each type follows a different schema. It would be nice to be able to see these as Process-JSON and Chore-JSON instead of only JSON because of the schema differences.

Hope that makes sense.

uctakeoff commented 3 years ago

Thank you for the detailed explanation. Perhaps that makes sense. But I still can't generalize your ideas. And it is difficult to determine automatically when your ideas should be applied.

As an alternative, I suggest you to prepare a table in summary like the following

dir JSON YAML TypeScript ...
objects/ 3456 123 5678 ...
objects/processes 1222 0 0 ...
objects/chores 578 0 0 ...