Skip to content

Critical failure during autocompletion #14

@hecflores

Description

@hecflores

I did the following then pressed tab, now it does no auto filling which requires me to restart the vscode host:

image

And received the following output:

Scheduling command for main runspace: $Commands = Get-Command '$' -ErrorAction SilentlyContinue; if ($Commands) { try { [System.Management.Automation.ProxyCommand]::Create((New-Object System.Management.Automation.CommandMetaData $Commands)) } catch { } } else { '' } 

Scheduling command for main runspace: $Commands = Get-Command '[]' -ErrorAction SilentlyContinue; if ($Commands) { try { [System.Management.Automation.ProxyCommand]::Create((New-Object System.Management.Automation.CommandMetaData $Commands)) } catch { } } else { '' } 

Exception in server: System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
   at System.String.Substring(Int32 startIndex, Int32 length)
   at PowerShellProTools.Host.Refactoring.IntroduceUsing.Refactor(TextEditorState state, Ast ast, IEnumerable`1 properties)+MoveNext() in D:\a\1\s\PowerShellProTools.Host\Refactoring\IntroduceUsing.cs:line 29
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
   at PowerShellToolsPro.PoshToolsServer.Start(String pipeName) in D:\a\1\s\PowerShellProTools.Host\PoshToolsServer.cs:line 110

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions