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

WIP: Implement keyword completion based on the syntax tree’s layout #1014

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahoppen
Copy link
Collaborator

@ahoppen ahoppen commented Oct 24, 2022

Depends on #1013 and #1010.


The idea is that we encode enough information as static members of the Syntax nodes that we can figure out which tokens are valid choices at a particular position. The nice part is that once we have all that information, the actual code completion is really short and about 130 lines. The results look pretty promising to me with a few that are due to our syntax tree layout (like suggesting as or -> at the start of an expression because these are valid tokens in an item to a SequenceExpr and we don’t differentiate the first from the following SequenceExpr items. Maybe this also shows areas where we can improve the syntax tree layout.


This is implemented in SwiftParserDiagnsotics for now, I wanted to move it to IDEUtils once that module is introduced by #999.

@ahoppen ahoppen force-pushed the ahoppen/keyword-completion branch 2 times, most recently from 1651c87 to afa9826 Compare October 26, 2022 13:10
@Emmankoko
Copy link

I want to take this on for gsoc-2024. Are you still open for mentorship?

@ahoppen
Copy link
Collaborator Author

ahoppen commented Feb 23, 2024

Great to hear that you are interested @Emmankoko. To apply for Google Summer of Code, you need to submit a project proposal once the application period opens. @ktoso just wrote a fairly good summary of how the process works on https://forums.swift.org/t/code-completion-for-keywords-project-interest/70217/4

@Emmankoko
Copy link

Great to hear that you are interested @Emmankoko. To apply for Google Summer of Code, you need to submit a project proposal once the application period opens. @ktoso just wrote a fairly good summary of how the process works on https://forums.swift.org/t/code-completion-for-keywords-project-interest/70217/4

I was wondering if you can assist me with a right direction for the project

@ahoppen
Copy link
Collaborator Author

ahoppen commented Feb 23, 2024

Could you open a discussion on forums.swift.org? This discussions seems better suited for the forums than a GitHub PR.

@Emmankoko
Copy link

Could you open a discussion on forums.swift.org? This discussions seems better suited for the forums than a GitHub PR.

opened a simple topic in forum so we can pick it from there

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