Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added TypeScript snippets #72

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

Merged
ice-chillios merged 4 commits into r5n-labs:master from vadymbiliuk:feature/TypeScript-implementation
Jun 25, 2019
Merged

Added TypeScript snippets #72

ice-chillios merged 4 commits into r5n-labs:master from vadymbiliuk:feature/TypeScript-implementation
Jun 25, 2019

Conversation

Copy link
Contributor

@vadymbiliuk vadymbiliuk commented Jun 24, 2019

I've added snippets for typescript language, with simple basic typing by interfaces

Copy link
Member

@vadymbiliuk Thank you!, I'm thinking if it's not better to alias this one with ts not only t as it can be mislead in future

Copy link
Contributor Author

vadymbiliuk commented Jun 24, 2019
edited
Loading

@dsznajder i can add 'ts' alias for all ts snippets if u wish ^^.

Copy link
Member

ice-chillios commented Jun 24, 2019
edited
Loading

@vadymbiliuk Yes, I would like a ts alias :) Also, I'm thinking about splitting ts snippets from .js to make them exclusive in .ts .tsx files, but I need investigate this one :)

Copy link
Contributor Author

vadymbiliuk commented Jun 24, 2019
edited
Loading

@dsznajder I've been thinking about the same! xD
I need investigate that ither. Also i would like to help if i can :3

ice-chillios reacted with thumbs up emoji

Copy link
Member

@vadymbiliuk I will research topic and get back to you.

Copy link
Member

@vadymbiliuk I'm pretty sure that we could done something like this:
https://code.visualstudio.com/api/language-extensions/snippet-guide
I do not know yet if we can pass array of languages to this one. -> need to check on your branch

vadymbiliuk reacted with thumbs up emoji

Copy link
Member

@vadymbiliuk Ok, it seems to be working if you add next ones in package.json:

"snippets": [
 {
 "language": "javascript",
 "path": "./snippets/snippets.json"
 },
 {
 "language": "javascriptreact",
 "path": "./snippets/snippets.json"
 },
 {
 "language": "typescript",
 "path": "./snippets/snippets.json"
 },
 {
 "language": "typescript",
 "path": "./snippets/snippets-ts.json"
 },
 {
 "language": "typescriptreact",
 "path": "./snippets/snippets.json"
 },
 {
 "language": "typescriptreact",
 "path": "./snippets/snippets-ts.json"
 }
 ]

But, I'm figuring out how to add this to extension/index.ts :)

Copy link
Contributor Author

@dsznajder yeah i've found that already
I think i can implement that. I'll do that when i will be free

Copy link
Member

@vadymbiliuk Ok, I will handle the extension search on my own later :)

Copy link
Contributor Author

@dsznajder i did that. But i'm not really sure about how much my solution is beautiful. I was trying to split same parts from javascript.json and typescript.json into base.json but i haven't found solution for that :/
How is it looks for you now?

Copy link
Member

@vadymbiliuk Not quite as I planned :). You should add only your snippets to typescript.json and include both files for typescript and typescriptreact. Rest should be untouched.

vadymbiliuk reacted with thumbs up emoji

Copy link
Contributor Author

@dsznajder pardon mate. My bad :C
Now it's should looks just like you imagined it

Copy link
Contributor Author

@dsznajder idk about stuff like snippets with PropTypes. Those should be still available in ts/tsx, but it's useless for typescript xd

Copy link
Member

@vadymbiliuk Ok thank you for this :) Anyway, I can't release it cos extension which search for snippets won't find those as I tested. I will try to figure it out soon :)

vadymbiliuk reacted with confused emoji

@ice-chillios ice-chillios merged commit c615ab3 into r5n-labs:master Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /