-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Intellisense #39
Comments
I don't think it's possible to get intellisense right now, since you are essentially working with plain js obsects. I have some plans for ags v1 where instead of passing plain objects you would pass them with a function call like // instead of this
const button1 = ags.Widget({
type: 'button',
onClick: () => {},
child: { type: 'box', children: [/* widgets*/] }
});
// you would do this
const button2 = Button({
onClick: () => {},
child: Box({ children: [/* widgets */] )}
}); and with this, it would be possible to import function definitions and therefore have intellisense |
But for user defined widgets I am not sure how intellisense would be achieved, since |
That would be really cool to be able to get intellisense, your proposed syntax looks great I saw some libs for gjs that can be used to generate typing for it maybe, you can benefit from it Thank you for your answer |
Just saw gnome migrate to es modules. I will do the same and the import problem will be solved too |
Any progress on the migration to ESM? Has it potentially improved typings? |
Custom defined widgets are automatically inferred, since they are just functions, but the builtin widgets don't have type definitions yet, JsDoc might be better than typescript types, since most people are not using tsserver, but I don't have the patience to write them manually |
you can import dts files in jsdoc. Maybe using https://github.com/Rich-Harris/dts-buddy to create a dts file and shipping that as a downloadable to put into your ~/.config/ags file could be a good idea |
Here is This file is incomplete: there are TODOs left and I didn't cover all widget properties. |
@Aylur Could you please elaborate on why this was closed? |
Didn't mean to reopen, I just missclicked |
Hi there !
Great work with ags looking forwad to use it,
How can one get intellisense on its config file using ags ?
Even better, is it possible to write it in typescript ?
Thanks in advance :)
edit : wrong repo, my bad
The text was updated successfully, but these errors were encountered: