Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Have `expandAlias` emit `TextEdit`s like the rename handler instead of a custom request

Offen
#2,315 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
csharp, powershell
Bereich
api, tooling

Rechercherichtung

Beginne mit ExpandAliasHandler, RenameService und ScriptExtentAdapter und ziehe #2312 und #2108 als Kontext heran. Verfolge anschließend die bestehende powerShell/expandAlias-Anfrage und die Plumbing-Struktur des vscode-powershell-Clients und vergleiche dann die TextEdit-Ausgabe des Rename-Handlers. Als abgeschlossen gilt die Aufgabe, wenn die Alias-Erweiterung Edits für Command-Name-Extents ausgibt und der Client-Vertrag aktualisiert oder die benutzerdefinierte Anfrage als veraltet markiert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Area-Language Server Issue-Enhancement

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.

  • ExpandAliasHandler resolves aliases, then returns a single wholesale-rewritten string over the custom powerShell/expandAlias JSON-RPC request.
  • RenameService walks AST extents and returns TextEdit[] over standard textDocument/rename, using ScriptExtentAdapter to 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 (reusing ScriptExtentAdapter) 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/expandAlias request + 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).

Vorherrschende Sprache
C#
Sterne
767
Forks
266
Ø Merge
3 T. 16 Std.
Gemergte PRs (30 T.)
1

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PowerShell/PowerShellEditorServices

Alle Issues in PowerShell/PowerShellEditorServices

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.