Skip to content
Open
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
2 changes: 1 addition & 1 deletion .pipelines/PowerShellEditorServices-OneBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extends:
system: Custom
customVersion: $(package.version)
- task: UseDotNet@2
displayName: Use .NET 8.x SDK
displayName: Use .NET SDK in global.json
inputs:
packageType: sdk
useGlobalJson: true
Expand Down
9 changes: 4 additions & 5 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ if (Get-Command git -ErrorAction SilentlyContinue) {
Task FindDotNet {
Assert (Get-Command dotnet -ErrorAction SilentlyContinue) "dotnet not found, please install it: https://aka.ms/dotnet-cli"

# Strip out semantic version metadata so it can be cast to `Version`
[Version]$existingVersion, $null = (dotnet --version) -split " " -split "-"
Assert ($existingVersion -ge [Version]("8.0")) ".NET SDK 8.0 or higher is required, please update it: https://aka.ms/dotnet-cli"

Write-Build DarkGreen "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)"
[string[]]$dotnetInfo = dotnet --version 2>&1
$missingDotnet = ($dotnetInfo -match '(Install the .+ \.NET SDK) or update')[0]
Assert (!$missingDotnet) ($missingDotnet -replace 'or update.+')
Write-Build DarkGreen "Using dotnet v$($dotnetInfo) at path $((Get-Command dotnet).Source)"
}

Task Clean FindDotNet, {
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.416",
"version": "10.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ internal class ReferencesCodeLensProvider : ICodeLensProvider
/// </summary>
private readonly IDocumentSymbolProvider _symbolProvider;
private readonly SymbolsService _symbolsService;
private readonly WorkspaceService _workspaceService;

public static string Id => nameof(ReferencesCodeLensProvider);

Expand All @@ -38,11 +37,9 @@ internal class ReferencesCodeLensProvider : ICodeLensProvider
/// <summary>
/// Construct a new ReferencesCodeLensProvider for a given EditorSession.
/// </summary>
/// <param name="workspaceService"></param>
/// <param name="symbolsService"></param>
public ReferencesCodeLensProvider(WorkspaceService workspaceService, SymbolsService symbolsService)
public ReferencesCodeLensProvider(SymbolsService symbolsService)
{
_workspaceService = workspaceService;
_symbolsService = symbolsService;
// TODO: Pull this from components
_symbolProvider = new ScriptDocumentSymbolProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ internal interface IPowerShellDebugContext

DebuggerStopEventArgs LastStopEventArgs { get; }

public bool IsDebuggingRemoteRunspace { get; set; }
bool IsDebuggingRemoteRunspace { get; set; }

public event Action<object, DebuggerStopEventArgs> DebuggerStopped;
event Action<object, DebuggerStopEventArgs> DebuggerStopped;

public event Action<object, DebuggerResumingEventArgs> DebuggerResuming;
event Action<object, DebuggerResumingEventArgs> DebuggerResuming;

public event Action<object, BreakpointUpdatedEventArgs> BreakpointUpdated;
event Action<object, BreakpointUpdatedEventArgs> BreakpointUpdated;

void Continue();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ public void SetDebugResuming(DebuggerResumeAction debuggerResumeAction)
// then this came over LSP and we need to set it.
_psesHost.SetExit();

if (LastStopEventArgs is not null)
if (LastStopEventArgs is { } lastStopEventArgs)
{
LastStopEventArgs.ResumeAction = debuggerResumeAction;
lastStopEventArgs.ResumeAction = debuggerResumeAction;
}

// We need to tell whatever is happening right now in the debug prompt to wrap up so we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ internal interface ISynchronousTask

internal abstract class SynchronousTask<TResult> : ISynchronousTask
{
private readonly TaskCompletionSource<TResult> _taskCompletionSource;
private TaskCompletionSource<TResult> _taskCompletionSource { get; }

private readonly CancellationToken _taskRequesterCancellationToken;
private CancellationToken _taskRequesterCancellationToken { get; }

private bool _executionCanceled;
private bool _executionCanceled { get; set; }

private TResult _result;
private TResult _result { get; set; }

private ExceptionDispatchInfo _exceptionInfo;
private ExceptionDispatchInfo _exceptionInfo { get; set; }

protected SynchronousTask(
ILogger logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal sealed class ReferenceTable

private readonly ConcurrentDictionary<string, ConcurrentBag<SymbolReference>> _symbolReferences = new(StringComparer.OrdinalIgnoreCase);

private bool _isInited;
private bool _isInited { get; set; }

public ReferenceTable(ScriptFile parent) => _parent = parent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public SymbolsService(
_codeLensProviders = new ConcurrentDictionary<string, ICodeLensProvider>();
if (configurationService.CurrentSettings.EnableReferencesCodeLens)
{
ReferencesCodeLensProvider referencesProvider = new(_workspaceService, this);
ReferencesCodeLensProvider referencesProvider = new(this);
_ = _codeLensProviders.TryAdd(referencesProvider.ProviderId, referencesProvider);
}

Expand Down Expand Up @@ -495,7 +495,7 @@ void CloseUnopenedFiles()
return;
}

TryRegisterCodeLensProvider(new ReferencesCodeLensProvider(_workspaceService, this));
TryRegisterCodeLensProvider(new ReferencesCodeLensProvider(this));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,7 @@ private void RemovePSEditFunction(IRunspaceInfo runspaceInfo)
}
try
{
if (runspaceInfo.Runspace.Events != null)
{
runspaceInfo.Runspace.Events.ReceivedEvents.PSEventReceived -= HandlePSEventReceivedAsync;
}
runspaceInfo.Runspace.Events.ReceivedEvents.PSEventReceived -= HandlePSEventReceivedAsync;

if (runspaceInfo.Runspace.RunspaceStateInfo.State == RunspaceState.Opened)
{
Expand Down
Loading