Have `expandAlias` emit `TextEdit`s like the rename handler instead of a custom request
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Commencez par ExpandAliasHandler, RenameService et ScriptExtentAdapter, en utilisant #2312 et #2108 comme contexte. Suivez ensuite le câblage existant de la requête powerShell/expandAlias et du client vscode-powershell, puis comparez la sortie TextEdit du gestionnaire de renommage. C’est terminé lorsque l’expansion d’alias émet des edits pour les command-name extents et que le contrat client est mis à jour ou que la requête personnalisée est dépréciée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Follow-on from @JustinGrote's review on #2312: https://github.com/PowerShell/PowerShellEditorServices/pull/2312#pullrequestreview-4521187389
Yeah looks fine to me. As a follow-on issue we should probably update the rename handler to use this same code path if it isn't already.
The rename handler (RenameService) is already on the modern path — it uses System.Management.Automation.Language.Parser.ParseInput plus AST visitors and never used the legacy PsParser, so there's nothing to migrate there. #2312 brought ExpandAliasHandler onto the same modern parser.
The remaining divergence is in output shape, and the reusable direction is the reverse of "rename adopts expand-alias": expand-alias should adopt rename's edit model.
ExpandAliasHandlerresolves aliases, then returns a single wholesale-rewritten string over the custompowerShell/expandAliasJSON-RPC request.RenameServicewalks AST extents and returnsTextEdit[]over standardtextDocument/rename, usingScriptExtentAdapterto map PowerShell 1-based extents to LSP 0-based ranges.
This is also what #2108 itself anticipated: "return a proper edit (potentially deprecating the need for an entirely separate custom request)."
Proposed work:
- Rework alias expansion to emit
TextEdits (reusingScriptExtentAdapter) covering each command-name token's extent, instead of returning a rewritten document. - Investigate folding it into a standard LSP surface (e.g. a code action) and deprecating the custom
powerShell/expandAliasrequest + its client plumbing in vscode-powershell.
Note this changes the client contract, so it needs coordination with the extension — which is why #2312 was scoped to just the parser swap.
Drafted by Copilot (Claude Opus 4.8).
- Langage dominant
- C#
- Étoiles
- 767
- Forks
- 266
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 1
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Ouverte
PowerShell/PowerShellEditorServices#2331 · 1 réaction · 2 personnes assignées ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 réaction · 2 personnes assignées ·
-
Issue-Bug Needs: Triage
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
PowerShell/PowerShellEditorServices#2293 · 1 commentaire ·
-
PowerShell/PowerShellEditorServices#2282 · 1 commentaire · 1 réaction · 2 personnes assignées ·
-
Issue-Bug Needs: Triage
PowerShell/PowerShellEditorServices#2278 · 1 réaction · 2 personnes assignées ·
Toutes les issues de PowerShell/PowerShellEditorServices
Issues similaires
-
area-ai untriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
dotnet/extensions#7783 ·
-
untriaged
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
Difficulté 2/5 Une demi-journée Accessibilité débutants 86/100
-
type/automation type/tech-debt
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
newrelic/newrelic-dotnet-agent#3850 · 1 commentaire ·