Skip to content

Commit 59debeb

Browse files
SeeminglySciencedaviwil
authored andcommitted
Fix module loading process
- Add standard function loading process. - Add functions to export list in manifest. - Update manifest with a unique guid. - Add localized data file loading.
1 parent de5542f commit 59debeb

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RootModule = 'PowerShellEditorServices.Commands.psm1'
1515
ModuleVersion = '1.0.0'
1616

1717
# ID used to uniquely identify this module
18-
GUID = '9ca15887-53a2-479a-9cda-48d26bcb6c47'
18+
GUID = '6064d846-0fa0-4b6d-afc1-11e5bed3c4a9'
1919

2020
# Author of this module
2121
Author = 'Microsoft'
@@ -66,7 +66,15 @@ Description = 'Provides internal commands for PowerShell Editor Services that on
6666
# NestedModules = @()
6767

6868
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
69-
FunctionsToExport = @('Register-EditorCommand', 'Unregister-EditorCommand')
69+
FunctionsToExport = @('Register-EditorCommand',
70+
'Unregister-EditorCommand',
71+
'Set-ScriptExtent',
72+
'Find-Ast',
73+
'Import-EditorCommand',
74+
'ConvertFrom-ScriptExtent',
75+
'ConvertTo-ScriptExtent',
76+
'Get-Token',
77+
'Join-ScriptExtent')
7078

7179
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7280
CmdletsToExport = @()
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Import-LocalizedData -BindingVariable Strings -FileName Strings
12

2-
# TODO: Use a better script loading process here
3-
. $PSScriptRoot\Public\CmdletInterface.ps1
3+
Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
4+
. $PSItem.FullName
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ConvertFrom-StringData @'
2+
EditorCommandExists=Editor command '{0}' already exists, skipping.
3+
EditorCommandImporting=Importing editor command '{0}'.
4+
MissingEditorContext=Unable to obtain editor context. Make sure PowerShell Editor Services is running and then try the command again.
5+
'@

0 commit comments

Comments
 (0)