PowerShell / PowerShell/PowerShellEditorServices

ArgumentOutOfRangeException in ValidatePosition

Ouverte
#870 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Area-Workspaces Issue-Bug
Langage dominant
C#
Étoiles
767
Forks
266
Merge moyen
3 j 16 h
PR mergées (30 j)
1

Description

Still getting this exception in 1.11.0 version of the extension in v1.31.1 of VSCode.

2019-02-23 22:10:41.702 [VERBOSE] tid:17 in 'ResolveFilePath' C:\PowerShellEditorServices\src\PowerShellEditorServices\Workspace\Workspace.cs: line 466
    Resolved path: c:\Users\Keith\GitHub\dahlbyk\posh-git\src\GitUtils.ps1

2019-02-23 22:10:41.888 [ERROR] tid:43 in 'OnListenTaskCompleted' C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs: line 391
    ProtocolEndpoint message loop terminated due to unhandled exception:
    
    System.AggregateException: One or more errors occurred. (Specified argument was out of the range of valid values.
    Parameter name: Position 569:64 is outside of the line range of 1 to 497.) ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 569:64 is outside of the line range of 1 to 497.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, EventContext eventContext)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.DispatchMessage(Message messageToDispatch, MessageWriter messageWriter)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.ListenForMessages(CancellationToken cancellationToken)
       at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
       --- End of inner exception stack trace ---
    ---> (Inner Exception #0) System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: Position 569:64 is outside of the line range of 1 to 497.
       at Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition(Int32 line, Int32 column)
       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, EventContext eventContext)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.DispatchMessage(Message messageToDispatch, MessageWriter messageWriter)
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.ListenForMessages(CancellationToken cancellationToken)
       at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

vscode-powershell.zip

This happened when I was pasting some text in the middle of the file.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par Microsoft.PowerShell.EditorServices.ScriptFile.ValidatePosition et ApplyChange, puis suivez l’appel depuis LanguageServer.HandleDidChangeTextDocumentNotification. Reproduisez l’opération de collage signalée dans VSCode à l’aide des Logs et de l’archive fournis ; le travail est considéré comme terminé lorsque la modification n’arrête plus la boucle de messages du protocole avec une ArgumentOutOfRangeException.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp, powershell, vscode
Domaine
tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
32/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.