Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nightroman opened this issue Feb 23, 2017 · 3 comments

Comments

@nightroman
Copy link
Contributor

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>[email protected](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>[email protected](CompilationThreadToken ctok, TypeCheckInfo scope)
   at <StartupCode$FSharp-Compiler-Service>[email protected](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>[email protected](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)
@dsyme
Copy link
Contributor

dsyme commented Feb 23, 2017

@nightroman Thanks. Should be fixed by #710 unless I'm mistaken. Please check the code, I have not added a unit test for this. It will depend what value you pass for lineStr in this case.

@dsyme
Copy link
Contributor

dsyme commented Feb 23, 2017

11.0.4 pushed to nuget with this fix. Please let me know if it doesn't fix things

@dsyme dsyme closed this as completed Feb 23, 2017
@nightroman
Copy link
Contributor Author

All my tests have passed and all known recent issues are resolved. Thank you!

dsyme added a commit to dsyme/FSharp.Compiler.Service that referenced this issue Apr 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants