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 #113

Open
evilbaschdi opened this issue Feb 16, 2024 · 12 comments
Open

request textDocument/completion failed #113

evilbaschdi opened this issue Feb 16, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@evilbaschdi
Copy link

Describe the bug

"Avalonia for VSCode" immediately crashes when I begin to type inside the MainWindows.axaml file.
Also the preview windows is not shown (including the button). But I'm not sure if that's related to that issue.

To Reproduce

checkout https://github.com/evilbaschdi/VmMachineHwVersionUpdater and open the whole solution in vs code.
I than tried to add some element in line 147

Avalonia for VS Code

0.0.31

Avalonia version

11.0.9

VS Code version

1.86.2

Relevant log output

2024-02-16 07:09:24.417 [info] [Trace - 7:09:24 AM] Sending notification 'textDocument/didChange'.
2024-02-16 07:09:24.423 [info] [Trace - 7:09:24 AM] Sending request 'textDocument/completion - (3)'.
2024-02-16 07:09:24.482 [info] [Trace - 7:09:24 AM] Received notification 'window/logMessage'.
2024-02-16 07:09:24.483 [info] [Error - 7:09:24 AM] OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request textDocument/completion 3 - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length')
   at System.Range.ThrowArgumentOutOfRangeException()
   at System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray[T](T[] array, Range range)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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() | Method='textDocument/completion' RequestId='3'
2024-02-16 07:09:24.486 [info] [Trace - 7:09:24 AM] Received response 'textDocument/completion - (3)' in 63ms. Request failed: Internal Error - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length')
   at System.Range.ThrowArgumentOutOfRangeException()
   at System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray[T](T[] array, Range range)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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).
2024-02-16 07:09:24.489 [info] [Error - 7:09:24 AM] Request textDocument/completion failed.
2024-02-16 07:09:24.489 [info]   Message: Internal Error - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length')
   at System.Range.ThrowArgumentOutOfRangeException()
   at System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray[T](T[] array, Range range)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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()
  Code: -32603

Additional context

No response

@evilbaschdi evilbaschdi added the bug Something isn't working label Feb 16, 2024
@calee88
Copy link

calee88 commented Feb 17, 2024

#110 I guess this is the same issue.

@LeadManPL
Copy link

@evilbaschdi please double check your Avalonia version, I see that 11.0.6 is highest available

Also, I believe this is duplicate of #110

@evilbaschdi
Copy link
Author

Are we talking about the last supported version when we talk about 11.0.6? Than I will understand that some things might not work.
Otherwise the latest version available on nuget.org is indeed 11.0.9.

@darinkes
Copy link

I see the same issue. Restarting doesn't help. Always prints errors on each keystroke.

Avalonia Version:

  <ItemGroup>
    <PackageReference Include="Avalonia" Version="11.0.10" />
    <PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
    <PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
    <PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" />
    <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
    <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
    <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.10" />
  </ItemGroup>

VSCode Version: 1.87.2 (user setup)

Log:

2024-03-16 14:18:34.382 [info] Creating language service
2024-03-16 14:18:35.154 [info] Starting Avalonia Language Server...
2024-03-16 14:18:35.194 [info] [Trace - 2:18:35 PM] Sending request 'initialize - (0)'.
2024-03-16 14:18:38.011 [info] [Trace - 2:18:38 PM] Received response 'initialize - (0)' in 2816ms.
2024-03-16 14:18:38.011 [info] [Trace - 2:18:38 PM] Sending notification 'initialized'.
2024-03-16 14:18:38.012 [info] [Trace - 2:18:38 PM] Sending notification 'workspace/didChangeConfiguration'.
2024-03-16 14:18:38.082 [info] [Trace - 2:18:38 PM] Received request 'client/registerCapability - (1)'.
2024-03-16 14:18:38.083 [info] [Trace - 2:18:38 PM] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
2024-03-16 14:18:38.083 [info] [Trace - 2:18:38 PM] Sending notification 'textDocument/didOpen'.
2024-03-16 14:18:38.089 [info] [Trace - 2:18:38 PM] Received request 'workspace/configuration - (2)'.
2024-03-16 14:18:38.090 [info] [Trace - 2:18:38 PM] Sending response 'workspace/configuration - (2)'. Processing request took 0ms
2024-03-16 14:18:38.144 [info] [Trace - 2:18:38 PM] Received request 'workspace/configuration - (3)'.
2024-03-16 14:18:38.144 [info] [Trace - 2:18:38 PM] Sending response 'workspace/configuration - (3)'. Processing request took 1ms
2024-03-16 14:18:38.159 [info] [Trace - 2:18:38 PM] Received request 'workspace/configuration - (4)'.
2024-03-16 14:18:38.159 [info] [Trace - 2:18:38 PM] Sending response 'workspace/configuration - (4)'. Processing request took 0ms
2024-03-16 14:18:38.208 [info] [Trace - 2:18:38 PM] Received notification 'window/logMessage'.
2024-03-16 14:18:38.209 [info] [Info  - 2:18:38 PM] AvaloniaLanguageServer.Handlers.TextDocumentSyncHandler: ** DidOpenText: file:///c:/Users/user/Desktop/project/Views/MainWindow.axaml | Uri='file:///c:/Users/user/Desktop/project/Views/MainWindow.axaml'
2024-03-16 14:18:39.945 [info] [Trace - 2:18:39 PM] Sending notification 'textDocument/didChange'.
2024-03-16 14:18:39.962 [info] [Trace - 2:18:39 PM] Sending request 'textDocument/completion - (1)'.
2024-03-16 14:18:40.062 [info] [Trace - 2:18:40 PM] Received notification 'window/logMessage'.
2024-03-16 14:18:40.062 [info] [Error - 2:18:40 PM] OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request textDocument/completion 1 - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')
   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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() | Method='textDocument/completion' RequestId='1'
