kisstkondoros / codemetrics

VSCode extension which shows the complexity information for TypeScript class members
Other
402 stars 20 forks source link

Flutter / Dart support? #88

Closed peterpoliwoda closed 1 year ago

peterpoliwoda commented 3 years ago

Hi there, I'm loving your work every day I write JavaScript code @kisstkondoros. The little square next to a function name is a life saver sometimes and makes me write better code in a great visual way. Now, since moving over to doing some mobile dev work, I'm looking at my Dart code and wonder if it would be possible to make your plugin work with it somehow. Since the language is not a hundred miles off (Just about a half of that maybe...).

I was wondering if you'd ever consider support for other languages, like Dart for Flutter development for example since VisualStudio Code is the second go to tool for us mobile community people?

kisstkondoros commented 3 years ago

Thanks for the kind words and for reaching out, it's good to hear that the stuff I did actually helps people :smiling_face_with_three_hearts:

About support for other languages than js/ts: The extension is built around https://github.com/kisstkondoros/tsmetrics-core and it does the heavy lifting. It gets the AST from typescript, walks over the nodes of it etc. Theoritically it should be possible to do something like this using https://pub.dev/packages/analyzer (or some other tool to get the AST) and represent the results using this extension. (via e.g. some sort of plugin mechanism)

At the moment I have no time / motivation to implement it, but I might get back to this in the future.

I'll leave this open, as I think it is in general a cool idea.

And as always PR's are more than welcome :wink:

peterpoliwoda commented 3 years ago

Thanks for actually looking into it this fast ha! So, to make this work we'd have to update the tsmetrics-core, with a Flutter analysis section and then include the new version in this extension? Is it possible to run a dart package within VSCode just like you would any js or npm package? The Dart Pedantic linter uses a package installed in your dev_dependencies, slightly different but it helps a ton with the initial problems, but it doesn't solve the code complexity just yet. This AST analysis looks promising.

kisstkondoros commented 3 years ago

I would rather create a separate package (fork? maybe) out of tsmetrics-core and tear typescript out of it and include some sort of dart specific AST analysis tool instead. When that is done, the dart specific package would need to be published to npm and the integration code would need to be written in this repo.

kisstkondoros commented 1 year ago

Closing due to inactivity