Add &! operator for ThreadJob background execution#146
Add &! operator for ThreadJob background execution#146
Conversation
f08aff3 to
c8e3707
Compare
|
@copilot please fix these two errors when attempting to run & |
Fixed both compilation errors in commit 4622a3f:
The build should now succeed. |
|
@copilot this error still showed please try fixing |
Fixed in commit 34779ec by moving the |
34779ec to
37b239e
Compare
- Added new TokenKind.AmpersandExclaim for &! operator - Updated tokenizer to recognize &! operator - Added BackgroundThreadJob property to PipelineAst - Updated parser to handle &! operator for ThreadJobs - Modified MiscOps to use Start-ThreadJob when BackgroundThreadJob is true - Updated all token enum values to accommodate new token Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
…use compound assignment - Moved BackgroundThreadJob property from PipelineAst to ChainableAst base class to make it accessible to both PipelineAst and PipelineChainAst - Updated PipelineChainAst.Copy() to preserve BackgroundThreadJob property - Fixed IDE0074 warning by using ??= compound assignment operator - Fixes CS1061 error where PipelineBaseAst didn't have BackgroundThreadJob property Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
- Moved BackgroundThreadJob from ChainableAst to PipelineBaseAst - This ensures the property is accessible when the parameter type is PipelineBaseAst - Fixes CS1061 compilation error where PipelineBaseAst didn't have BackgroundThreadJob Co-authored-by: kilasuit <6355225+kilasuit@users.noreply.github.com>
37b239e to
6445c34
Compare
Implementation Complete - ThreadJob Background Operator
This PR implements a new background operator
&!that creates ThreadJobs instead of regular background jobs, addressing issue PowerShell#21376.✅ Implementation Status
&!📝 Changes Made
Token System
TokenKind.AmpersandExclaim(value 29) for the&!operatorTokenFlags.SpecialOperator | TokenFlags.ParseModeInvariantTokenizer
tokenizer.cscase for&character to check for following!&!is encountered&and&&Parser
TokenKind.AmpersandExclaimin pipeline chain parsingBackground = trueandBackgroundThreadJob = trueon PipelineAst&! && ...and&! || ...combinations)AST (Abstract Syntax Tree)
BackgroundThreadJobproperty toPipelineBaseAstbase classinternal setto match design ofBackgroundpropertyPipelineAst.Copy()andPipelineChainAst.Copy()to preserve BackgroundThreadJob propertyfalsefor backward compatibilityRuntime
MiscOps.csbackground job creation logicpipelineAst.BackgroundThreadJobproperty (now accessible via PipelineBaseAst)Start-ThreadJobcmdlet when trueCommandNotFoundException,InvalidOperationExceptionStart-JobifStart-ThreadJobunavailable or lookup fails$using:prefix)??=) for cleaner codeTests
ThreadJobBackgroundOperator.Tests.ps1&!tokenizes as AmpersandExclaim🎯 Design Rationale
&operator pattern with one additional property&continues to work unchanged🔒 Security Considerations
📚 Usage Example
🧪 Testing Notes
📖 Related Issues
&!Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.