You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit the tool for generating typescript classes from the analysis server spec #2
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 :)
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 :)
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!
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.
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.
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.).
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.
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
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).
Activity
DanTup commentedon Aug 4, 2016
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 :)
devoncarew commentedon Aug 4, 2016
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 :)
DanTup commentedon Aug 4, 2016
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!
devoncarew commentedon Aug 4, 2016
Really, just some futzing with the comment output. To convert something like this:
to:
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.
DanTup commentedon Aug 4, 2016
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.
DanTup commentedon Aug 13, 2016
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.
Replace analysis server types file with newly-generated version.
DanTup commentedon Aug 27, 2016
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 generateanalyzer_gen.ts). Theanalysis_server_types.tsfile 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.
devoncarew commentedon Aug 27, 2016
I've been using it too! I'll add my 4 big (missing) items:
[-]commit the `Dart-Code-Class-Builder` tool?[/-][+]Commit the tool for generating typescript classes from the analysis server spec[/+]6 remaining items
(TEMP) Log attempt #2
(TEMP) Log attempt #2
DanTup commentedon Aug 4, 2020
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).