langium
langium copied to clipboard
Various code actions about types
Write some code actions as quick fixes for validations from #426:
- [ ] type names duplication -> removes a duplicated type
- [x] validation of property name duplication (#430) -> removes a duplicated property (dupes are flagged as an error, but no action to remove)
More code actions:
- [ ] adds a declared type by inferred type name
- [ ] replaces a dummy rule with a declared type
- [x] adds
return T
to rule for general errorThe type 'T' is already explicitly declared and cannot be inferred.
From #449.
Added a third case to more code actions above.
I can take this one :octocat:
This one has been around for awhile. I would vote to close this out and create separate issues instead:
- generate declared type for rule (from inferred type)
- identify & recommend replacing a dummy rule with a declared type
- code action to remove unused/duplicated declared type (first of non-unique list)
- code action to remove unused/duplicated property (first of non-unique list)
The last two are akin to how TS support handles duplicate declarations, offering to remove the leading one of any number.