Skip to content

FCS 11.0.2 - ArgumentOutOfRangeException in GetDeclarationListInfo on completion in the first line #709

@nightroman

Description

@nightroman

I am trying to complete symbols like Micros or Sys. If they are not in the
very first line of a file then I get expected Microsoft or System. But if
they are in the very first line then I get ArgumentOutOfRangeException
It worked fine in 10.0.3 and before.

Here is the exception information

ArgumentOutOfRangeException:
Index and length must refer to a location within the string.
Parameter name: length

System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at Microsoft.FSharp.Compiler.SourceCodeServices.UntypedParseImpl.walker@1108-3.VisitModuleOrNamespace(SynModuleOrNamespace )
   at Microsoft.FSharp.Compiler.SourceCodeServices.AstTraversal.traverseSynModuleOrNamespace@156[T](AstVisitorBase`1 visitor, pos pos, FSharpTypeFunc pick, FSharpList`1 path, SynModuleOrNamespace _arg1)
   at Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo.GetDeclItemsForNamesAtPosition(CompilationThreadToken ctok, FSharpOption`1 parseResultsOpt, FSharpOption`1 origLongIdentOpt, FSharpOption`1 residueOpt, Int32 line, String lineStr, Int32 colAtEndOfNamesAndResidue, TypeNameResolutionFlag filterCtors, ResolveOverloads resolveOverloads, FSharpFunc`2 hasTextChangedSinceLastTypecheck)
   at <StartupCode$FSharp-Compiler-Service>.$Service.GetDeclarations@1174.Invoke(Unit unitVar0)
   at Microsoft.FSharp.Compiler.ErrorScope.Protect[a](range m, FSharpFunc`2 f, FSharpFunc`2 err)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ReraiseIfWatsonable(Exception exn)
   at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.ErrorRecovery(ErrorLogger x, Exception exn, range m)
   at Microsoft.FSharp.Compiler.ErrorScope.Protect[a](range m, FSharpFunc`2 f, FSharpFunc`2 err)
   at <StartupCode$FSharp-Compiler-Service>.$Service.GetDeclarationListInfo@2063.Invoke(CompilationThreadToken ctok, TypeCheckInfo scope)
   at <StartupCode$FSharp-Compiler-Service>.$Reactor.EnqueueAndAwaitOpAsync@146-2.Invoke(CompilationThreadToken ctok)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a](Result`1 res)
   at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout)
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken)
   at FSharpFar.FarEditor.complete()
   at <StartupCode$FSharpFar>.$FarEditor.Invoke@189-5.Invoke(KeyEventArgs e)
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.h@788.Invoke(Object _arg1, TArgs args)
   at FarNet.Editor0.AsProcessEditorInput(ProcessEditorInputInfo* info)
   at ProcessEditorInputW(ProcessEditorInputInfo* info)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions