Git Product home page Git Product logo

Comments (11)

DanTup avatar DanTup commented on September 25, 2024

This is on the TODO list. It's a C# project in another repo. It needs much tidying up (my focus was on making good output, rather than it being clean code) but I do see value in sharing it. I suspect it's most useful if people can easily tweak it for other languages so I want to make that a little easier :)

from dart-code.

devoncarew avatar devoncarew commented on September 25, 2024

Ah, I'd assumed it was in this repo (and in typescript), just not yet committed. I was going to make the comments a little prettier in the generated output :)

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

I haven't reviewed it much yet.. what changes did you want to make? It might be a good thing for me to convert to Dart to help test the extension; I don't have much real world Dart (out experience with it) yet!

from dart-code.

devoncarew avatar devoncarew commented on September 25, 2024

Really, just some futzing with the comment output. To convert something like this:

/**
Reports the overriding members in a file.
This notification is not subscribed to by default. Clients
can subscribe by including the value "OVERRIDES" in
the list of services passed in an analysis.setSubscriptions
request.
*/

to:

/**
 * Reports the overriding members in a file. This notification is not subscribed
 * to by default. Clients can subscribe by including the value "OVERRIDES" in
 * the list of services passed in an analysis.setSubscriptions request.
 */

Nothing at all worth changing how you're generating the library code, esp. as it looks like the generated code is working pretty well for you.

I also have some generator code here: https://github.com/dart-atom/dartlang/blob/master/tool/analysis/generate_analysis.dart (and the output: https://github.com/dart-atom/dartlang/blob/master/lib/analysis/analysis_server_lib.dart), for a dart wrapper.

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

Gotcha! I'll do some tidying up of it and publish it soon. I might also try writing it in Dart to help test the extension. Good to see someone elses generator code that is basically strings! I had a half-implemented Roslyn version of this (from when I was generating C# for DartVS) and it was so unreadable! This one is just strings, but at the moment the code formatting is a bit nasty with multiline as I was just working on getting the output nice.

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

I've been meaning to sit down and write some "real Dart" using this for a while, and still haven't gotten to it! So, my plan for tomorrow if I can find a few hours is to have a go at writing a script in Dart to do this (and ditch the C# one).

I'm gonna avoid looking at yours initially (to test discovery of functionality in imported packages, etc.).

Repo will be at Dart-Code/analysis-server-typescript-generator.

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

I finally got round to starting this... The other repo now contains code to generate the typescript types (analysis_server_types.ts, it doesn't yet generate analyzer_gen.ts). The analysis_server_types.ts file on master uses this new version.

It's probably not fantastic Dart (I'm a noob!) but it basically matches the old TypeScript with a few tweaks including better comment formatting (as you suggested above), interfaces instead of classes (this allows optionals to work, which you can't have on classes in TS) and some other minor tweaks. I've done some testing and everything seems to work exactly the same.

If you end up checking out the Dart to make any tweaks, feel free to tidy up and/or comment on anything you think is weird; comments from an experienced Dart dev would surely help me improve! :)

This was the first time I've sat and used Dart Code properly for a few hours as a user, it was good to do some real testing! The only annoyances for me were 1) no rename, 2) debugger not working (for some reason I thought this was expected, but as I write this I realise the bug we had was with awaits, so not hitting breakpoints is actually another bug - I'll raise shortly) and 3) no signature help.

I'll keep this issue open until I've done the other part.

from dart-code.

devoncarew avatar devoncarew commented on September 25, 2024

I've been using it too! I'll add my 4 big (missing) items:

  • debugging
  • rename
  • quick fixes (vscode calls these code actions?)
  • some kind of type hierarchy view

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

Seems quite a few overlap :)

I've already got code actions on a branch, but while testing I hit a VS Code issue. It was fixed yesterday, I just need to test (I thought there would be an insiders build overnight, but it hasn't arrived).

I'm gonna tag all issues from either of our lists as 0.10 as something to aim for. I think some (mainly await debugging and rename) might require external changes/fixes, but since they're on both our lists maybe we can get them to a state they can be shipped. There are a few other minor things alerady in 0.10 I'd like to try and tackle too.

List is here:

https://github.com/Dart-Code/Dart-Code/milestone/10

I don't think there's any rush to get a new version out (the current version is "decent") so I I think it'd be worthwhile holding off to get as many of those in as possible (and a couple are fixed/improved with the next Code release which I guess is a week so away?).

If you feel strongly about any other issues, drop a comment on them and I can change the milestone.

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

Still to do:

  • Port analyzer_gen.ts generation
  • Add missing types (eg. AnalysisUpdateContentResponse)

from dart-code.

DanTup avatar DanTup commented on September 25, 2024

Well this is an old issue 😬

It was only ever half-done, but with moving to LSP this code-gen'd stuff (which has been somewhat hand-edited with smaller changes recently) will eventually be removed (after a period for compatibility with older SDKs without sufficiently-good LSP support).

from dart-code.

Related Issues (20)

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.