UPDATE: 09/07/2024
VSCode now supports custom tab labels!
See #2 for more info.
2023/02/28
Cannot be completed unless the VS Code extensions API adds support for changing/overriding tab labels.
(it would also be helpful if the tabs API contains file information like the URI of the file)
For Reference:
VSCode Github issue: Provide API to access and change editor tab labels
VSCode Tab documentation: Tabs Reference (it does not specify that the "label" is readonly, but it appears to be readonly in code-level + no relevant functions to call to mutate this value)
A VS Code extension for SvelteKit.
Aims to change the editor tab label in your VS Code editor if the file is a route in your SvelteKit application.
What it can potentially look like. (?)
Extension will activate if a svelte.config.js
file exists in the root directory,
followed by src/routes/
which contains SvelteKit routes.
By default, the extension changes route files to the following format:
Type | Filepath | New Label |
---|---|---|
Page | /app/about/+page.svelte |
/app/about π |
Page Module | /app/about/+page.js (or .ts ) |
/app/about π π« |
Page Module (server) | /app/about/+page.server.js (or .ts ) |
/app/about π π« β‘ |
Error | /app/about/+error.svelte |
/app/about β |
Layout | /app/about/+layout.svelte |
/app/about πΌοΈ |
Layout Module | /app/about/+layout.js |
/app/about πΌοΈ π« |
Layout Module (server) | /app/about/+layout.server.js |
/app/about πΌοΈ π« β‘ |
Server | /api/users/+server.js (or .ts |
/api/users β‘ |
Emoji characters worth considering:
Template formats worth considering:
This extension contributes the following settings:
betterSvelteKitTabLabels.tabLabelTemplate
: String that is used to format the new tab label. Defaults to "{routepath}{page}{layout}{error}{module}{server}"
.better-sveltekit-tab-labels.routeTypeString.*
: String (can contain emojis) for a type of route file. It will populate the tabLabelTemplate
if the file is applicable (otherwise populates as an empty string).
page
: Defaults to " π"module
: Defaults to " π«"server
: Defaults to " β‘"error
: Defaults to " β"layout
: Defaults to " πΌοΈ"TODO: Release something. Possibly. Eventually.
TODO: See Extension Guidelines