project-system icon indicating copy to clipboard operation
project-system copied to clipboard

JavaScript Included as Additional File loses Intellisense

Open TorreyGarland opened this issue 3 years ago • 3 comments

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

TorreyGarland avatar Aug 23 '22 06:08 TorreyGarland

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

adamint avatar Sep 01 '22 18:09 adamint

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 avatar Sep 01 '22 22:09 TorreyGarland

Is anyone looking into this?

TorreyGarland avatar Sep 11 '22 00:09 TorreyGarland

@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!

kvenkatrajan avatar Sep 30 '22 00:09 kvenkatrajan