razor icon indicating copy to clipboard operation
razor copied to clipboard

c# devkit pops up several "request textdocument/definition failed."

Open rrelyea opened this issue 2 years ago • 2 comments

Version Used: C# dev kit 1.2.7

Steps to Reproduce:

  1. clone https://github.com/bogle-tools/site
  2. open in vscode with C# dev kit 1.2.7 installed (appears to be latest update published) - but this has been happening for months
  3. edit some c# files and razor files...and eventually you'll see a bunch of 'request textdocument/definition failed." message popups image

click on "go to output:" and this is in output window: [Error - 8:52:54 AM] [LanguageServerHost] System.ArgumentOutOfRangeException: The requested line number 3485 must be less than the number of lines 2210. (Parameter 'Line') at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position) in //src/Compilers/Core/Portable/Text/TextLineCollection.cs:line 67 at Microsoft.CodeAnalysis.LanguageServer.Extensions.GetPositionFromLinePositionAsync(TextDocument document, LinePosition linePosition, CancellationToken cancellationToken) in //src/Features/LanguageServer/Protocol/Extensions/Extensions.cs:line 173 at Microsoft.CodeAnalysis.LanguageServer.Handler.AbstractGoToDefinitionHandler.GetDefinitionAsync(TextDocumentPositionParams request, Boolean typeOnly, RequestContext context, CancellationToken cancellationToken) in //src/Features/LanguageServer/Protocol/Handler/Definitions/AbstractGoToDefinitionHandler.cs:line 141 at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in //src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 189

Expected Behavior: Less useless prompts

Actual Behavior: 3-4 useless prompts often when working on my project.

rrelyea avatar Jan 20 '24 17:01 rrelyea

@davidwengier is it possible the file is being regenerated, but the lsp messages are not getting ordered properly wrt to them?

CyrusNajmabadi avatar Jan 20 '24 17:01 CyrusNajmabadi

I have the same issue

pepelax avatar Jun 21 '24 05:06 pepelax

This should be resolved with v2.39.28 (pre-release). Please let me know if you continue to experience problems.

ryzngard avatar Jul 17 '24 20:07 ryzngard

I dont see this version in VSCode plugin versions https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit

Sri-Fibonacci avatar Aug 13 '24 15:08 Sri-Fibonacci

It's in the C# extension https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp

ryzngard avatar Aug 13 '24 18:08 ryzngard