2024-03-16 14:18:40.067 [info] [Trace - 2:18:40 PM] Received response 'textDocument/completion - (1)' in 104ms. Request failed: Internal Error - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')
   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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).
2024-03-16 14:18:40.067 [info] [Error - 2:18:40 PM] Request textDocument/completion failed.
2024-03-16 14:18:40.067 [info]   Message: Internal Error - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')
   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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()
  Code: -32603 
2024-03-16 14:18:40.788 [info] [Trace - 2:18:40 PM] Sending notification 'textDocument/didChange'.
2024-03-16 14:18:41.406 [info] [Trace - 2:18:41 PM] Sending notification 'textDocument/didSave'.
2024-03-16 14:18:41.409 [info] [Trace - 2:18:41 PM] Received notification 'window/logMessage'.
2024-03-16 14:18:41.409 [info] [Info  - 2:18:41 PM] AvaloniaLanguageServer.Handlers.TextDocumentSyncHandler: DidSaveTextDocumentParams OmniSharp.Extensions.LanguageServer.Protocol.Models.DidSaveTextDocumentParams | Request='OmniSharp.Extensions.LanguageServer.Protocol.Models.DidSaveTextDocumentParams'
2024-03-16 14:18:41.745 [info] [Trace - 2:18:41 PM] Sending notification 'workspace/didChangeWatchedFiles'.

Any hints about the reason? Couldn't figure it out by myself with the mentioned issues.

@Number0ne
Copy link

image

I have the same issue, it's very disturbing when I want to code. I can't type anything without this popping up. It's there every two minutes.

@s1masy
Copy link

s1masy commented Apr 20, 2024

Same issue

@nicu-dev
Copy link

same issue

@Number0ne
Copy link

Number0ne commented Apr 23, 2024

T

image

I have the same issue, it's very disturbing when I want to code. I can't type anything without this popping up. It's there every two minutes.

To fix this I had to roll back to a previous version of the extension (0.0.28) now the issue is fixed. I'll wait for a while before I upgrade to the latest one.

@austrowGC
Copy link

this issue stopped occurring for me after rolling back extension version to 0.0.28

@byte2pixel
Copy link

byte2pixel commented May 6, 2024

Same issue here, trying to learn to use Avalonia based on some recommendations, but auto completion doesn't work in the axaml files. Just constant errors every keystroke:

vscode: 1.88.1
C# DevKit: 1.4.29
C#: 2.23.15
Avalonia Extension: v0.0.31

Output from Avalonia Client:

Request textDocument/completion failed.
2024-05-05 20:59:44.893 [info]   Message: Internal Error - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')
   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 9
   at AvaloniaLanguageServer.Services.BufferService.GetTextTillPosition(DocumentUri key, Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/BufferService.cs:line 22
   at AvaloniaLanguageServer.Handlers.CompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Handlers/CompletionHandler.cs:line 29
   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()
  Code: -32603 

Edit:

To fix this is had to roll back to a previous version of the extension (0.0.28)

I also rolled back to v0.0.29 and do not get the errors, and auto complete seems to work.

@aneeskA
Copy link

aneeskA commented Jul 5, 2024

If this helps anyone, 0.0.31 had issues. Downgrading to 0.0.29 resolved the issue.

image image

@HermitCat64
Copy link

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests