Invalidate project engine when UseRoslynTokenizer changes

This commit is contained in:
David Wengier 2024-10-25 14:53:08 +11:00
Родитель 1e660568b6
Коммит 6702e25e53
1 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -151,16 +151,17 @@ internal class ProjectState
else
{
ProjectWorkspaceStateVersion = Version;
}
if ((difference & ClearProjectWorkspaceStateVersionMask) != 0 &&
CSharpLanguageVersion != older.CSharpLanguageVersion)
// CSharpLanguageVersion and UseRoslynTokenizer are part of the ProjectWorkspaceState, but they affect the project engine
// so we check for those specifically changing, and clear that.
if (CSharpLanguageVersion != older.CSharpLanguageVersion ||
ProjectWorkspaceState.UseRoslynTokenizer != older.ProjectWorkspaceState.UseRoslynTokenizer)
{
// C# language version changed. This impacts the ProjectEngine, reset it.
_projectEngine = null;
ConfigurationVersion = Version;
}
}
}
// Internal set for testing.
public ImmutableDictionary<string, DocumentState> Documents { get; internal set; }