mgr32 / psiseprojectexplorer Goto Github PK
View Code? Open in Web Editor NEWPowershell ISE Addon - Project Explorer
License: MIT License
Powershell ISE Addon - Project Explorer
License: MIT License
An unhandled exception occurred in PsISEProjectExplorer:
System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at PsISEProjectExplorer.UI.ViewModel.TreeViewModel.<>c__DisplayClass9.b__5(TreeViewEntryItemModel treeViewChild)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func
2 predicate)
at PsISEProjectExplorer.UI.ViewModel.TreeViewModel.RefreshFromIntermediateNode(INode node, TreeViewEntryItemModel treeViewEntryItem, Boolean expandAllNodes)
at PsISEProjectExplorer.UI.ViewModel.MainViewModel.<>c__DisplayClass10.b__d()
at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at PsISEProjectExplorer.UI.ViewModel.MainViewModel.OnSearchingFinished(Object sender, SearcherResult result)
at PsISEProjectExplorer.UI.ViewModel.IndexingSearchingModel.BackgroundSearcherWorkCompleted(Object sender, RunWorkerCompletedEventArgs e)
at PsISEProjectExplorer.UI.ViewModel.IndexingSearchingModel.RunSearch(BackgroundSearcherParams searcherParams)
at PsISEProjectExplorer.UI.ViewModel.MainViewModel.RunSearch(String path)
at PsISEProjectExplorer.Services.DocumentHierarchyFactory.d__4.MoveNext()
at PsISEProjectExplorer.Services.DocumentHierarchyFactory.UpdateDocumentHierarchy(IEnumerable`1 pathsToUpdate, FilesPatternProvider filesPatternProvider, BackgroundIndexer worker)
at PsISEProjectExplorer.UI.Workers.BackgroundIndexer.RunIndexing(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
--- End of inner exception stack trace ---
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at PsISEProjectExplorer.UI.ViewModel.IndexingSearchingModel.BackgroundIndexerWorkCompleted(Object sender, RunWorkerCompletedEventArgs e)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Currently logging configuration provided by NLog is hardcoded - the configuration should be moved to NLog.config file in module directory to give the user ability to change the logging levels / targets for debugging.
When I try to create a folder inside an existing folder, it will wrongly rename the parent folder instead of create a new child folder:
Steps to reproduce the bug in PSISEProjectExplorer:
I can reproduce it on two devices (Windows 7, Windows 10) with PowerShell 5 and PSISEProjectExplorer version 1.0 (11.10.2015).
When selecting a Folder in the Project Explorer pane, the context menu opens a Windows Explorer window showing the contents of this folder, when selecting a file, it opens the containing folder.
any plans to add git support?
I am interested in helping.
does posh-git help?
basic functionality list:
etc..
When "Show All Files" is turned off PS1XML files should still be shown in the tree view, as they are often part of a PowerShell module.
I loaded the new release (1.2) but got an exception when loading the module:
Exception calling "Add" with "3" argument(s): "Cannot create element because an exception occurred with the
message: Collection was modified; enumeration operation may not execute..
Parameter name: controlType"
At C:\Users\xxx\PSModules\psiseprojectexplorer\PsISEProjectExplorer.psm1:9 char:2
+ $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add($addOnName, [PsISEProjectExp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
I tracked it down to the SanitizeWorkspaceDirectories
function of the WorkspaceDirectoryModel
. I think you need a .ToList()
after the where clause.
Regards,
MindGirl
Which is very inconvenient, as it results in whole directories being misplaced.
Currently incremental search is always quering whole Lucene index - should optimize it to query only appropriate part of the index.
Note that errors in DSC configurations with Import-DSCResource statements will not be displayed due to #39.
Normally when an unhandled exception is thrown from an ISE module or ISE itself, it closes without giving the user possibility to save her work. A global Dispatcher.UnhandledException handler can make ISE stop closing.
Additionally, current handler erroneously says that each caught exception comes from PsISEProjectExplorer, while it also catches all other exceptions. We can try to guess whether it really comes from PsISEProjectExplorer by looking at e.InnerException.Source.
While working on different computers with the Project Explorer two of them work fine, but one showed an exception when loading the addon.
It turns out that the OnIseFilesCollectionChanged
of the IseFileReloader
is triggered also with the Untitled1.ps1 that will be created during ISE startup. On the computer where the exception is thrown, the FullPath of the Untitled1.ps1
has no directory name and the constructor of the FileSystemWatcher throws an exception.
The ISEFile
class has an property IsUntitled
. May be you can exclude untitled files when setting up the file watchers.
Regards, MindGirl
I have a special use case for the PsISEProjectExplorer module:
In my environment, I synchronize the WindowsPowerShell folder with Dropbox over all my computers, by using a symlink from the documents folder into the Dropbox folder. The PsISEProjectExplorer module is stored in this directory too. My problem now, the config file PsISEProjectExplorer.config is synchronized - but the paths for the Workspace directories are different on each computers.
Would be great if we can extend the config file posibilities:
I will provide a pull request, but first I like to ask, maybe some has a better idea?
What do you think about that?
When setting workspace to a root path or shared folder it says 'Cannot use root directory x. Please select another path' and continues to work normally (workspace list not updated).
In regex mode, file contents are matched properly, but file names not (e.g. for expression 'Resolve-Tokens.', file 'Resolve-Tokens.Tests.ps1' is not found).
At one point I changed my workspace to a folder on a remote system.
Now when I import the psiseprojectexplorer module, it crashes with an access denied to that remote folder.
That seems like a defect, but the other question is where does it store that workspace so I can tell it to stop looking there? :)
An unhandled exception occurred in PsISEProjectExplorer:
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.DependencyObject.LookupEntry(Int32 targetIndex)
at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action2 originChangedAction) at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action
2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action2 originChangedAction) at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList
1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, DeferredElementTreeState& oldTreeState)
at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.MouseDevice.Synchronize()
at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextViewHost.b__0(Object param0)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
The installer (per-user) assumes that Documents live in the user'
s profile. This is often not the case.
PsISEProjectExplorer.Config.ConfigHandler.SaveConfigValue|Cannot save config file System.Configuration.ConfigurationErrorsException: The configuration file has been changed by another program. (\WindowsPowerShell\Modules\PsISEProjectExplorer\PsISEProjectExplorer.config)
Following queries should now work as expected:
filename.txt - before dot was treated as word separator
"Import-Module -Name" - not possible before (now treated as phrase)
When you try to save a file that has not been modified then the popup "File has been modified by other program" appears.
The exception occurs in FillFileListRecursively of the DocumentHieraryFactory while trying to enumerate the "c:\users[username]\Documents\My Music" folder. On Windows 8.1 at least this folder is a junction. Maybe you can exclude hidden system directories from the enumeration? The file system attributes for this folder are: Hidden | System | Directory | ReparsePoint.
Regards, MindGirl
The currently implemented display of the script functions in the Project Explorer pane is great. However with some PowerShell modules script authors just defines script blocks to make use of them.
Examples are the unit test modules Pester (https://github.com/pester/Pester), PSate (https://github.com/jonwagner/PSate) or the build automation tool psake (https://github.com/psake/psake).
As it would be tedious to maintain a list of the commands for these modules, could you think of a way to make it extensible by the user or simply showing any function / cmdlet in the tree view that uses a script block?
Best Regards.
MindGirl
This is unintended consequence of #55 released in 1.2.5 - if we don't treat special characters such as bracket as separators, they will make part of Lucene terms, thus making strings like '(Invoke-Command' unsearchable.
Thus 'special characters' part of #55 will be reverted in 1.2.6.
Note because of that if you search for filename.txt
, it will be equivalent to filename txt
- so also strings like 'filename.doc filename2.txt' will be found. If you want to search specifically for words containing special characters, you will have to use regex mode.
List of characters treated as separators:
. , : ( ) [ ] { } \ / ` ' "
I have PS1 files higher up in the directory structure, so it this extension chooses the wrong directory (by default) when determining the workspace root. Modules are, generally, analogous to projects so it seems best to assume a module directory (a directory with a PSD1 or PSM1 file) is a workspace root.
System.Management.Automation.PSParser.Tokenize function is sometimes very slow - probably when parsing DSC configuration which imports a non-installed DSC resource.
I encountered another issue that after a longer period working in the ISE with the Project Explorer loaded, the ISE locks up (Thankfully after saving the file ;-)).
I then started the ISE with the debugger attached and paused it when the ISE locks up.
The debugger stops in OnIseFilePropertyChanged
of the IseFileReloader
when lock
ing the PathsToIgnore
on line 93.
The Threads window showed a different thread waiting in OnIseFileChangedBatch
, locking the same collection.
I have no steps to reproduce the issue, but I hope the Information above helps to fix the issue.
Regards, MindGirl
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.