Tab Name Disambiguation

In languages that have rich module systems, you’ll end up with the same filename reused across multiple directories. For example, in Rust every module might have a file. As another example, in Python every module will have an file. If you open more than one of these identically named files a time, it becomes ambiguous what tab corresponds to what file. As shown in the screenshot:

Maybe builder should disambiguate the filenames in some way? Here’s how VS Code handles it:

Possible solutions:

  • Show project-relative full paths, so the tab title would be /src/page/language/
  • Show the immediate parent directory. Doesn’t cover all usecases but is an easy solution that helps a lot of the time. So the tab title would be language/
  • Have some algorithm to intelligently disambiguate based on the exact collection of tabs visible. This is VS Code’s behavior, so the exact algorithm to decide which chunks of path to show should be copied from them:
    • If only src/a/ is open, then the tab title would be
    • If src/a/ and src/b/ are shown then make the titles a/ and b/ respectively
    • if src/a/, src/b/, and src/some/subdir/a/ are shown, then the titles would be /src/a/, b/, and subdir/a/ respectively
  • In addition to one of the methods above, use the language server to resolve the actual name of the module relative to the root of the project, and use that as the tab title (so for example: src/page/language/ would instead be shown as crate::page::language, and src/page/language/ would be shown as crate::page::language::filter)
1 Like

I second this. I know I am suggested to just leave a like if I want to show support for someone’s post on this forum, but this has been something I have noticed every day working with GNOME builder + Rust.