mhutch / MonoDevelop.MSBuildEditor

Improved MSBuild editing support
Other
215 stars 26 forks source link

UsingTask is improperly validated for inline tasks #173

Closed dansiegel closed 5 months ago

dansiegel commented 5 months ago

With a very simple inline task as shown below the intellisense shows an error for the ParameterGroup, Task, Using's, and Code elements.

<UsingTask TaskName="ReplaceFileText" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
    <ParameterGroup>
        <Filename ParameterType="System.String" Required="true" />
        <MatchExpression ParameterType="System.String" Required="true" />
        <ReplacementText ParameterType="System.String" Required="true" />
    </ParameterGroup>
    <Task>
        <Using Namespace="System" />
        <Using Namespace="System.IO" />
        <Using Namespace="System.Text.RegularExpressions" />
        <Code Type="Fragment" Language="cs">
            <![CDATA[
                File.WriteAllText(
                    Filename,
                    Regex.Replace(File.ReadAllText(Filename), MatchExpression, ReplacementText)
                    );
            ]]>
        </Code>
    </Task>
</UsingTask>