Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Script Word Count Feature #141

Open
pjpollina opened this issue Jun 9, 2022 · 4 comments
Open

[Suggestion] Script Word Count Feature #141

pjpollina opened this issue Jun 9, 2022 · 4 comments
Labels
backlog Something that is not a priority and will be addressed in a future release suggestion

Comments

@pjpollina
Copy link
Contributor

Was wondering if there was any interest in adding something like other VSCode word counter extensions but specifically for Ren'Py scripts, since the more general ones count keywords, character names, etc., and Ren'Py linting only counts the project total (AFAIK). I'm willing to do it, but since I'm not personally familiar with TypeScript or extension development I wanna make sure it's feasible/desired before I start investing the time into it.

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jun 9, 2022

In the new-syntax branch I build a tokenizer that can be used to count tokens, so should be very easy to implement a word counter there.

I do wonder what would be the purpose of this and if this would be something others could benefit from.

If me or @LuqueDaniel see a good purpose, we would be more then happy to accept your suggestion. Thanks for the interest in helping us improve the plugin.

@pjpollina
Copy link
Contributor Author

pjpollina commented Jun 9, 2022

I tend to write out a lotta my scenes right into Ren'Py, and since I use quite a few one-off ATL animations combined with large amounts of 2-4 arg layeredimage names it's hard to get an accurate word count on a per-script basis with existing tools. I figured maybe others had this problem but maybe I just do things weird.

Edit: Example of what I mean, for one of my scenes the word count for just dialog is 695, whereas when you check the word count on the script with all the additional coding you get 2240.

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jun 10, 2022

Ah I see, so what you're saying is you would like to know specifically, the dialog word count?

I can see a use for that, if we make a tiny status bar field like the Ln x, Col x and Spaces: x.
I think that could be a nice feature.
You could even make it a button to change view into other types of counts I suppose.

@LuqueDaniel What do you think?

FYI: If you do start working on this, let me know if you come across any issues using the tokenizer. Currently the tokens are placed in a one D array (sorted by start index), but I was thinking it might be better to group the tokens in a node graph. That would be a lot easier when trying to figure out what token goes where.

@LuqueDaniel
Copy link
Member

@JelleInfinity I was just typing my reply and your last comment popped up 😂 . You have said almost everything I was going to comment on.

I agree with the way to implement it, a counter in the status bar and make it a feature that can be disabled through settings (there will be users who don't want to have more labels in the status bar).

I think it could be useful. If someone wants to implement it, go ahead. But first I would like to merge the PR #76 .

@duckdoom4 duckdoom4 added the backlog Something that is not a priority and will be addressed in a future release label Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Something that is not a priority and will be addressed in a future release suggestion
Projects
None yet
Development

No branches or pull requests

3 participants