skip to Main Content

VS code shows me override suggestions, but when I try to use them by pressing Enter or tab, it just deletes the whole thing and leaves only the first letter:

Example: When I try to accept the suggestion, it just deletes it.

I am working on a Unity project so maybe that might have something to do with it. This problem is not only with this specific class, but with a whole project. I have no idea what else to provide, as I’m new to intelisense and stuff I’m sorry if this is not enough info in the question… At least help me find the direction to go I’m lost.

Versions:

VS Code "C#" Extension version: v2.0.413
VS Code "C# Dev Kit" Extension version: v0.3.21

This class:

public class PlayerMovementState : PlayerState
    {
        public PlayerMovementState(IStateMachine stateMachine, PlayerEntity player) : base(stateMachine, player)
        {
        }
    }

Base class:

public abstract class PlayerState : BaseStateMachineState
    {
        //...

        #region Drawing

        //...

        #endregion
        #region Main Methods

        public virtual void Move() 
        {
            player.Rigidbody.velocity = Vector2.zero;
        }

        #endregion
        #region Callback Methods

        //...

        #endregion
        #region Damage

        //...

        #endregion
        #region Helper Methods

        //...

        #endregion
    }

2

Answers


  1. Chosen as BEST ANSWER

    From what I've gathered, it seems to be just a bug with autocompletion of overrides, so the only solution would be to either downgrade the version of .NET or to avoid using autocompletion for overrides all-together.

    https://github.com/dotnet/vscode-csharp/issues/6076


  2. I believe this is an instance of this bug: Override completion broken #6011, which is apparently fixed by this Pull Request: Fix completionComplexEdit: Use fsPath instead of path #6315, which will be released soon (source) probably in some version slightly greater than v2.2.10.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search