René's URL Explorer Experiment


Title: Add completion for keywords by MartinGC94 · Pull Request #21171 · PowerShell/PowerShell · GitHub

Open Graph Title: Add completion for keywords by MartinGC94 · Pull Request #21171 · PowerShell/PowerShell

X Title: Add completion for keywords by MartinGC94 · Pull Request #21171 · PowerShell/PowerShell

Description: PR Summary Adds completion for language keywords like "switch", "break", etc. I originally thought this would take a lot of effort, but I thought of a simple solution of simply trying to insert the various keyword categories into the text and see if they are parsed as keywords, though there are some special cases where I try to properly analyze the Asts. I ended up doing more Ast analysis work than originally planned. It's not perfect, but I think it's good enough for now. Slight breaking change: I've removed the file completion fallback that is used when a user types in characters that don't create a usable AST. For example: )+! this is because it interfered with the keyword completion and its use case seemed questionable. It only worked if there was nothing else in the script text and of course you'd need files with weird characters at the start of their name. PR Context Fixes #10221 Fixes #7891 PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready. Breaking changes None OR Experimental feature(s) needed Experimental feature name(s): User-facing changes Not Applicable OR Documentation needed Issue filed: Testing - New and feature N/A or can only be tested interactively OR Make sure you've added a new test if existing tests do not effectively test the code changed Tooling I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. OR I have considered the user experience from a tooling perspective and opened an issue in the relevant tool repository. This may include: Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host). Issue filed: Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. Issue filed: Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions). Issue filed: Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors). Issue filed:

Open Graph Description: PR Summary Adds completion for language keywords like "switch", "break", etc. I originally thought this would take a lot of effort, but I thought of a simple solution of simply ...

X Description: PR Summary Adds completion for language keywords like "switch", "break", etc. I originally thought this would take a lot of effort, but I thought of a simple sol...

Opengraph URL: https://github.com/PowerShell/PowerShell/pull/21171

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:172c69d4-fe9b-56fa-e341-47674fc0dcc7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id93FC:610AA:1B4AB6:264DC6:6AFDBC14
html-safe-nonceacc988a49d69d2687deb5e19e46e7164fad60886445397bef6cb52438915d4b7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0ZDOjYxMEFBOjFCNEFCNjoyNjREQzY6NkFGREJDMTQiLCJ2aXNpdG9yX2lkIjoiMjQzNjI0OTc5NzM0NzA5NzYyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaceabe16d9f942f1117e47f9f46c93b90776b7590b154f35a7bcb2bbd94793d2ce
hovercard-subject-tagpull_request:1705142658
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/PowerShell/PowerShell/pull/21171/files
twitter:imagehttps://avatars.githubusercontent.com/u/42123497?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/42123497?s=400&v=4
og:image:altPR Summary Adds completion for language keywords like "switch", "break", etc. I originally thought this would take a lot of effort, but I thought of a simple solution of simply ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None8309f07eb60a4237a657068c83d0bb57be4c7e02937f5e9933126f4bd596aac4
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2f7154d847f1ddc5baa83b109a3e1d924605e2a3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/pull/21171/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F21171%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F21171%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/pull/21171/files
Reloadhttps://github.com/PowerShell/PowerShell/pull/21171/files
Reloadhttps://github.com/PowerShell/PowerShell/pull/21171/files
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests366 (366)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPowerShell%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPowerShell%2Fissues%2Fnew%2Fchoose
MartinGC94https://github.com/MartinGC94
PowerShell:masterhttps://github.com/PowerShell/PowerShell/tree/master
MartinGC94:KeywordCompletionshttps://github.com/MartinGC94/PowerShell/tree/KeywordCompletions
Conversation 14 https://github.com/PowerShell/PowerShell/pull/21171
Commits 13 https://github.com/PowerShell/PowerShell/pull/21171/commits
Checks 0 https://github.com/PowerShell/PowerShell/pull/21171/checks
Files changed https://github.com/PowerShell/PowerShell/pull/21171/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/21171/files
Add completion for keywords https://github.com/PowerShell/PowerShell/pull/21171/files#top
Show all changes 13 commits https://github.com/PowerShell/PowerShell/pull/21171/files
caa5434 Add keyword completions MartinGC94 Feb 1, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/caa5434a7ddabd45610b14dc85f72d11c43c9632
4c2eda9 Fix tests MartinGC94 Feb 2, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/4c2eda908b5aa8d7e35d64bc53b9f68f70bd63dc
f9f8a2d Refine some of the completions, add comments and add completion for t… MartinGC94 Feb 2, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/f9f8a2ddf919c5b4bce231274348702a81f87ffb
f3f676d Remove interfering file completion fallback. MartinGC94 Feb 2, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/f3f676d4936ff23a7ff543de900ad139cacd290c
0ecf5c4 Fix missing tooltip for DynamicParam MartinGC94 Feb 2, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/0ecf5c46ddc68356ae8ef8be2bb0655b8a43023c
eac2a85 Update tooltips MartinGC94 Feb 4, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/eac2a856f7ad5b95afcb18b55bcab8645f2832f4
2b40636 Fix various scenarios where completion did not work as expected MartinGC94 Feb 4, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/2b4063642bcba8aa8ff712329b9c37c3a86e3d3b
5a4f955 Add tests MartinGC94 Feb 4, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/5a4f955276f3bb79b3ddb2dadfa08ea91cb400dc
fe317ca Fix usingstatement issue MartinGC94 Feb 4, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/fe317cae0eff4368caa9a053353cb7038bc726a7
39d1205 Remove unused code MartinGC94 Feb 6, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/39d1205c5dd59f752b510ce25f38dec817844194
7e60a33 Rework the Ast analysis to be more robust with and without partial input MartinGC94 Feb 6, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/7e60a3301c0ead835b9b715e2ba9f09656e0c518
9ebc8f9 Merge branch 'PowerShell:master' into KeywordCompletions MartinGC94 Feb 10, 2024 https://github.com/PowerShell/PowerShell/pull/21171/commits/9ebc8f9085e6e076d92ea2839a96d13178e2add1
c839e76 Merge branch 'master' into KeywordCompletions MartinGC94 Mar 29, 2025 https://github.com/PowerShell/PowerShell/pull/21171/commits/c839e76391336666b992180c0fa7cb3eb0e9a0df
Clear filters https://github.com/PowerShell/PowerShell/pull/21171/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/21171/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/21171/files
CommandCompletion.cs https://github.com/PowerShell/PowerShell/pull/21171/files#diff-07606c37aff28d1928efbcb94e2237bc4c09d46052c02b2db3974374415982c3
CompletionAnalysis.cs https://github.com/PowerShell/PowerShell/pull/21171/files#diff-ffbeef87d28b0436caa6723bb6af38f1cb73e6b3368724b9c7fe6c9b40db5f4b
CompletionCompleters.cs https://github.com/PowerShell/PowerShell/pull/21171/files#diff-a9d279ca59037e4fccfc4a0a6f23c87c5555b78dead860918c91168055d57933
TabCompletionStrings.resx https://github.com/PowerShell/PowerShell/pull/21171/files#diff-43289974135096a98834e97e76f1b66b2ca5d37bb6a47a61f5c7d840a09d9eda
TabCompletion.Tests.ps1 https://github.com/PowerShell/PowerShell/pull/21171/files#diff-393e1fa171a673ad5e5c3c1f3700ad03d32d46031ffcf72e4eaac1a7c7c46579
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cshttps://github.com/PowerShell/PowerShell/pull/21171/files#diff-07606c37aff28d1928efbcb94e2237bc4c09d46052c02b2db3974374415982c3
View file https://github.com/PowerShell/PowerShell/blob/c839e76391336666b992180c0fa7cb3eb0e9a0df/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/21171/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/21171/files#diff-07606c37aff28d1928efbcb94e2237bc4c09d46052c02b2db3974374415982c3
https://github.com/PowerShell/PowerShell/pull/21171/files#diff-07606c37aff28d1928efbcb94e2237bc4c09d46052c02b2db3974374415982c3
https://github.com/PowerShell/PowerShell/pull/21171/files#diff-07606c37aff28d1928efbcb94e2237bc4c09d46052c02b2db3974374415982c3
https://github.com/PowerShell/PowerShell/pull/21171/files#diff-07606c37aff28d1928efbcb94e2237bc4c09d46052c02b2db3974374415982c3
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cshttps://github.com/PowerShell/PowerShell/pull/21171/files#diff-ffbeef87d28b0436caa6723bb6af38f1cb73e6b3368724b9c7fe6c9b40db5f4b
View file https://github.com/PowerShell/PowerShell/blob/c839e76391336666b992180c0fa7cb3eb0e9a0df/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/21171/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/21171/files#diff-ffbeef87d28b0436caa6723bb6af38f1cb73e6b3368724b9c7fe6c9b40db5f4b
https://github.com/PowerShell/PowerShell/pull/21171/files#diff-ffbeef87d28b0436caa6723bb6af38f1cb73e6b3368724b9c7fe6c9b40db5f4b
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/21171/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.