Skip to content

Local ref's & readonly ref (in) support (C# 7 & 8) #587

@airzocker

Description

@airzocker
  • Consulo version: 2021.12 (#3101 Alpha)
  • Unity version: 2021.3.6f1 (but 2020 had the problem as well, I think it is a general problem with Unity.Entities)
  • OS: Kubuntu 22.04 (same on 20.04)

Hi, since I started a project with DOTS, I've been getting wrong syntax error highlighting in Entities.ForEach() lambda calls.

Code example:

Entities
.WithoutBurst()
.ForEach(
  (in DynamicBuffer<EntityPrefabElement> prefabBuffer) =>
  {
    for (int i = 0; i < PrefabIDs.PREFAB_COUNT; i++)
    {
      prefabs[i] = prefabBuffer[i];
    }
    prefabsReady = true;
  }
).Run();

Consulo marks the "in" keyword as red, with the errors "Identifier expected" and "Expected comma".

Maybe it's just some .NET framework version not matching or something, but I can't figure it out.

EDIT: Also I had some syntax error highlighting issues with a using var x = y; + following code using x, and generally when working with refs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions