Skip to content

Commit the tool for generating typescript classes from the analysis server spec #2

Closed

Description

@devoncarew

It would make it possible for other people to iterate on the generated analysis server wrapper (perhaps committed into a tool/ directory).

Activity

  1. DanTup commented on Aug 4, 2016

    @DanTup
    Member

    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 :)

  2. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Aug 4, 2016
  3. added this to the milestone on Aug 4, 2016
  4. self-assigned this
    on Aug 4, 2016
  5. devoncarew commented on Aug 4, 2016

    @devoncarew
    ContributorAuthor

    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 :)

  6. DanTup commented on Aug 4, 2016

    @DanTup
    Member

    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!

  7. devoncarew commented on Aug 4, 2016

    @devoncarew
    ContributorAuthor

    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.

  8. DanTup commented on Aug 4, 2016

    @DanTup
    Member

    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.

  9. DanTup commented on Aug 13, 2016

    @DanTup
    Member

    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.

  10. added and removed
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Aug 20, 2016
  11. DanTup commented on Aug 27, 2016

    @DanTup
    Member

    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.

  12. devoncarew commented on Aug 27, 2016

    @devoncarew
    ContributorAuthor

    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
  13. changed the title [-]commit the `Dart-Code-Class-Builder` tool?[/-] [+]Commit the tool for generating typescript classes from the analysis server spec[/+] on Aug 27, 2016
  14. 6 remaining items

  15. modified the milestones: v1.0, v1.1 on Mar 3, 2017
  16. modified the milestone: v1.1 on Mar 31, 2017
  17. removed their assignment
    on Jan 30, 2018
  18. added this to the Backlog milestone on Feb 21, 2018
  19. DanTup commented on Aug 4, 2020

    @DanTup
    Member

    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).

  20. removed this from the Backlog milestone on Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions