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) create sveltekit route files #1620

Merged
merged 7 commits into from
Sep 15, 2022

Conversation

david-plugge
Copy link
Contributor

@david-plugge david-plugge commented Sep 4, 2022

  • create a single page/layout/error/endpoint
  • create multiple files at once
  • enter url path for the file location
  • use WorkspaceEdit instead of fs
  • find out if this is really a SvelteKit app (check package.json)
  • ask if a matcher should be created if found in the path and does not exist
  • only show the explorer menu in the routes folder (don´t know if this is possible, or needed)
  • read svelte.config.js because people can customize the routes folder (?) (maybe later, not sure how feasible this is since we need to read a JS file)

@david-plugge david-plugge changed the title (feat) auto-create sveltekit route files (feat) create sveltekit route files Sep 4, 2022
@dummdidumm
Copy link
Member

From reading the bullet point list it sounds like we only need to do the package.json check, or maybe not even that because it's a dedicated command someone actively needs to invoke, and that someone likely doesn't do that in a non-Kit app. I'm ok with doing the other stuff later. Thoughts?

@david-plugge
Copy link
Contributor Author

I totally agree, it just adds unnecessary complexity.

@david-plugge
Copy link
Contributor Author

david-plugge commented Sep 13, 2022

I also added some snippets for RequestHandler and Load functions.
Is it fine to include them in this PR?
Or do you think we should not add any kit related snippets?

Edit: Not sure why but none of the snippets seem to work, even the svelte ones.

"body": ["{#key ${1:key}}", "\t$TM_SELECTED_TEXT$0", "{/key}"],
"description": "key block"
"key block": {
"prefix": "key",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefixes were deliberately left out in #1373 so they don't conflict with the language server completions. It sounds like you were wondering why they didn't show up, that's why. Could you revert this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only affect the svelte snippets? The js and ts snippets don´t work for me without the prefix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, only Svelte snippets

@dummdidumm
Copy link
Member

Apart from the snippet thing (prefix was omitted deliberatly) this seems like it's ready to review?

@david-plugge david-plugge marked this pull request as ready for review September 13, 2022 19:09
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Fixed one bug which made it fail on Windows, but that's all. Thank you so much for working on this 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants