Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ internal static int Start(string bannerText, string helpText)
throw hostException;
}

if (s_theConsoleHost.LoadPSReadline())
if (LoadPSReadline())
{
ProfileOptimization.StartProfile("StartupProfileData-Interactive");

Expand Down Expand Up @@ -1156,6 +1156,10 @@ internal ConsoleHost()
AppDomain.CurrentDomain.UnhandledException += handler;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Performance",
"CA1822:Mark members as static",
Justification = "Accesses instance members in preprocessor branch.")]
private void BindBreakHandler()
{
#if UNIX
Expand Down Expand Up @@ -1598,7 +1602,7 @@ private bool IsScreenReaderActive()
return _screenReaderActive.Value;
}

private bool LoadPSReadline()
private static bool LoadPSReadline()
{
// Don't load PSReadline if:
// * we don't think the process will be interactive, e.g. -command or -file
Expand Down Expand Up @@ -1706,7 +1710,7 @@ private void DoCreateRunspace(string initialCommand, bool skipProfiles, bool sta
DoRunspaceInitialization(skipProfiles, initialCommand, configurationName, initialCommandArgs);
}

private void OpenConsoleRunspace(Runspace runspace, bool staMode)
private static void OpenConsoleRunspace(Runspace runspace, bool staMode)
{
if (staMode && Platform.IsWindowsDesktop)
{
Expand Down Expand Up @@ -2726,7 +2730,7 @@ private DebuggerCommandResults ProcessDebugCommand(string cmd, out Exception e)
return results ?? new DebuggerCommandResults(DebuggerResumeAction.Continue, false);
}

private bool IsIncompleteParseException(Exception e)
private static bool IsIncompleteParseException(Exception e)
{
// Check e's type.
if (e is IncompleteParseException)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public override
/// Helper method to create and trace PipelineStoppedException.
/// </summary>
/// <returns></returns>
private PipelineStoppedException NewPipelineStoppedException()
private static PipelineStoppedException NewPipelineStoppedException()
{
PipelineStoppedException e = new PipelineStoppedException();
return e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ private void WriteToConsole(ConsoleColor foregroundColor, ConsoleColor backgroun
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ConsoleOutWriteHelper(ReadOnlySpan<char> value, bool newLine)
private static void ConsoleOutWriteHelper(ReadOnlySpan<char> value, bool newLine)
{
if (newLine)
{
Expand Down Expand Up @@ -1847,7 +1847,7 @@ private char GetCharacterUnderCursor(Coordinates cursorPosition)
/// </summary>
/// <param name="input">The string to process.</param>
/// <returns>The string with any \0 characters removed...</returns>
private string RemoveNulls(string input)
private static string RemoveNulls(string input)
{
if (input.Contains('\0'))
{
Expand Down Expand Up @@ -2042,7 +2042,7 @@ internal string ReadLineWithTabCompletion(Executor exec)
}

#if !UNIX
private void SendLeftArrows(int length)
private static void SendLeftArrows(int length)
{
var inputs = new ConsoleControl.INPUT[length * 2];
for (int i = 0; i < length; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ internal Collection<PSObject> ExecuteCommand(string command, out Exception excep
return ExecuteCommandHelper(tempPipeline, out exceptionThrown, options);
}

private Command GetOutDefaultCommand(bool endOfStatement)
private static Command GetOutDefaultCommand(bool endOfStatement)
{
return new Command(command: "Out-Default",
isScript: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ internal override
private int _oldestSoFar;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Performance",
"CA1822:Mark members as static",
Justification = "Accesses instance members in preprocessor branch.")]
private
ProgressNode
FindOldestLeafmostNodeHelper(ArrayList treeToSearch, out ArrayList listWhereFound, out int indexWhereFound)
Expand Down