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

feat: Intellisense displays only the elements related to the current context #386

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

workgroupengineering
Copy link
Contributor

@workgroupengineering workgroupengineering commented Sep 5, 2023

Allow Intellisense displays only the elements related to the current context

Current behavior

Before

Expected behavior

after

After PR AvaloniaUI/Avalonia#13104

after

How does it work

  • CompletionEngine get the parent element of the current element, retrieves its type and assigning it to parentType
  • If parentType has a property marked with Avalonia.Metadata.ContentAttribute, assigned its return type to parentType .
  • Use parentType.ItemsType or parentType to filter candidate types if they are not null

Note
ItemsType is set to the type of the parameter of the first non-static public method named Add obtained by traversing the type hierarchy.

Current issue

  • If an Item Type has xmlns, xmlns is not entered.

Future enhancement

  • Autocompletion of generic properties such as ItemsControl.ItemsPanel
  • Autocompletion of ItemsControl derived objects with the correct ItemsType, eg ListBox must propose ListBoxItes and its derivatives.

Depends on PR #383 , AvaloniaUI/Avalonia#13104

@workgroupengineering workgroupengineering marked this pull request as ready for review September 7, 2023 13:42
@prashantvc prashantvc self-requested a review October 3, 2023 07:24
@workgroupengineering workgroupengineering marked this pull request as draft October 5, 2023 08:44
@workgroupengineering workgroupengineering marked this pull request as ready for review October 19, 2023 13:54
@workgroupengineering workgroupengineering force-pushed the features/Intellisense/Type-Affinity branch 3 times, most recently from 6859c7d to 8ba08c1 Compare October 31, 2023 15:15
# Conflicts:
#	tests/CompletionEngineTests/Models.cs
# Conflicts:
#	CompletionEngine/Avalonia.Ide.CompletionEngine/AssemblyMetadata/Metadata.cs
#	CompletionEngine/Avalonia.Ide.CompletionEngine/AssemblyMetadata/MetadataConverter.cs
#	CompletionEngine/Avalonia.Ide.CompletionEngine/Completion/CompletionEngine.cs
# Conflicts:
#	tests/CompletionEngineTests/AdvancedTests.cs
@workgroupengineering workgroupengineering force-pushed the features/Intellisense/Type-Affinity branch from d80a464 to 0195139 Compare April 16, 2024 09:57
@workgroupengineering workgroupengineering force-pushed the features/Intellisense/Type-Affinity branch from 0195139 to 3a8d6f4 Compare April 16, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants