Skip to content

Syntax-coloring is not applied or removed when changing Build Action from None to Compile and vv #3503

Description

@abelbraaksma

Since out-of-project files are no longer colored (inverse to this issue #1977 may have you believe), there now appears to be a small issue with that: it doesn't work when the project has dirty state, it only works if you compile.

screengrapbuildactionnone

Repro steps

Basically:

  1. Open any project *.fs file
  2. Change the Build Action to None
  3. Result: no effect

You can try to close/reopen the file, but still no effect.

The inverse is also true: change from None to Compile will not color the file.

Expected behavior

Since this change was applied (#1977, possibly it's VS2017, not just Visual F#), this expected behavior is different now: it should remove the coloring, or inverse, it should add the coloring back.

Actual behavior

Syntax coloring, or removing of coloring is not applied.

Known workarounds

Recompile the project.

Related information

F# 4.0 and F# 4.1 with VS2017 15.3.1.0. Also observed in recent nightlies.

A small issue, I know, but I thought to better have it reported in case somebody is working on something in this area.

Activity

  1. changed the title [-]Removing or readding of syntax-coloring is not applied on dirty projects, only after save-compile.[/-] [+]Syntax-coloring is not applied or removed when changing Build Action from None to Compile and vv[/+] on Aug 25, 2017
  2. added
    Impact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.
    on Aug 29, 2017
  3. abelbraaksma commented on Mar 28, 2018

    @abelbraaksma
    ContributorAuthor

    Just checked with latest builds, but this still happens. Rebuild is still necessary. Seen in Visual Studio 15.6.

  4. added this to the 16.0 milestone on Aug 29, 2018
  5. modified the milestones: 16.0, 16.1 on Feb 21, 2019
  6. modified the milestones: 16.1, 16.2 on Apr 23, 2019
  7. modified the milestones: 16.2, Backlog on Apr 30, 2019
  8. abelbraaksma commented on May 16, 2024

    @abelbraaksma
    ContributorAuthor

    Behavior has changed again. Right now (in VS 2022 Community, Version 17.8.6), if the build action is set to None, it will still syntax-color the file. It also appears to process the opens and report syntax and type errors. This may result in performance degradation.

    This is incorrect behavior: if the build action is None, errors should not be reported (note that regardless, build succeeds).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions