Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom editor labels for nextjs file conventions #1852

Closed
thecmdrunner opened this issue Apr 26, 2024 · 2 comments
Closed

feat: custom editor labels for nextjs file conventions #1852

thecmdrunner opened this issue Apr 26, 2024 · 2 comments
Labels
🌟 enhancement New feature or request

Comments

@thecmdrunner
Copy link
Contributor

thecmdrunner commented Apr 26, 2024

Is your feature request related to a problem? Please describe.

Having multiple page or layout files open makes it harder to navigate around in VS Code, due to the default naming convention in Next.js.

Describe the solution you'd like to see

VS Code now supports custom labels for files included in a pattern:
https://code.visualstudio.com/updates/v1_88#_custom-labels-for-open-editors

I propose default labels for page.tsx, layout.tsx and route.ts/tsx. Here's how I've done it:

{
  "typescript.tsdk": "node_modules/typescript/lib",

  "workbench.editor.customLabels.patterns": {
    "**src/app/**/page.tsx": "${dirname} - Page",
    "**src/app/**/layout.tsx": "${dirname} - Layout",
    "**src/app/**/route.ts": "${dirname} - API",
    "**src/app/**/route.tsx": "${dirname} - API"
  }
}

Before

image

After

image

Describe alternate solutions

None

Additional information

https://twitter.com/nextjs/status/1783508313113800930

@thecmdrunner thecmdrunner added the 🌟 enhancement New feature or request label Apr 26, 2024
@thecmdrunner
Copy link
Contributor Author

thecmdrunner commented Apr 26, 2024

Would love to take this issue, and file a PR :)

@thecmdrunner thecmdrunner changed the title feat: custom editor labels for feat: custom editor labels for nextjs file conventions Apr 26, 2024
@juliusmarminge
Copy link
Member

While I like the idea we do not init editor specific configurations

@juliusmarminge juliusmarminge closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants