-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Feature Request: include language keywords in command completion results #10221
Comments
Might want to clarify your issue title; it seems the request is for But yep, agreed, not sure why we don't include keywords. |
Thanks, @vexx32, sometimes I speak better computer than English. :) |
Yes, here in the tokenizer. Copying it in:
Would that be beneficial? If you autocomplete |
That's because Interestingly I see the operators are already included in completions, and they have tooltips. Any data kept on whether these keywords are available, or better, available in a given context? I would think that reserved keywords should probably not have completions offered, so that a user doesn't have as much clutter to sort through, and keywords that are not available in the current context should not be offered. I suppose that last part is what has kept keyword completion from being implemented so far. |
@SeeminglyScience is there any reason we don't auto-complete language keywords currently? |
Aside from complexity and demand not that I know of. It's not exactly as simple as it first seems since you have to add logic for only returning a keyword completion result when it's actually applicable and that branch of code doesn't exist yet. That's pretty minor, but still |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
2 similar comments
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. |
Summary of the new feature/enhancement
Include language keywords, such as 'continue', 'switch', 'foreach', etc... in with the command completions offered by intellisense/tab completion.
Proposed technical implementation details (optional)
I don't yet know if its possible to restrict the keywords when the insertion point is not the first command in a pipeline, but there is already 1 case in the completion logic that has decided that
foreach
should not have an ampersand&
(invoke) operator inserted before it (its actually in the completions because its an alias forForEach-Object
) because its more likely what the user wanted, but none of the other keywords get this treatment. Including the keywords would actually eliminate this special case.I am sure somewhere there is a complete list of keywords in the code, I'm just not sure if there is anything to use as a tooltip text readily available.
I may experiment on this while working the other bugs out of the completion code.
The text was updated successfully, but these errors were encountered: