PowerShell / PowerShell/PowerShellEditorServices

Make InsertText wait for changes

Open
#463 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Extension Terminal Issue-Bug
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

Currently if you are making a lot of changes to the same file you need to either use Start-Sleep after each call or watch FileContext for the changes to show. Otherwise it won't be inserted in the correct position.

This can be demonstrated by running:

# These characters will be inserted in a random order.
'abcdefg'.ToCharArray() | % { $psEditor.GetEditorContext().CurrentFile.InsertText($_) }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CurrentFile.InsertText entry point and reproduce the issue using the PowerShell pipeline shown in the body. The issue names no source file or test; done means repeated inserts into one file complete in the intended order without Start-Sleep or watching FileContext.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.