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

Request textDocument/completion failed in IDE #5357

Open
keyboardDrummer opened this issue Apr 24, 2024 · 0 comments
Open

Request textDocument/completion failed in IDE #5357

keyboardDrummer opened this issue Apr 24, 2024 · 0 comments
Assignees
Labels
during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) priority: next Will consider working on this after in progress work is done

Comments

@keyboardDrummer
Copy link
Member

type Path
const HeaderPath: Path
const FooterPath: Path
const input: Input
const largeResult: seq<CryptoItem>

class CryptoItem {
  var key: Path
}

class Input {
  var encryptedStructure: seq<CryptoItem>
}

function SeqFilter<T>(f: T -> bool, xs: seq<T>): seq<T // <-- exception occurs when typing T here

method Foo() {
  var HeaderPaths : seq<Path> := [HeaderPath, FooterPath];

  assert forall k <- input.encryptedStructure :: (exists x :: x in largeResult && x.key == k.key);
  var smallResult := SeqFilter((x : CryptoItem) => x.key !in HeaderPaths, largeResult);
  assert !exists x :: x in smallResult && x.key == HeaderPath;
  assert !exists x :: x in smallResult && x.key == FooterPath;

  assert forall k <- input.encryptedStructure | k.key !in HeaderPaths ::
          (exists x :: x in smallResult && x.key == k.key);
}
[Trace - 5:48:10 PM] Received response 'textDocument/completion - (1166)' in 4ms. Request failed: Internal Error - System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, Uri uri, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, Uri uri, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, Uri uri, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, Uri uri, DafnyPosition position, LList`1 parent, Func`2 predicate)
   at Microsoft.Dafny.NodeExtensions.FindNode[T](INode root, Uri uri, DafnyPosition position)
   at Microsoft.Dafny.LanguageServer.Handlers.DafnyCompletionHandler.CompletionProcessor.IsDotExpression()
   at Microsoft.Dafny.LanguageServer.Handlers.DafnyCompletionHandler.CompletionProcessor.Process()
   at Microsoft.Dafny.LanguageServer.Handlers.DafnyCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken)
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|7_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
   at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass10_0.<<RouteRequest>b__5>d.MoveNext() (-32603).
[Error - 5:48:10 PM] Request textDocument/completion failed.
  Message: Internal Error - System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Dafny.NodeExtensions.FindNodeChain(INode node, DafnyPosition position, LList`1 parent, Func`2 predicate)
@keyboardDrummer keyboardDrummer added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) priority: next Will consider working on this after in progress work is done during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program labels Apr 24, 2024
@keyboardDrummer keyboardDrummer self-assigned this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) priority: next Will consider working on this after in progress work is done
Projects
None yet
Development

No branches or pull requests

1 participant