| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Very exciting changes, glad to see this finally happening 🙂
Still going over it, but here's some initial feedback.
Sorry, something went wrong.
| /// <summary> | ||
| /// Configuration for editor services startup. | ||
| /// </summary> | ||
| public class EditorServicesConfig |
There was a problem hiding this comment.
Consider:
| public class EditorServicesConfig | |
| public sealed class EditorServicesConfig |
Sorry, something went wrong.
| /// <summary> | ||
| /// Configuration for Editor Services' PowerShell profile paths. | ||
| /// </summary> | ||
| public class ProfilePathConfig |
There was a problem hiding this comment.
Consider:
| public class ProfilePathConfig | |
| public sealed class ProfilePathConfig |
Sorry, something went wrong.
| using System.Reflection; | ||
| using System.Threading.Tasks; | ||
| using System.Collections.Generic; | ||
| using SMA = System.Management.Automation; |
There was a problem hiding this comment.
I typically like to have aliases in a separate group separated by line. Might just be me though, totally optional.
Sorry, something went wrong.
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="NETStandard.Library" Version="2.0.3" /> |
There was a problem hiding this comment.
What's this do when targeting specific frameworks?
Sorry, something went wrong.
There was a problem hiding this comment.
So this should mean we get netstandard.dll for net461 (and nothing in .NET Core). Basically it's the binding trampoline from netstandard to the concrete runtime.
One thing I've noticed though is that in Core it will keep trying to find netstandard.dll. That hasn't lead to any crashes, but I wonder if it signifies that we're doing something wrong. As far as I know, .NET Core 2.0+ has netstandard.dll baked in, so there's no physical DLL to find.
Sorry, something went wrong.
| protected override void BeginProcessing() | ||
| { | ||
| #if DEBUG | ||
| if (WaitForDebugger) |
There was a problem hiding this comment.
Oh? Neat! I had no idea C# would account for implicit bool conversions in an if statement. Makes me wonder what the point of op_True is (or rather helps me realize why no one uses it 🙂).
Sorry, something went wrong.
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
…nner.cs Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
|
Issues
======
+ Solved 6
- Added 19
Complexity increasing per file
==============================
- src/PowerShellEditorServices.Hosting/Internal/NamedPipeUtils.cs 7
- src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs 7
- src/PowerShellEditorServices/Hosting/EditorServicesServerFactory.cs 2
- src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs 6
- src/PowerShellEditorServices/Hosting/HostStartupInfo.cs 6
- src/PowerShellEditorServices/Server/PsesDebugServer.cs 1
- src/PowerShellEditorServices/Logging/HostLoggerAdapter.cs 1
- src/PowerShellEditorServices.Hosting/Configuration/HostLogger.cs 6
- src/PowerShellEditorServices.Hosting/Configuration/EditorServicesConfig.cs 1
- src/PowerShellEditorServices.Hosting/Configuration/HostInfo.cs 1
- src/PowerShellEditorServices.Hosting/Configuration/TransportConfig.cs 2
- src/PowerShellEditorServices.Hosting/Internal/EditorServicesRunner.cs 7
- src/PowerShellEditorServices/Hosting/EditorServicesLoading.cs 1
- src/PowerShellEditorServices.Hosting/Configuration/SessionFileWriter.cs 7
- src/PowerShellEditorServices.Hosting/Internal/PsesLoadContext.cs 3
See the complete overview on Codacy |
Sorry, something went wrong.
| /// <summary> | ||
| /// Configuration for Editor Services' PowerShell profile paths. | ||
| /// </summary> | ||
| public struct ProfilePathConfig |
There was a problem hiding this comment.
Sorry, something went wrong.
| .Wait(); | ||
| if (!s_hasRunPsrlStaticCtor && _usePSReadLine) | ||
| { | ||
| s_hasRunPsrlStaticCtor = true; |
There was a problem hiding this comment.
Sorry, something went wrong.
| LogOperatingSystemDetails(); | ||
| } | ||
|
|
||
| private string GetPSOutputEncoding() |
There was a problem hiding this comment.
Issue found: Make 'GetPSOutputEncoding' a static method.
Sorry, something went wrong.
| debugServer.StartAsync(); | ||
| } | ||
|
|
||
| private Task RestartDebugServerAsync(PsesDebugServer debugServer, bool usePSReadLine) |
There was a problem hiding this comment.
Sorry, something went wrong.
| } | ||
|
|
||
| // Unlike in .NET Core, we need to be look for all dependencies in .NET Framework, not just PSES.dll | ||
| AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs args) => |
There was a problem hiding this comment.
Issue found: Remove the type specification; it is redundant.
Sorry, something went wrong.
| /// <summary> | ||
| /// Configuration for the debug adapter protocol transport to use. | ||
| /// </summary> | ||
| public ITransportConfig DebugServiceTransport { get; set; } = null; |
There was a problem hiding this comment.
Sorry, something went wrong.
| /// <summary> | ||
| /// Configuration for the language server protocol transport to use. | ||
| /// </summary> | ||
| public ITransportConfig LanguageServiceTransport { get; set; } = null; |
There was a problem hiding this comment.
Sorry, something went wrong.
|
|
||
| public string SessionFileTransportName => "Stdio"; | ||
|
|
||
| public IReadOnlyDictionary<string, object> SessionFileEntries { get; } = null; |
There was a problem hiding this comment.
Sorry, something went wrong.
|
|
||
| if (hostConfig.LogLevel == PsesLogLevel.Diagnostic) | ||
| { | ||
| AppDomain.CurrentDomain.AssemblyLoad += (object sender, AssemblyLoadEventArgs args) => |
There was a problem hiding this comment.
Issue found: Remove the type specification; it is redundant.
Sorry, something went wrong.
| public void OnNext((PsesLogLevel logLevel, string message) value) | ||
| { | ||
| string message = null; | ||
| switch (value.logLevel) |
There was a problem hiding this comment.
Issue found: Add a 'default' clause to this 'switch' statement.
Sorry, something went wrong.
| .AddArgument(s_commandsModulePath); | ||
|
|
||
| return this.ExecuteCommandAsync<PSObject>(importCommand, false, false); | ||
| return this.ExecuteCommandAsync<PSObject>(importCommand, sendOutputToHost: false, sendErrorToHost: false); |
There was a problem hiding this comment.
Sorry, something went wrong.
| case PsesLogLevel.Error: | ||
| message = $"[ERR]: {value.message}"; | ||
| break; | ||
| }; |
There was a problem hiding this comment.
Issue found: Remove this empty statement.
Sorry, something went wrong.
| _unsubscriber.Dispose(); | ||
| _fileWriter.Flush(); | ||
| _fileWriter.Close(); | ||
| _fileWriter.Dispose(); |
There was a problem hiding this comment.
Sorry, something went wrong.
| /// <summary> | ||
| /// Names of or paths to any additional modules to load on startup. | ||
| /// </summary> | ||
| public IReadOnlyList<string> AdditionalModules { get; set; } = null; |
There was a problem hiding this comment.
Sorry, something went wrong.
| "); | ||
| } | ||
|
|
||
| private string GetOSArchitecture() |
There was a problem hiding this comment.
Issue found: Make 'GetOSArchitecture' a static method.
Sorry, something went wrong.
| } | ||
| } | ||
| catch (TaskCanceledException) | ||
| { |
There was a problem hiding this comment.
Issue found: Either remove or fill this block of code.
Sorry, something went wrong.
| // This is not high priority, since the PSES process shouldn't be reused | ||
| } | ||
|
|
||
| private void LoadEditorServices() |
There was a problem hiding this comment.
Issue found: Make 'LoadEditorServices' a static method.
Sorry, something went wrong.
| internal class PsesDebugServer : IDisposable | ||
| { | ||
| protected readonly ILoggerFactory _loggerFactory; | ||
| private static bool s_hasRunPsrlStaticCtor = false; |
There was a problem hiding this comment.
Sorry, something went wrong.
| /// <summary> | ||
| /// Flags of features to enable on startup. | ||
| /// </summary> | ||
| public IReadOnlyList<string> FeatureFlags { get; set; } = null; |
There was a problem hiding this comment.
Sorry, something went wrong.
|
Patrick Meinecke (@SeeminglyScience) do you wanna rereview? |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes PowerShell/vscode-powershell#2292.
Summary