-
Notifications
You must be signed in to change notification settings - Fork 16
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
VScode Avalonia XAML autocompletion doesn't work #110
Comments
@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 |
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! 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. I also searched for the Avalonia.Templates and found that the latest version is 11.0.6. |
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 |
I'm having the same issue 😓 |
Interesting, if I downgrade the extension to the 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
|
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 |
Same issue here. Installed the latest versions of I am working on Pop!OS Linux by System76. VS Code is installed via flatpak. Steps to reproduce:
2024-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 |
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
The text was updated successfully, but these errors were encountered: