JCWasmx86 / mesonlsp

An unofficial, unendorsed language server for meson written in C++
GNU General Public License v3.0
65 stars 8 forks source link

Code Formatting Keep Duplicating Last Line When `meson.build` Has Fewer Lines #101

Closed GreenYun closed 5 months ago

GreenYun commented 5 months ago

Describe the bug Code formatting duplicates last line of meson.build with VS Code 'Format On Save' on.

To Reproduce Steps to reproduce the behavior:

  1. Make an empty directory, and add this meson.build file into.
project('test', 'c')
subdir('lib')
  1. Optionally, "mkdir" the lib directory and put this meson.build file into.
sources = [
    'source.c'
]

Expected behavior The 'meson.build' files should not be changed because they are well formatted.

Screenshots/Screencasts In this video, everytime the code was changed without editing is because "Command+s" ("save" on macOS) pressed.

https://github.com/JCWasmx86/mesonlsp/assets/26381267/c0013761-cec6-4f39-9109-b8911791fd00

https://github.com/JCWasmx86/mesonlsp/assets/26381267/5a48ef8d-e9f9-4deb-89d3-de82edf78ff6

System info

Additional context muon is not installed thus the formatter should be mesonlsp integrated. Also, by disabling mesonlsp will solve the problem.

JCWasmx86 commented 5 months ago

Should be fixed and in the next release.