PowerShell / PowerShell/PowerShellEditorServices
Consider caching Alias & Command information
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 767
- Forks
- 266
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 1
Description
On every textDocument/references request and every textDocument/codeLens request, we rely on the pipeline to get the current available.
This is time consuming and bottlenecked by the pipeline thread. As such, we should consider caching this result based on the state of the Integrated Console.
Coming off the the back of #980, one of the patterns I liked was the ability to tell if something was run in the PSIC using PSRL’s ENTER handler and F8’s handler.
Bringing this concept in, we can use it as a “Dirty” check where we cache aliases and command info results, and only refresh the cache when the PSIC is Dirty.
That way, for example, our textDocument/references request and textDocument/codeLens request only rely on the pipeline once the cache is Dirty and an otherwise run unblocked giving us a perf improvement.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/PowerShellEditorServices/Language/LanguageService.cs around the linked lookup at line 327, then review the Integrated Console behavior described in #980, including PSRL's ENTER handler and F8's handler. Define how alias and command information becomes cached and invalidated when the PSIC is dirty; done means references and codeLens requests use the pipeline only when the cache needs refreshing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100