I underestimated the amount of time I needed to look for where I needed to make changes in the code base. The original plan was to find the element that contained the tab title, extract the string in the first line of the file, and put it in the tab title.
The idea was to do something akin to this. Change the text in the label-name class element.
I found where the tab was being generated. This code seems to be responsible for rendering the tab and adding the description, but when I tried to write literal strings to test if I could change the tab title, I had problems recompiling VSCode. I should have started earlier specifically when I encountered unexpected problems such as these.
An alternative solution would be to tweak an existing function instead. There already exists a function called suggestFileName() which suggests a file name when saving. I should investigate this function further.