-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug 🐞
When generating the code for a [ReactiveCommand], the generator puts global:: for everyting, except ReactiveUI.ReactiveCommand<,>. I discovered this when i tried to use it on a project where ReactiveUI was a part of the namespace, the compiler got confused, and stated it couldn't find ReactiveCommand<,> at MyCompany.ReactiveUI, when the namespace was MyCompany.ReactiveUI.App.Core.
public partial class MainViewModel
{
private ReactiveUI.ReactiveCommand<global::System.Reactive.Unit, global::ReactiveUI.IRoutableViewModel>? _goToSmileCommand;
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "2.5.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public ReactiveUI.ReactiveCommand<global::System.Reactive.Unit, global::ReactiveUI.IRoutableViewModel> GoToSmileCommand { get => _goToSmileCommand ??= ReactiveUI.ReactiveCommand.CreateFromObservable<global::System.Reactive.Unit, global::ReactiveUI.IRoutableViewModel>(GoToSmile); }
}Step to reproduce
- Create an
ReactiveObjectclass, with partial and everything - Make a ReactiveCommand like this one:
[ReactiveCommand]
private IObservable<IRoutableViewModel> GoToSmile(Unit _) =>
Router.Navigate.Execute(new SmileViewModel());- Write
GoToSmileCommandin the constructor and useF12to observe the generated output - See error
Reproduction repository
No response
Expected behavior
This should happen...
public partial class MainViewModel
{
private global::ReactiveUI.ReactiveCommand<global::System.Reactive.Unit, global::ReactiveUI.IRoutableViewModel>? _goToSmileCommand;
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "2.5.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public global::ReactiveUI.ReactiveCommand<global::System.Reactive.Unit, global::ReactiveUI.IRoutableViewModel> GoToSmileCommand { get => _goToSmileCommand ??= ReactiveUI.ReactiveCommand.CreateFromObservable<global::System.Reactive.Unit, global::ReactiveUI.IRoutableViewModel>(GoToSmile); }
}Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows
Version
Windows 11 Pro
Device
No response
ReactiveUI Version
22.3.1
Additional information ℹ️
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working