dotnet / dotnet/vscode-csharp

Offer generate constructor in more places

Open
#7,682 4 comments 0 reactions 0 assignees View on GitHub
Bug Triaged
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

Type: Bug

## Issue Description ##
There used to be a quick action on structs and classes to automatically generate a constructor injecting all defined fields. I don't recall exactly since which version, but I can't find that option anymore since the past month or so.

## Steps to Reproduce ##
Open quick actions menu on a class or a struct with defined fields and no constructor.

## Expected Behavior ##
A `Generate Constructor 'ClassName( field1, field2, ... )'` should be available.

## Actual Behavior ##
On classes, only `Generate Constructor ClassName()` is available, and on structs no option to generate any kind of constructor is available.

## Logs ##
Nothing out of ordinary happens, no errors or warnings are reported. It's as if this feature was totally removed.

## Environment information ##

**VSCode version**: 1.90.2
**C# Extension**: 2.50.27
**Using OmniSharp**: false

Dotnet Information
.NET SDK:
Version: 8.0.403
Commit: c64aa40a71
Workload version: 8.0.400-manifests.e99c892e
MSBuild version: 17.11.9+a69bbaaf5

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.403\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 8.0.10
Architecture: x64
Commit: 81cabf2857

.NET SDKs installed:
8.0.403 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions

|Extension|Author|Version|Folder Name|
|---|---|---|---|
|csharp|ms-dotnettools|2.50.27|ms-dotnettools.csharp-2.50.27-win32-x64|
|git-graph|mhutchie|1.30.0|mhutchie.git-graph-1.30.0|
|material-product-icons|PKief|1.7.1|pkief.material-product-icons-1.7.1|
|nugetpackagemanagergui|aliasadidev|2.1.1|aliasadidev.nugetpackagemanagergui-2.1.1|
|remote-explorer|ms-vscode|0.4.3|ms-vscode.remote-explorer-0.4.3|
|remote-ssh|ms-vscode-remote|0.113.1|ms-vscode-remote.remote-ssh-0.113.1|
|remote-ssh-edit|ms-vscode-remote|0.87.0|ms-vscode-remote.remote-ssh-edit-0.87.0|
|vsc-material-theme-icons|equinusocio|3.8.8|equinusocio.vsc-material-theme-icons-3.8.8|
|vscode-dotnet-runtime|ms-dotnettools|2.2.0|ms-dotnettools.vscode-dotnet-runtime-2.2.0|
|vscode-open|sandcastle|0.3.0|sandcastle.vscode-open-0.3.0|
|vscode-todo-plus|fabiospampinato|4.19.1|fabiospampinato.vscode-todo-plus-4.19.1|
|vscord|LeonardSSH|5.2.13|leonardssh.vscord-5.2.13|;

Extension version: 2.50.27
VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:34:26.404Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)|
|GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|31.88GB (22.09GB free)|
|Process Argv|--crash-reporter-id 4994e761-2f9a-48c0-9071-98dd85d0b400|
|Screen Reader|no|
|VM|0%|

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.