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

Previewing source generated file stops the source generator from applying changes #7855

Open
mrgleba opened this issue Dec 6, 2024 · 0 comments

Comments

@mrgleba
Copy link

mrgleba commented Dec 6, 2024

Type: Bug

Issue Description

When working with source generators (any will do - the included
Regex or Json as well) the extension quickly picks up changes and reacts accordingly.
But as soon as the resulting souce generated file is previewed the subsequent changes are not recognised.

Steps to Reproduce

    public class WeatherForecast
    {
        public DateTime Date { get; set; }
    }

    [JsonSourceGenerationOptions(WriteIndented = true)]
    [JsonSerializable(typeof(WeatherForecast))]
    internal partial class SourceGenerationContext : JsonSerializerContext
    {
    }    

You can change the property name "Date" and the extensions applies the changes and shows "3 references" above the property.

When you navigate to the source generated file and then try to change the property name the change is not recognised (0 references is shown)

Expected Behavior

Actual Behavior

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires the `C#` output window log level to be set to `Trace`

Environment information

VSCode version: 1.95.3
C# Extension: 2.55.29
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 9.0.100 Commit: 59db016f11 Workload version: 9.0.100-manifests.3068a692 MSBuild version: 17.12.7+5b8665660

Runtime Environment:
OS Name: ubuntu
OS Version: 24.10
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/9.0.100/

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

Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4

.NET SDKs installed:
8.0.404 [/usr/share/dotnet/sdk]
9.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/usr/share/dotnet]

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
copilot GitHub 1.246.0 github.copilot-1.246.0
copilot-chat GitHub 0.22.4 github.copilot-chat-0.22.4
csharp ms-dotnettools 2.55.29 ms-dotnettools.csharp-2.55.29-linux-x64
gitlens eamodio 16.0.4 eamodio.gitlens-16.0.4
hexeditor ms-vscode 1.11.1 ms-vscode.hexeditor-1.11.1
vscode-dotnet-runtime ms-dotnettools 2.2.3 ms-dotnettools.vscode-dotnet-runtime-2.2.3
vscode-language-pack-pl MS-CEINTL 1.95.2024103009 ms-ceintl.vscode-language-pack-pl-1.95.2024103009
vscode-pull-request-github GitHub 0.100.3 github.vscode-pull-request-github-0.100.3

Extension version: 2.55.29
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.14.0-284.30.1.el9_2.x86_64

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz (8 x 3096)
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
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.82GB (6.44GB free)
Process Argv --folder-uri vscode-remote://ssh-remote%2B7b22686f73744e616d65223a2235312e37352e33362e3331222c2275736572223a226d7a6965222c22706f7274223a323032337d/home/mzie/Weles3 --crash-reporter-id 16d60f3a-8ad4-4d6d-8252-d56b783c217f
Screen Reader no
VM 0%
Item Value
Remote SSH: 51.75.36.31:2023
OS Linux x64 5.14.0-284.30.1.el9_2.x86_64
CPUs AMD EPYC 7413 24-Core Processor (48 x 1917)
Memory (System) 125.74GB (94.48GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant