Open FMCorz opened 3 months ago
Hi Fred, There are already some directives you can add, see https://mdlcode.dev/docs/directives
However I don't think MDLCode will index/analyse the ts/tsx files at all. And also I'm not sure if the library I use to parse JS files will even work with typescript, I would need to bring in a new library, add allowed paths, etc.
I'll look at your plugin and see if it can be done quickly
Thanks, I'll have a look at directives.
It would be useful (to me) if we could configure additional language string regexes as some of my custom implementations aren't detected, and the strings are reported as unused when they actually are.
Why do I have custom language string calls? I write TypeScript/React code which is then transpiled in AMD code. Under the hood they use the regular Moodle language string modules but they aren't detected by the extension.
If regexes could be configured, it might be useful to restrict their scopes to certain components and/or file types to avoid performance issues. Although, having regexes to begin with would be ideal. To make things more annoying, I typically set the default component of the function call as the plugin I wrote these in.
I note that I am suggesting regexes because I understand that my use case isn't common.
React hooks example:
React component example:
Sources/examples: