plasmatech8 / vscode-better-sveltekit-tab-labels

1 stars 0 forks source link

Better Sveltekit Tab Labels


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)

Description

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. (?) Preview

Features

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:

Extension Settings

This extension contributes the following settings:

Release Notes

TODO: Release something. Possibly. Eventually.

Preview

TODO: See Extension Guidelines