VSCode.cs error: 'EditorApplication.playmodeStateChanged' is obsolete

I’m using Unity linked with VSCode (in Ubuntu 18.04) and I’m getting a warning that a method is obsolete in the snippet below that belongs to the VSCode.cs file in the Plugins/Editor directory of my project:

>  static void OnScriptReload()
        {
            EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged;
            EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged;
        }  

Which gives me the following warning:

'EditorApplication.playmodeStateChanged' is obsolete: 'Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged' [Assembly-CSharp-Editor]csharp(CS0618)

If I try to edit the code above and use the suggested syntax (seems it’s the same thing with the M capitalized in “mode”), it gives me another error:

No overload for 'OnPlaymodeStateChanged' matches delegate 'Action<PlayModeStateChange>' [Assembly-CSharp-Editor]csharp(CS0123)

I had the same issue.
After I did this for the CS0618

EditorApplication.playModeStateChanged += OnPlaymodeStateChanged; 

got the CS0123, what fixed it for me was, in your definition of OnPlaymodeStateChanged add the state in the parenthesis like so.

static void OnPlaymodeStateChanged(PlayModeStateChange state) {
}