Open RegreTTO opened 9 months ago
@RegreTTO please make sure you have all the latest versions of the extension and Avalonia. If the issue persistets file a minimum repo.
Note: that the extension has its own repo where issues should be reported.
@RegreTTO This is fixed in the version v0.0.30, could you confirm that you have latest version of the extension?
@prashantvc Yes. I've checked the version right now and it is exactly v0.0.30
@timunie It was the first time I installed all avalonia-related plugins, so they are exactly last version
11.0.6 is outdated. 11.0.9 is recent.
I installed it as said in the docs with dotnet new install Avalonia.Templates
. I took version from my .csproj
file.
The templates were maybe not updated yet. They are not always in sync with latest minor version, so please try to update your nugets 🙏
@timunie Hello! How can I update my nugets? I tried
dotnet new install Avalonia.Templates::11.0.9
I got
Warning: Avalonia.Templates::11.0.9 is not found in NuGet feeds https://api.nuget.org/v3/index.json. Avalonia.Templates::11.0.9 could not be installed, the package does not exist.
I also searched for the Avalonia.Templates and found that the latest version is 11.0.6. https://www.nuget.org/packages?q=Avalonia.Templates
I tried to update the package versions by manually changing the versions in .csproj file, and rebuild the project. However, the problem persists.
I changed the extension to v0.0.29, and the problem has been resolved.
Thanks, I'll try downgrading later
@calee88 Indeed, downgrading fixes this problem
Or not. After rebooting it started to infinitely ask me to build project, but nothing changes. It asks, I build, it asks again and so on
@RegreTTO please upload a minimum sample for us to reproduce.
@timunie There is no need me to upload such. It is just dotnet new avalonia.mvvm
, nothing more
I'm having the same issue 😓
Interesting, if I downgrade the extension to the v0.0.29
it works 🤔
Edit: yeah, now I see that this was already proposed, then confirmed.
I can confirm. Just follow Avalonia docs to reproduce this error. Avalonia.Templates::11.0.6 is the newest version available.
Might be related to this OmniSharp issue #2525 or #2550
2024-03-05 15:52:27.694 [info] [Trace - 15:52:27] Sending request 'textDocument/completion - (1)'.
2024-03-05 15:52:27.729 [info] [Trace - 15:52:27] Received notification 'window/logMessage'.
2024-03-05 15:52:27.729 [info] [Error - 15:52:27] OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request textDocument/completion 1 - System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 8
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-05 15:52:27.736 [info] [Trace - 15:52:27] Received response 'textDocument/completion - (1)' in 41ms. Request failed: Internal Error - System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 8
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-05 15:52:27.736 [info] [Error - 15:52:27] Request textDocument/completion failed.
2024-03-05 15:52:27.736 [info] Message: Internal Error - System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 8
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
I have the same problem, even after updating all the Avalonia packages in my project to 11.0.9 and with extension v0.0.31.
I'm running VS Code on Windows but connected to WSL.
However, the same happens for a project opened from the Windows filesystem.
@doxxx the WSL support is untested. Let me check this one windows
I changed the extension to v0.0.29, and the problem has been resolved.
Same issue here. Installed the latest versions of Avalonia.Templates
which is 11.0.11
at the time of writing and the Avalonia VS Code Extension in version 0.0.31
. Downgraded to 0.0.29
resolved the issue.
I am working on Pop!OS Linux by System76. VS Code is installed via flatpak.
Steps to reproduce:
0.0.31
in my case, or 0.0.30
as stated in the comments above)Avalonia.Templates
dotnet new avalonia.mvvm
MainWindow.axaml
file<
somewhere in the document2024-05-18 14:33:05.639 [info] [Trace - 2:33:05 PM] Sending notification 'textDocument/didChange'.
2024-05-18 14:33:05.639 [info] [Trace - 2:33:05 PM] Sending request 'textDocument/completion - (1)'.
2024-05-18 14:33:05.674 [info] [Trace - 2:33:05 PM] Received notification 'window/logMessage'.
2024-05-18 14:33:05.674 [info] [Error - 2:33:05 PM] OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request textDocument/completion 1 - System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 8
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-05-18 14:33:05.679 [info] [Trace - 2:33:05 PM] Received response 'textDocument/completion - (1)' in 40ms. Request failed: Internal Error - System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 8
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-05-18 14:33:05.680 [info] [Error - 2:33:05 PM] Request textDocument/completion failed.
2024-05-18 14:33:05.680 [info] Message: Internal Error - System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AvaloniaLanguageServer.Services.Buffer.GetTextTillLine(Position position) in /Users/prashantvc/Avalonia/src/AvaloniaLSP/AvaloniaLanguageServer/Services/Buffer.cs:line 8
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
If this helps anyone, 0.0.31
had issues. Downgrading to 0.0.29
resolved the issue.
Can confirm that the issue is fixed in latest commits. But you have to build the latest AvaloniaLSP manually.
Describe the bug
After triggering autocomplete it doesn't work and throws errors in "Avalonia Client" log section in VScode
To Reproduce
Steps to reproduce the behavior:
dotnet new install Avalonia.Templates
Expected behavior
I get autocompletion
Environment
Additional context
Error itself