You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to get access to things like the currently opened file's path, file's root directory, project's root directory and things like that.
An example usage might be to create an Editor Command that creates a Pester Test for the currently opened file and places it in the appropriate Tests directory for that Project.
A user might have projects with different locations of their Tests. It would be beneficial to have a config file. One could eventually be provided by Editor services, but if you have access to the Project root, you could have your own config file where you gather settings such as Pester Test directory, psake script, psdeploy script, or anything like that.
So your scripts could just get the ProjectRoot and then access their own config file for Settings. So two different projects could have different structure or layouts, but you could still create editor commands that is aware of their project differences.
An Example:
Project: A
Returns 'ProjectRoot\Tests' for Tests Directory
Project: B
Returns 'ProjectRoot' for Tests Directory
The text was updated successfully, but these errors were encountered:
daviwil
changed the title
Extend $PSEditor to give access to additional environment information and a way to store configurations.
Provide current workspace path in $psEditor.Workspace
May 18, 2016
You can get the path of the currently opened file from $psEditor.CurrentFile.Path. We should definitely add something to get the workspace path from the $psEditor.Workspace object though. I could also provide a WorkspacePath property on FileContext which would give you the file's path relative to the workspace path. Anything else you could probably get using System.IO.Path's methods.
This change adds a new Path property to the EditorWorkspace class which
gets exposed through to the psEditor API. This is useful for extension
authors who want to perform operations based on the workspace path.
Resolves#236.
It would be nice to be able to get access to things like the currently opened file's path, file's root directory, project's root directory and things like that.
An example usage might be to create an Editor Command that creates a Pester Test for the currently opened file and places it in the appropriate Tests directory for that Project.
A user might have projects with different locations of their Tests. It would be beneficial to have a config file. One could eventually be provided by Editor services, but if you have access to the Project root, you could have your own config file where you gather settings such as Pester Test directory, psake script, psdeploy script, or anything like that.
So your scripts could just get the ProjectRoot and then access their own config file for Settings. So two different projects could have different structure or layouts, but you could still create editor commands that is aware of their project differences.
An Example:
Project: A
Returns 'ProjectRoot\Tests' for Tests Directory
Project: B
Returns 'ProjectRoot' for Tests Directory
The text was updated successfully, but these errors were encountered: