-
Notifications
You must be signed in to change notification settings - Fork 234
Add position function set to Commands #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add position function set to Commands #496
Conversation
This change adds a custom implementation of IScriptExtent similar to InternalScriptExtent. The major difference being the replacement of PositionHelper with FileContext. The PositionHelper class was used to store the full script text and line start mapping for all ScriptExtent objects of the same file. FileContext is a great replacement for this because it's already kept unique by PSES and it adapts to changes. - Added FullScriptExtent and FullScriptPosition classes. - Changed the scriptFile field on FileContext from private to internal.
This class will be used by Import-EditorCommand to target commands for registration as editor commands.
This changes adds commands from PSESHelperLibrary that assist with locating and manipulating text based on the syntax tree or position. - Changed functions to be compatible with PowerShell 3. - Adapted functions to use FullScriptExtent objects for position instead of using reflection to create InternalScriptExtents
- Add standard function loading process. - Add functions to export list in manifest. - Update manifest with a unique guid. - Add localized data file loading.
This change adds markdown help for all added functions. It also adds a step in the build process to create the MAML XML file.
- Fix an issue with parameter set resolution in ConvertTo-ScriptExtent. - Fix importing editor commands from a module that is in the middle of being imported. - Add parameter validation to FullScriptExtent constructors.
- Added online link to markdown help. - Converted comment based help of Register-EditorCommand and UnregisterEditorCommand to markdown. - Fixed psedit not being exported. - Added cleanup of generated MAML file to build script.
@SeeminglyScience, |
Awesome! Thanks a lot for sending this, I'll give it a full review later. Looks like AppVeyor needs to have PlatyPS installed, you can add the Install-Module line for that to appveyor.yml. |
Looks like the Travis init script also needs to be updated, sorry I forgot to mention that! https://github.com/PowerShell/PowerShellEditorServices/blob/master/scripts/travis.ps1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really excellent work, man. It is definitely the foundation of the new scripting interface for the PSES C# API changes I'm making!
@@ -15,7 +15,7 @@ RootModule = 'PowerShellEditorServices.Commands.psm1' | |||
ModuleVersion = '1.0.0' | |||
|
|||
# ID used to uniquely identify this module | |||
GUID = '9ca15887-53a2-479a-9cda-48d26bcb6c47' | |||
GUID = '6064d846-0fa0-4b6d-afc1-11e5bed3c4a9' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I realized I screwed that up after I merged the PR ;)
This provides a set of functions to assist with finding and manipulating positions in script files. This also includes the
Import-EditorCommand
which will register any function from a module that has theEditorCommandAttribute
attached to it.This is the full list of added commands: