Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Develop #18

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
merged 2 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
images/
out/
plugins/
scripts/
snippets/
tasks/
test/
gulpfile.js
14 changes: 7 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
Expand Down Expand Up @@ -115,13 +114,13 @@
"error",
{
"selector": "default",
"format": [
"camelCase",
"PascalCase",
"UPPER_CASE"
],
"format": null,
"leadingUnderscore": "allow",
"trailingUnderscore": "forbid"
"trailingUnderscore": "forbid",
"custom": {
"regex": "^(?:[A-Za-z](?:[A-Za-z0-9]+)*|[A-Z](?:[A-Z0-9]*?)(?:_[A-Z0-9]+)*|[A-Za-z][A-Za-z0-9]+(?:\\.[A-Za-z0-9]+)+|\\d+|(?:-[a-z0-9]+)+)$",
"match": true
}
}
],
"@typescript-eslint/no-dupe-class-members": "error",
Expand Down Expand Up @@ -156,6 +155,7 @@
],
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
Expand Down
3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
out
node_modules
*.vsix
*.vsix
test/
!src/test/
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
Expand Down
16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: watch"
// "preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
// "preLaunchTask": "npm: watch"
}
]
}
35 changes: 20 additions & 15 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,29 @@
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
"type": "gulp",
"task": "build & watch",
"problemMatcher": []
},
{
"type": "gulp",
"task": "build",
"problemMatcher": []
},
{
"type": "gulp",
"task": "watch",
"problemMatcher": []
},
{
"type": "gulp",
"task": "clean",
"problemMatcher": []
},
{
"type": "npm",
"script": "docs",
"problemMatcher": [],
"label": "npm: docs",
"detail": "node ./scripts/docs.js"
"script": "compile",
"problemMatcher": []
}
]
}
15 changes: 8 additions & 7 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.vscode/**
.vscode-test/**
.gitattributes
.gitignore
.eslintignore
.eslintrc.json
tsconfig.json
plugins/**
scripts/**
src/**
tasks/**
test/**
tests/**
.eslintignore
.eslintrc.json
.gitignore
gulpfile.js
tsconfig.json
**/*.map
**/*.ts
**/*.ts
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Change Log
All notable changes to the "JavaScript and TypeScript Snippets" extension will be documented in this file.

## [0.22.0] - 2024-03-31

### Added
- Added `using` and `await using`.
- Added `Symbol.dispose` and `Symbol.asyncDispose`.
- Added `${clipboard}` and `${selection}` for keyboard shortcut usage.

### Changed
- Eliminated duplicated prefixes with value selection.

### Removed
- Removed primitive types for functions, getters, setters, methods and types.
- Removed `typeof value !== ...`.

## [0.21.0] - 2023-04-09

### Added
Expand Down
71 changes: 62 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

This extension contains keyword snippets and micro patterns for JavaScript, TypeScript and JSON.

## What's new in JavaScript and TypeScript Snippets 0.21.0
## What's new in JavaScript and TypeScript Snippets 0.22.0

- Added `l13Snippets.javascript.useFunctionBlockPadding` to enable or disable line padding in function blocks.
- Added `l13Snippets.typescript.useFunctionBlockPadding` to enable or disable line padding in function blocks.
- Added more snippets for TypeScript types like `declare`, `readonly`, `{ [K in T]: ... }` and `extends`.
- Changed type formatting in TypeScript snippets.
- Added `using` and `await using`.
- Added `Symbol.dispose` and `Symbol.asyncDispose`.
- Added `${clipboard}` and `${selection}` for keyboard shortcut usage.
- Eliminated duplicated prefixes with value selection.
- Removed primitive types for functions, getters, setters, methods and types.
- Removed `typeof value !== ...`.

## Index

Expand Down Expand Up @@ -102,13 +104,23 @@ __The following prefixes are just examples to explain the rules.__ To see the co

It is recommended to set the snippet suggestions to top.

It is recommended to disable auto intellisense for snippet.

```json
"editor.snippetSuggestions": "top",
"editor.suggest.snippetsPreventQuickSuggestions": true
```

It is also recommended to disable the built-in JavaScript Snippets with the following extension.
It is also recommended to hide the built-in JavaScript and TypeScript snippets.

1. Open a JavaScript file
1. Open command palette
1. Run `Snippets: Insert Snippets`
1. Hide all `JavaScript Language Basics` snippets from Intellisense

[Built-In Extensions](https://marketplace.visualstudio.com/items?itemName=L13RARY.l13-built-in-extensions)
1. Open a TypeScript file
1. Open command palette
1. Run `Snippets: Insert Snippets`
1. Hide all `Typercript Language Basics` snippets from Intellisense

## Recommended Keyboard Shortcuts

Expand All @@ -128,8 +140,49 @@ Please have the following keyboard shortcuts always in mind, because these are f
* `Ctrl + Enter` - Insert line below, even if the caret is in the middle of a line.
* `Ctrl + Shift + Enter` - Insert line above, even if the caret is in the middle of a line.

### Quick Template Literals Expression

The following keyboard shortcut improves the writing of an expression in template literals.

#### macOS

```json
[
{
"key": "cmd+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /(java|type)script(react)?/",
"args": { "name": "${selection}" }
},
{
"key": "alt+cmd+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /(java|type)script(react)?/",
"args": { "name": "${clipboard}" }
}
]
```

#### Windows and Linux

```json
[
{
"key": "ctrl+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /(java|type)script(react)?/",
"args": { "name": "${selection}" }
},
{
"key": "alt+ctrl+-",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /(java|type)script(react)?/",
"args": { "name": "${clipboard}" }
}
]
```

## Recommended Extensions

- [Swap Keywords](https://marketplace.visualstudio.com/items?itemName=L13RARY.l13-swap)
- [Built-In Extensions](https://marketplace.visualstudio.com/items?itemName=L13RARY.l13-built-in-extensions)
- [Extension Pack](https://marketplace.visualstudio.com/items?itemName=L13RARY.l13-extension-pack)
Loading