Commit graph

35 commits

Author SHA1 Message Date
Diego Augusto
da5b9909fc Support array type 2024-07-04 22:02:51 +00:00
James Westman
62f74178f7 lsp: Implement "go to definition" 2023-07-25 18:40:05 -05:00
James Westman
0a4b5d07a1 Remove PropertyBinding rule, just use Binding 2023-07-20 18:46:45 -05:00
James Westman
cb1eb9ba44 lsp: Show better info on IdentLiteral hover
Instead of showing the documentation for the expected type, show the
signature of the referenced object.
2023-07-16 16:52:51 -05:00
gregorni
3730e2e726 Add isort to CI and run on files 2023-07-09 14:26:37 +00:00
James Westman
6ac798ea6f
More errors for duplicates 2023-05-17 10:41:45 -05:00
James Westman
04509e4b2e Change template syntax
Templates now use a TypeName instead of an identifier, which makes it
clearer that it's an extern symbol (or that it's a Gtk.ListItem).
2023-05-13 16:49:48 -05:00
James Westman
26072500c8 Fix Gio.File properties 2023-05-11 13:18:24 -05:00
James Westman
8fcd08c835 Add Adw.Breakpoint custom syntax 2023-05-08 10:11:40 -05:00
James Westman
d4c2bb34eb Remove trailing commas in Translated 2023-05-06 15:30:18 -05:00
James Westman
a9f6bf8d89 Remove unused imports and code 2023-05-06 15:30:18 -05:00
James Westman
3c1941a17e Simplify Translated
Remove the TranslatedWithContext and TranslatedWithoutContext rules and
just use Translated.
2023-04-29 21:57:33 -05:00
James Westman
a2eaaa26fe Rename property to avoid conflict
TranslatedWithContext.context conflicted with AstNode.context
2023-04-28 20:49:22 -05:00
James Westman
ec844b10ca Add ScopeCtx instead of root.objects_by_id
This allows us to introduce new scopes, such as in
GtkBuilderListItemFactory templates.
2023-04-28 20:49:22 -05:00
James Westman
75055ac967 Move bindings out of the Value syntax
They're only valid in properties, so they should just be there. Same
with object values.
2023-04-12 21:44:07 -05:00
James Westman
ac2a7d9282 Add StringValue
Makes the grammar more specific in a few places that take only a string
literal or translated string.
2023-04-12 21:44:07 -05:00
James Westman
02796fd830 Use <> instead of () for casts & typeof
This makes it clearer that they aren't functions, and it eliminates
syntactic ambiguity with closure expressions.
2023-04-10 09:39:34 -05:00
Cameron Dehning
7e20983b44 Lsp hotfix 2023-03-24 16:27:22 +00:00
James Westman
98ba7d467a Improve expression type checking 2023-03-12 16:12:16 -05:00
James Westman
b636d9ed71 Fix bugs in number literals 2023-03-12 14:58:35 -05:00
James Westman
0f5f08ade9 Fix flag syntax
Unlike commas, no trailing "|" is allowed.
2023-03-11 21:24:52 -06:00
James Westman
1df46b5a06
Change the way values work
Change the parsing for values to make them more reusable, in particular
for when I implement extensions.
2023-01-12 15:49:19 -06:00
James Westman
6938267952
Add properties to AST types
I want to have a cleaner API that relies less on the specifics of the
grammar and parser.
2023-01-12 15:49:19 -06:00
James Westman
6c67e1fc5a
xml: Fix flags and enums
GtkBuilder XML uses enum nicknames, full names, or integer values, but
we accept GIR names, so passing those through doesn't work if the name
has an underscore (which traditionally turns into a dash in the
nickname). Avoid the problem by always writing the integer value of the
enum member.
2022-12-19 15:15:25 -06:00
James Westman
8fee46ec68
Format using black 2022-12-19 11:52:59 -06:00
James Westman
0b8012b8e1
Support Python 3.9
Remove the '|' syntax for type unions, since it's a 3.10 feature, and
set mypy to check with version 3.9.
2022-10-27 13:16:18 -05:00
James Westman
a24f16109f
Separate output into its own module 2022-10-15 19:40:47 -05:00
James Westman
c0c40b1577
language: Support boxed types and GType
- Add support for type checking boxed types
- Remove support for converting string and number literals
- Add the `typeof()` operator for GType literals
2022-10-06 13:03:33 -05:00
James Westman
06f54c8ff8
Use typelib instead of XML
For normal compilation, use .typelib files rather than .gir XML files.
This is much faster.

Rather than using libgirepository, which would try to actually load the
libraries, we use a custom parser.

The language server will still read XML because it needs to access
documentation, which is not in the typelib, but that's generally fine
because it's a long lived process and only has to do that once.
2022-06-25 00:15:20 -05:00
James Westman
417f163a5a
Fix crash in flags value for unchecked classes 2022-04-18 15:42:55 -05:00
James Westman
3f37380c25
tests: Test that docs & completions don't crash 2022-03-19 18:16:25 -05:00
James Westman
e6ad51c682
Show docs for flag values 2022-03-04 15:06:13 -06:00
James Westman
8ea06e8a78
Add validation for flag values 2022-03-02 14:06:57 -06:00
James Westman
bebe784d1d
Fix type check for flags when only one is present
When only one flag is specified, it's parsed as an IdentValue rather
than a FlagsValue, so IdentValue needs to be able to type check flags
(aka bitfields) properly.

Fixes #47
2022-03-02 13:57:30 -06:00
James Westman
ee5f32622f reorganization: Finish moving parsing and AST 2022-01-26 22:37:51 -06:00