I think you can check the settings in vscode, search Editor: Format On Type and Editor: Format On Save, and make sure they are off because these settings will format your code, which may result in unexpected extra space. That's all the suggestions I can give to you, hope you can find a solution.