Add support for struct aliases completition #327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this do/fix
When inheriting from struct as an alias you can use all fo its inherited properties as is, without issues. Currently the VLs doesn't show this.
Added the required piece of code that enables looking for
struct_sym.base_structand add it to the list of code complete data if needed.Some info on aliases in vala:
https://gnome.pages.gitlab.gnome.org/vala/manual/structs.html
https://docs.vala.dev/tutorials/programming-language/main/02-00-basics/02-04-data-types.html (section 2.4.7. Defining new Type from other)
This if approved, fixes #300.
Test
The code provided on the issue should work OK with this change:
Remarks
Not sure if this is good code though, not very versed on the whole LSP but it seems innocent enough, feel free to point to any issues about it.
Edit: added a commit that also filters const values and static/creation methods from the base, since those are technically not form the derived and cannot be used (either way vala throws and error, so they still shouldn't be shown).