Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing promisified overloads #171

Open
JumpLink opened this issue May 5, 2024 · 8 comments
Open

Missing promisified overloads #171

JumpLink opened this issue May 5, 2024 · 8 comments
Labels
bug gjs-convention Marks issues for aligning with GJS coding standards and practices

Comments

@JumpLink
Copy link
Collaborator

JumpLink commented May 5, 2024

@ewlsh Some promisified methods are missing, for example for Gio.read_async + Gio.read_finish or Gio.File.load_contents_async + Gio.File.load_contents_finish

@ewlsh
Copy link
Collaborator

ewlsh commented May 14, 2024

I'm looking at what happened here, should have a fix in the next few weeks.

@swsnr
Copy link
Contributor

swsnr commented May 17, 2024

I'm upgrading a GNOME extension to ts-for-gir 4.0.0 types, and noticed missing promisified overloads as well:

  • Soup.Session.send_async
  • Soup.Session.send_and_read_async
  • Gio.File.delete_async

Is this the same issue, or should I rather open a new one?

@JumpLink
Copy link
Collaborator Author

JumpLink commented May 17, 2024

@swsnr I think this will be the same problem, so it will be correct here.

@ewlsh In v3 I just checked if there are methods with the same prefix and ending with _async and the other with _finish, but that might not be so clean either, especially since there are some cases where this convention is not followed

@JumpLink
Copy link
Collaborator Author

@ewlsh could you explain a bit how this works with you new parser atm? Maybe a good start to get into your code base.

@JumpLink JumpLink added bug gjs-convention Marks issues for aligning with GJS coding standards and practices labels Jun 18, 2024
@ewlsh
Copy link
Collaborator

ewlsh commented Jul 17, 2024

Sorry for the delay here, adding some context and potential fixes here: #177

@swsnr
Copy link
Contributor

swsnr commented Aug 30, 2024

@ewlsh @JumpLink Is there any way forward here, or at least some reasonable workaround? At least for my use cases that's quite a serious regression 😬 and I'm still stuck with the types generated with the old 3.x version.

swsnr added a commit to swsnr/gnome-shell-extension-picture-of-the-day that referenced this issue Aug 30, 2024
Does not build currently, as the 4.x types still suffer from
regressions, notably

- Missing promisified overloads: gjsify/ts-for-gir#171
- Missing GLib.Error.stack: gjsify/ts-for-gir#196
swsnr added a commit to swsnr/gnome-shell-extension-picture-of-the-day that referenced this issue Aug 30, 2024
Does not build currently, as the 4.x types still suffer from
regressions, notably

- Missing promisified overloads: gjsify/ts-for-gir#171
- Missing GLib.Error.stack: gjsify/ts-for-gir#196
@Totto16
Copy link

Totto16 commented Aug 31, 2024

@ewlsh @JumpLink Is there any way forward here, or at least some reasonable workaround? At least for my use cases that's quite a serious regression 😬 and I'm still stuck with the types generated with the old 3.x version.

A "reasonable" workaround is, the casting of these functions, it is ugly, but doable 🤷🏼‍♂️ see an example here
https://github.com/oae/gnome-shell-pano/blob/overhaul-code-highlighting/src/utils/linkParser.ts#L32-L37

and here my personal type helper for this:
https://github.com/oae/gnome-shell-pano/blob/overhaul-code-highlighting/src/types/gio.d.ts#L26-L32

@JumpLink
Copy link
Collaborator Author

@swsnr This is definitely an issue that I would like to fix as soon as I find the time. Apart from that, the 4.x types seem to work fine

swsnr added a commit to swsnr/gnome-shell-extension-picture-of-the-day that referenced this issue Sep 7, 2024
swsnr added a commit to swsnr/gnome-shell-extension-picture-of-the-day that referenced this issue Sep 7, 2024
Does not build currently, as the 4.x types still suffer from
regressions, notably

- Missing promisified overloads: gjsify/ts-for-gir#171
- Missing GLib.Error.stack: gjsify/ts-for-gir#196
swsnr added a commit to swsnr/gnome-shell-extension-picture-of-the-day that referenced this issue Sep 7, 2024
swsnr added a commit to swsnr/gnome-shell-extension-picture-of-the-day that referenced this issue Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gjs-convention Marks issues for aligning with GJS coding standards and practices
Projects
None yet
Development

No branches or pull requests

4 participants