From facb0388040c09a373c7c6a02b4d8887649e50ff Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Fri, 5 Apr 2024 17:35:39 +0800 Subject: [PATCH 1/6] add configuration defaults contribution points --- packages/svelte-vscode/package.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index 250a8063a..0d71de80e 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -396,6 +396,15 @@ } } }, + "configurationDefaults": { + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + }, + "workbench.editor.customLabels.patterns": { + "**/+page.*": "${dirname}/${filename}.${extname}", + "**/+server.*": "${dirname}/${filename}.${extname}" + } + }, "languages": [ { "id": "svelte", From 585b900883e39edccfc8f4ebab07448724c311aa Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Fri, 5 Apr 2024 22:19:23 +0800 Subject: [PATCH 2/6] add variants for deeply nested directories --- packages/svelte-vscode/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index 0d71de80e..0593c9ac1 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -401,8 +401,9 @@ "editor.defaultFormatter": "svelte.svelte-vscode" }, "workbench.editor.customLabels.patterns": { - "**/+page.*": "${dirname}/${filename}.${extname}", - "**/+server.*": "${dirname}/${filename}.${extname}" + "src/routes/+[page|server]*": "/${filename}.${extname}", + "src/routes/*/+[page|server]*": "/${dirname}/${filename}.${extname}", + "src/routes/*/*/**/+[page|server]*": ".../${dirname}/${filename}.${extname}", } }, "languages": [ From f84d84c4c5ec7d535d6d9e5e04763587d464d4a0 Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Sat, 6 Apr 2024 13:58:24 +0800 Subject: [PATCH 3/6] add fallback --- packages/svelte-vscode/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index 0593c9ac1..4af5df421 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -404,6 +404,7 @@ "src/routes/+[page|server]*": "/${filename}.${extname}", "src/routes/*/+[page|server]*": "/${dirname}/${filename}.${extname}", "src/routes/*/*/**/+[page|server]*": ".../${dirname}/${filename}.${extname}", + "**/+[page|server]*": "${dirname}/${filename}.${extname}" } }, "languages": [ From 126191b171016d12b6a8c8a8d397461c74cbd01c Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Sat, 6 Apr 2024 15:35:52 +0800 Subject: [PATCH 4/6] almost forgot about layouts --- packages/svelte-vscode/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index 4af5df421..49e36aa53 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -401,10 +401,10 @@ "editor.defaultFormatter": "svelte.svelte-vscode" }, "workbench.editor.customLabels.patterns": { - "src/routes/+[page|server]*": "/${filename}.${extname}", - "src/routes/*/+[page|server]*": "/${dirname}/${filename}.${extname}", - "src/routes/*/*/**/+[page|server]*": ".../${dirname}/${filename}.${extname}", - "**/+[page|server]*": "${dirname}/${filename}.${extname}" + "src/routes/+[layout|page|server]*": "/${filename}.${extname}", + "src/routes/*/+[layout|page|server]*": "/${dirname}/${filename}.${extname}", + "src/routes/*/*/**/+[layout|page|server]*": ".../${dirname}/${filename}.${extname}", + "**/+[layout|page|server]*": "${dirname}/${filename}.${extname}" } }, "languages": [ From bf063728007c763908de36f9ea5977d488bcf39f Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Wed, 17 Apr 2024 23:52:31 +0800 Subject: [PATCH 5/6] prefix src dir with wildcard Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- packages/svelte-vscode/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index 49e36aa53..a9fa27769 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -401,9 +401,9 @@ "editor.defaultFormatter": "svelte.svelte-vscode" }, "workbench.editor.customLabels.patterns": { - "src/routes/+[layout|page|server]*": "/${filename}.${extname}", - "src/routes/*/+[layout|page|server]*": "/${dirname}/${filename}.${extname}", - "src/routes/*/*/**/+[layout|page|server]*": ".../${dirname}/${filename}.${extname}", + "**/src/routes/+[layout|page|server]*": "/${filename}.${extname}", + "**/src/routes/*/+[layout|page|server]*": "/${dirname}/${filename}.${extname}", + "**/src/routes/*/*/**/+[layout|page|server]*": ".../${dirname}/${filename}.${extname}", "**/+[layout|page|server]*": "${dirname}/${filename}.${extname}" } }, From 9bd3dca37a773edf6a425beba48dde3906a3e202 Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Sun, 21 Apr 2024 19:22:48 +0800 Subject: [PATCH 6/6] account for +error components --- packages/svelte-vscode/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index a9fa27769..7c0f65b68 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -401,10 +401,10 @@ "editor.defaultFormatter": "svelte.svelte-vscode" }, "workbench.editor.customLabels.patterns": { - "**/src/routes/+[layout|page|server]*": "/${filename}.${extname}", - "**/src/routes/*/+[layout|page|server]*": "/${dirname}/${filename}.${extname}", - "**/src/routes/*/*/**/+[layout|page|server]*": ".../${dirname}/${filename}.${extname}", - "**/+[layout|page|server]*": "${dirname}/${filename}.${extname}" + "**/src/routes/+[layout|page|server|error]*": "/${filename}.${extname}", + "**/src/routes/*/+[layout|page|server|error]*": "/${dirname}/${filename}.${extname}", + "**/src/routes/*/*/**/+[layout|page|server|error]*": ".../${dirname}/${filename}.${extname}", + "**/+[layout|page|server|error]*": "${dirname}/${filename}.${extname}" } }, "languages": [