10000 Add method signature completions by gabritto · Pull Request #46370 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

Add method signature completions #46370

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 39 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
701c5f3
prototype creation for method override completion snippet
gabritto Sep 10, 2021
2c84d88
WIP: start using codefix `addNewNodeForMemberSymbol` to create method…
gabritto Sep 17, 2021
4d2d476
update type of addNewNodeForMemberSymbol
8000 gabritto Sep 20, 2021
c608a6e
add more tests and support more cases
gabritto Sep 21, 2021
2fa43e8
add more tests and fix some details
gabritto Sep 22, 2021
1d04720
wip: more fixes and tests
gabritto Sep 23, 2021
905caad
expose check override modifier in checker
gabritto Sep 23, 2021
8ad4042
fix test
gabritto Sep 30, 2021
d20eb68
WIP: add snippet support
gabritto Oct 1, 2021
c81f385
WIP: snippet support on emitter, adding snippets in completions
gabritto Oct 5, 2021
b124c84
make add snippets work with overloads (not synced)
gabritto Oct 5, 2021
db408cc
fix snippet adding
gabritto Oct 5, 2021
d7809c1
rebase
gabritto Oct 6, 2021
41a3c19
WIP: try to add snippet escaping in emitter
gabritto Oct 7, 2021
69ee9fc
support escaping in snippets
gabritto Oct 12, 2021
c3a64bc
small fixes; fixed tests
gabritto Oct 12, 2021
e079f71
more tests and fixes
gabritto Oct 13, 2021
d7c26c4
fix new tests
gabritto Oct 14, 2021
fe4fce8
fix modifier inheritance for overloads
gabritto Oct 14, 2021
b8bb27a
Merge branch 'main' into gabritto/issue45670
gabritto Oct 14, 2021
952aac1
merge conflict fixes; remove comments
gabritto Oct 14, 2021
00dc206
throw error if setOptions is called but not implemented
gabritto Oct 14, 2021
28539b6
fix newline handling
gabritto Oct 14, 2021
01eb2bb
fix weird stuff
gabritto Oct 14, 2021
70ebe86
fix tests
gabritto Oct 15, 2021
e76c18d
fix more tests
gabritto Oct 18, 2021
35c1ea3
Fix unbound host.getNewLine
andrewbranch Oct 20, 2021
a639aef
fix isParameterDeclaration changes
gabritto Oct 25, 2021
4571e98
rename diagnostic to status and remove snippets from public api
gabritto Oct 25, 2021
3a6b6bf
rename emitter functions + fix indentation
gabritto Oct 25, 2021
302c0fc
check completion kind before calling isclasslikemembercompletion
gabritto Oct 25, 2021
7bdeaa8
fix missing type parameters
gabritto Oct 26, 2021
68e5913
Revert "fix missing type parameters"
gabritto Oct 26, 2021
d796043
add isAmbient flag to addNewNodeForMemberSymbol
gabritto Oct 26, 2021
f6ea5f2
add test for abstract overloads
gabritto Oct 26, 2021
221edac
refactor snippet escaping support
gabritto Oct 27, 2021
8e9cac9
add user preference flag for enabling class member snippets
gabritto Oct 27, 2021
c5f1166
update API baseline
gabritto Oct 27, 2021
a2665d8
update tabstop order
gabritto Oct 28, 2021
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
Prev Previous commit
Next Next commit
Revert "fix missing type parameters"
This reverts commit 7bdeaa8.
  • Loading branch information
gabritto committed Oct 26, 2021
commit 68e5913d54dfb477c9b4e1aa859f3bf177d850b0
9 changes: 1 addition & 8 deletions src/services/codefixes/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ namespace ts.codefix {
let maxArgsSignature = signatures[0];
let minArgumentCount = signatures[0].minArgumentCount;
let someSigHasRestParameter = false;
let maxTypeArgsSignature = signatures[0];
for (const sig of signatures) {
minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount);
if (signatureHasRestParameter(sig)) {
Expand All @@ -385,9 +384,6 @@ namespace ts.codefix {
if (sig.parameters.length >= maxArgsSignature.parameters.length && (!signatureHasRestParameter(sig) || signatureHasRestParameter(maxArgsSignature))) {
maxArgsSignature = sig;
}
if (sig.typeParameters && (!maxTypeArgsSignature.typeParameters || sig.typeParameters.length > maxTypeArgsSignature.typeParameters.length)) {
maxTypeArgsSignature = sig;
}
}
const maxNonRestArgs = maxArgsSignature.parameters.length - (signatureHasRestParameter(maxArgsSignature) ? 1 : 0);
const maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(symbol => symbol.name);
Expand All @@ -406,14 +402,11 @@ namespace ts.codefix {
parameters.push(restParameter);
}

const typeParameters = maxTypeArgsSignature.typeParameters?.map(typeParam =>
factory.createTypeParameterDeclaration(typeParam.symbol.getName()));

return createStubbedMethod(
modifiers,
name,
optional,
typeParameters,
/*typeParameters*/ undefined,
parameters,
getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration),
quotePreference,
Expand Down
56 changes: 0 additions & 56 deletions tests/cases/fourslash/completionsOverridingMethod7.ts

This file was deleted.

0