Ionide-vscode-fsharp: Ionide removes properties from .fsproj

Created on 18 Dec 2017  路  7Comments  路  Source: ionide/ionide-vscode-fsharp

Problem

Ionide seems to remove project propeties from .fsproj file

Steps to reproduce

  1. Install VS code
  2. Install ionide
  3. Create new netcore F# app, e.g. dotnet new console -o test -lang F#
  4. Open folder with .fsproj file in VS code
  5. Manually insert attribute into .fsproj file e.g. <ServerGarbageCollection>true</ServerGarbageCollection>
  6. Add new file via F# project explorer
  7. Watch <ServerGarbageCollection> attribute dissapear from .fsproj
bug forge up for grabs

Most helpful comment

Should be fixed with 5.0

All 7 comments

I can repro.

It replace it also if the file was saved (not just dirty).

same bug for add file above and add file below commands

Forge tries to model the project files really strictly and probably just doesn't know about ServerGarbageCollection property. Should be an easy fix.

I also saw this with Zebra with it removing some attribute (a different one) that tries to automatically read files based on globs rather than explicit list.

Same issue occurs with values in <PropertyGroup>.

Original fsproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <RootNamespace>fs_playground</RootNamespace>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <FscToolPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp</FscToolPath>
    <FscToolExe>fsc.exe</FscToolExe>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Types.fs" />
    <Compile Include="Program.fs" />
  </ItemGroup>
  <Import Project=".paket\Paket.Restore.targets" />
</Project>

After moving Types.fs with the down arrow in the UI

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <RootNamespace>fs_playground</RootNamespace>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Program.fs" />
    <Compile Include="Types.fs" />
  </ItemGroup>
  <Import Project=".paket\Paket.Restore.targets" />
</Project>

@weebs 馃憤 This also happens to me with the <ProjectId> tag inside <PropertyGroup>
After reordering files the tag is removed.

Add <LangVersion>...</LangVersion> to the list of tags which are getting stripped out.

Should be fixed with 5.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sergey-tihon picture sergey-tihon  路  6Comments

MikaelUmaN picture MikaelUmaN  路  5Comments

landy picture landy  路  5Comments

dustinmoris picture dustinmoris  路  3Comments

yuhr picture yuhr  路  3Comments