Skip to content

Commit a646d9d

Browse files
committed
Merge branch 'develop' into inKeywordCompletions
2 parents 81cedc3 + 8465f45 commit a646d9d

File tree

90 files changed

+8206
-1120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+8206
-1120
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ typescript/**
33
src/configurationType.ts
44
src/configurationTypeCache.jsonc
55
playground.ts
6+
test.ts
7+
integration/fixtures

.eslintrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
22
"extends": "zardoy",
3-
"rules": {}
3+
"rules": {
4+
"curly": "off"
5+
}
46
}

.github/workflows/ci.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ jobs:
66
test:
77
strategy:
88
matrix:
9-
os: [ubuntu-latest]
9+
os: [ubuntu-latest, macos-latest, windows-latest]
1010
fail-fast: true
1111
runs-on: ${{ matrix.os }}
12+
timeout-minutes: 30
1213
steps:
1314
- uses: actions/checkout@v2
15+
- run: npx prettier --check src/**
1416
- name: Cache pnpm modules
1517
uses: actions/cache@v2
1618
with:
@@ -24,8 +26,9 @@ jobs:
2426
run_install: |
2527
args: [--frozen-lockfile, --strict-peer-dependencies]
2628
- run: pnpm lint
29+
- run: pnpm vscode-utils prepareFrameworkBuild
2730
- run: pnpm build
2831
- run: pnpm test-plugin
29-
# - uses: GabrielBB/[email protected]
30-
# with:
31-
# run: pnpm integration-test
32+
- uses: GabrielBB/[email protected]
33+
with:
34+
run: pnpm integration-test

.github/workflows/release.yml

+6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ on:
77
jobs:
88
release:
99
runs-on: ubuntu-latest
10+
timeout-minutes: 30
11+
# needs: test
1012
steps:
13+
- run: npm -v
14+
- run: node -v
1115
- uses: actions/checkout@v2
16+
- run: npx prettier --check src/**
1217
- name: Cache pnpm modules
1318
uses: actions/cache@v2
1419
with:
@@ -21,6 +26,7 @@ jobs:
2126
version: latest
2227
run_install: |
2328
args: [--frozen-lockfile, --strict-peer-dependencies]
29+
- run: pnpm lint
2430
- run: pnpx zardoy-release vscode-extension
2531
env:
2632
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@ generators
66
build
77
dist
88
out
9+
testsOut
910
.next
1011
.nuxt
1112
.cache
1213
src/generated.ts
1314
src/configurationType.js
15+
src/configurationType.js.map
1416
src/configurationTypeCache.jsonc
17+
typescript/scripts/diagnostics.json
1518

1619
coverage
1720
*.lcov
1821
.nyc_output
22+
.vscode-test-web
1923

2024
logs
2125
*.log

.vscode/launch.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"version": "0.1.0",
3+
"configurations": [
4+
{
5+
"name": "Launch Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceRoot}/out",
11+
// "--disable-extensions"
12+
],
13+
"outFiles": [
14+
"${workspaceFolder}/out/**/*.js"
15+
],
16+
"sourceMaps": true,
17+
"env": {
18+
"TSS_DEBUG": "9229",
19+
"TSS_REMOTE_DEBUG": "9229"
20+
}
21+
},
22+
{
23+
"name": "Attach to TS Server",
24+
"type": "node",
25+
"request": "attach",
26+
"restart": true,
27+
"port": 9229,
28+
"sourceMaps": true,
29+
"outFiles": [
30+
"${workspaceFolder}/out/**/*.js"
31+
],
32+
}
33+
],
34+
"compounds": [
35+
{
36+
"name": "Extension + TS Plugin",
37+
"configurations": [
38+
"Launch Extension",
39+
"Attach to TS Server"
40+
]
41+
}
42+
]
43+
}

.vscode/settings.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"betterSnippets.customSnippets": [
3+
{
4+
"name": "SyntaxKind",
5+
"body": "ts.SyntaxKind",
6+
"when": {}
7+
},
8+
{
9+
"name": "logKind",
10+
"body": "console.log(ts.SyntaxKind[${1:node}!.kind])",
11+
"when": {
12+
"locations": [
13+
"lineStart"
14+
],
15+
}
16+
}
17+
],
18+
"githubPullRequests.ignoredPullRequestBranches": [
19+
"develop"
20+
]
21+
}

README.MD

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# TypeScript Essential Plugins
2+
3+
## Top Features
4+
5+
> Here React experience hits different!
6+
7+
### Special Commands & Actions
8+
9+
See [special commands list](#special-commands-list) ans [code actions list](#contributed-code-actions)
10+
11+
### JSX Outline
12+
13+
(*disabled by default*) Enable with `tsEssentialPlugins.patchOutline`
14+
15+
Add JSX elements to outline. It also makes sticky scroll works with your tags!
16+
17+
Super recommended for react. Fragments are not rendered.
18+
19+
Also is not supported in the web.
20+
21+
## **Completions Built Different**
22+
23+
90% work done in this extension highly improves completions experience!
24+
25+
### Method Snippets
26+
27+
(*enabled by default*)
28+
29+
Expands arrow callbacks with signature snippet with adding additional undo stack!
30+
31+
Example:
32+
33+
```ts
34+
const callback = (arg) => {}
35+
callback -> callback(arg)
36+
```
37+
38+
### Strict Emmet
39+
40+
(*enabled by default*) when react langs are in `emmet.excludeLanguages`
41+
42+
Emmet that is active **only** inside JSX tags!
43+
44+
You can force enable this by using `Enable Strict Emmet in JSX` command.
45+
46+
*Why?* Issues it fixes: [query](https://github.com/microsoft/vscode/issues?q=sort%3Aupdated-desc+51537+150671+142978+119736).
47+
48+
#### Optional Emmet Features
49+
50+
- cleanup input & textarea suggestions
51+
- override `.` snippet
52+
53+
Is not supported in the web for now.
54+
55+
### Array Method Snippets
56+
57+
(*disabled by default*)
58+
59+
Edits array suggestions that receive predicate in the following way:
60+
61+
```ts
62+
const usersList = []
63+
64+
usersList.map // -> usersList.map((user) => )
65+
```
66+
67+
### Case-sensitive Completions
68+
69+
(*disabled by default*)
70+
71+
Filter out completions that start with different casing.
72+
73+
### Remove Definition From References
74+
75+
(*enabled by default*)
76+
77+
<https://github.com/microsoft/vscode/issues/160637>
78+
79+
### Remove Imports From References
80+
81+
(*enabled by default*)
82+
83+
Removes import statements from references when symbol has usages in the same file. Why? Because if export thing is used in another file, it might be obvious that it is imported, and most probably you are not interested in import statements.
84+
85+
## Minor Useful Features
86+
87+
### `enablePlugin` setting
88+
89+
You can quickly disable this plugin functionality by setting this setting to false. Useful for debugging a problem for example.
90+
91+
### Web Support
92+
93+
> Note: when you open TS/JS file in the web for the first time you currently need to switch editors to make everything work!
94+
95+
Web-only feature: `import` path resolution
96+
97+
### Highlight non-function Methods
98+
99+
(*enabled by default*)
100+
101+
Highlights and lifts non-function methods. Also applies for static class methods.
102+
103+
### Indexed Signature Completions
104+
105+
```ts
106+
const bannedUsers = {
107+
admin: false,
108+
moderator: false,
109+
}
110+
bannedUsers[condition ? 'admin' : 'moderator'] = true
111+
// adds suggestions ^ ^ deranks admin suggestion
112+
```
113+
114+
### Remove Useless Code Fixes
115+
116+
(*enabled by default*)
117+
118+
By default removes `Fix Missing Function Declaration` codefix. Possibly to remove more via setting.
119+
120+
### Remove Useless Function Props
121+
122+
(*enabled by default*)
123+
124+
Removes `Symbol`, `caller`, `prototype` completions on function / classes.
125+
126+
### Keywords Insert Text
127+
128+
(*enabled by default*)
129+
130+
Appends *space* to almost all keywords e.g. `const `, like WebStorm does.
131+
132+
### Patch `toString()`
133+
134+
(*enabled by default*)
135+
136+
Patches `toString()` insert function snippet on number types to remove tabStop.
137+
138+
### Enforce Properties Sorting
139+
140+
(*disabled by default*) enable with `tsEssentialPlugins.fixSuggestionsSorting`
141+
142+
Try to restore [original](https://github.com/microsoft/TypeScript/issues/49012) properties sorting in some places such as object destructure & dot property access.
143+
144+
### Switch Exclude Covered Cases
145+
146+
(*enabled by default*)
147+
148+
Exclude already covered strings / enums from suggestions ([TS repo issue](https://github.com/microsoft/TypeScript/issues/13711)).
149+
150+
### Mark Code Actions
151+
152+
(*enabled by default* with two settings)
153+
154+
Mark all TS code actions with `🔵`, so you can be sure they're coming from TypeScript, and not some other extension.
155+
156+
### Additional Types Suggestions
157+
158+
```ts
159+
// Adds types in default constraint:
160+
type A<T extends 'foo' | 'bar' = ''> = ...
161+
```
162+
163+
### Builtin CodeFix Fixes
164+
165+
## Special Commands List
166+
167+
### Go to / Select Nodes by Kind
168+
169+
Use cases: search excluding comments, search & replace only within strings, find interested JSX attribute node
170+
171+
## Contributed Code Actions
172+
173+
### Swap Keys and Values in Object
174+
175+
> *Note*: Code action displayed **only** when object is fully explicitly selected
176+
177+
Example:
178+
179+
```ts
180+
const obj = {
181+
key1: 'someValue',
182+
key2: getSuperUniqueKey()
183+
}
184+
// turns into
185+
const obj = {
186+
'someValue': 'key1',
187+
[getSuperUniqueKey()]: 'key2'
188+
}
189+
```
190+
191+
### Turn Array Into Object
192+
193+
```ts
194+
const data = [
195+
{
196+
// test
197+
key: 'bar',
198+
a: 0
199+
},
200+
{
201+
key: 'baz',
202+
// yes
203+
b: 1
204+
}
205+
]
206+
```
207+
208+
After selecting code action, you'll get asked for key to used (here you can use only `key`) and after applying:
209+
210+
```ts
211+
const a = {
212+
'bar': {
213+
a: 0
214+
},
215+
'baz': {
216+
// yes
217+
b: 1
218+
}
219+
}
220+
```
221+
222+
(note that for now refactoring removes properties with comments!)
223+
224+
## Even Even More
225+
226+
Please look at extension settings, as this extension has much more features than described here!

README.ext.md

-5
This file was deleted.

0 commit comments

Comments
 (0)