alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
40 stars 6 forks source link

[BUG] - Separators are not properly updated while editing the source code #87

Closed marcel-goldschen-ohm closed 1 year ago

marcel-goldschen-ohm commented 1 year ago

First off, thank you for this wonderful extension. I love it! Hopefully someone can help with the one annoying issue I have with it which is that the separators do not robustly adjust when editing code.

Environment/version Separators v2.5.0

Version: 1.80.1 (Universal) Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771 Date: 2023-07-12T17:20:23.298Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin x64 21.6.0

macOS Monterey v12.6.7

Steps to reproduce

  1. Install Separators extension in VSCode
  2. Open code file (separators appear as expected).
  3. Edit the code file such that blocks requiring separators are created and deleted.

Expected behavior Separators are correctly displayed for the newly created blocks and adjust during editing as needed.

Actual behavior Separators are not always updated correctly for new blocks. This does not take much to observe. Only way I can figure out how to get the separators to display correctly after editing is to close and reopen the file.

alefragnani commented 1 year ago

Hi @marcel-goldschen-ohm ,

Could you provide more details and/or examples (prints/gifs) presenting this issue? I've been using the extension for a while, with different programming languages and different file size, and don't remember noticing this behavior. In fact, I sometimes see a delay while opening files instead (specially C#), but this is easy to identify the reason. The C# extension itself takes a bit more time to be initialized, and since the Separators extension depends on the language extension to identify the symbols, it has to wait for that in order to ask the symbols and later draw the separators.

Could you try leaving the Outline view open while editing the code, to identify if its content also shows some delay/outdated info? If yes, maybe you are facing an issue similar to the C# sources.

Hope this helps

marcel-goldschen-ohm commented 1 year ago

In the attached image I first created the class Test, then copied and pasted it above itself and renamed the copy to Test1. As you can see in the image, separators for Test1 are absent. Unless the delay is hours or days, waiting does not change anything. I'll see if I can mock up another example, but what I also notice is that when the separators get out of whack, they can also end up being incorrect for classes further down the document where they used to be correctly displayed.

Screen Shot 2023-07-24 at 9 22 29 AM
marcel-goldschen-ohm commented 1 year ago

Ok, so the outline is indeed not updating correctly (thanks for suggesting to look at that), which probably explains why Separators is also not updating correctly. I now suspect that this is a bug with updating outline rather than Separators.

alefragnani commented 1 year ago

Yeah, if the Outline is not working, it means the language extension (responsible for it) is not providing the info, so the Separators extension won't be able to draw the lines.

I suggest you to open an issue in the language extension's repo, so the team could take a look and provide a fix. Then, not only the Outline will work, but Separators as well.

Hope this helps

marcel-goldschen-ohm commented 1 year ago

Yes, thanks for helping me find the root of this problem. Cheers! And thanks for Separators!