dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

JavaScript Included as Additional File loses Intellisense #8415

Closed TorreyGarland closed 2 years ago

TorreyGarland commented 2 years ago

Visual Studio Version

17.3.1

Summary

I created a source/incremental generator to parse javascript files.
In order to do so, an entry like this one has to go into the .csproj file like so:

<ItemGroup>
    <AdditionalFiles Include="file2.js" />
</ItemGroup>

this disables all intellisense when editing the javascript file. CTRL+K+D no longer formats the document.

It isn't the source generator.

Steps to Reproduce

  1. Add an <AdditionalFiles Include="File2.js" /> to an item group in the csproj file.
  2. Try to edit the javascript file (type this),
    var a = document.getElementById('a1');

Expected Behavior

minimal intellisense after typing anything after "document.".

Actual Behavior

No Intellisense whatsoever.

User Impact

Wasting gawd knows how much time searching for a solution at developercommunity.visualstudio.com

adamint commented 2 years ago

@TorreyGarland why do you need to mark the javascript file as an AdditionalFile at all? Why can it not just be a source file?

TorreyGarland commented 2 years ago

I am building a source generator to generate C# code based on the static file urls, similar to how T4MVC/R4MVC used to work.

I have the following in my CS Proj file to "interrogate" everything in a Blazor wwwroot folder.

<ItemGroup>
    <AdditionalFiles Include="$(ProjectDir)/wwwroot/**/*" />
</ItemGroup>

Intellisense for CSS/SCSS files do not appear to be affected.

What is it about additional files that causes the intellisense to flake out.

TorreyGarland commented 2 years ago

Is anyone looking into this?

kvenkatrajan commented 2 years ago

@TorreyGarland - We reviewed this ticket and it appears that this would need to be redirected to another internal team for diagnosis. Please send diagnostic information via "Report a problem". Refer to instructions at: https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio This would send diagnostic information in addition to the details of the problem ticket. Once done please paste the ticket link here so we can make sure it gets routed correctly internally.

We appreciate your patience!