-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Don't include completions for current and later parameters #52690
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
DanielRosenwasser
merged 19 commits into
microsoft:main
from
zardoy:no-self-completions-in-parameter
Apr 15, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f259b14
add impl to ensure its not lost
zardoy 7c1fdfb
add test that seems okay
zardoy f69d9d7
hope to fix lint
zardoy 4749713
fix lint (more chances)
zardoy 09caed3
be surprised with the number of tests to fix
zardoy d520a31
fix don't include index signature
zardoy e27faed
fix my tests
zardoy fee4e96
add positive testcases
zardoy f3154b0
simplify implementation
zardoy 36ed7b7
refactor to `getVariableOrParameterDeclaration` (simplify)
zardoy c1d02f2
fix remaining test?
zardoy b204b1d
rename test file
zardoy b6eafdd
again fix bunch of tests (imporve quality)
zardoy 038e953
fix `const a = () => a`
zardoy a0aea62
add more complex test case
zardoy 85e35e0
avoid casting
zardoy 0b281e2
do the same for type parameters
zardoy dced6bc
fix tests
zardoy d1666e8
proposed changes
zardoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/cases/fourslash/noCompletionsForCurrentOrLaterParameters.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
//// function f1(a = /*1*/, b) { } | ||
//// function f2(a = a/*2*/, b) { } | ||
//// function f3(a = a + /*3*/, b = a/*4*/, c = /*5*/) { } | ||
//// function f3(a) { | ||
//// function f4(b = /*6*/, c) { } | ||
//// } | ||
//// const f5 = (a, b = (c = /*7*/, e) => { }, d = b) => { } | ||
//// | ||
//// type A1<K = /*T1*/, L> = K | ||
//// type A2<K extends /*T2*/, L> = K | ||
|
||
verify.completions({ | ||
marker: ["1", "2"], | ||
excludes: ["a", "b"], | ||
}) | ||
verify.completions({ | ||
marker: ["3"], | ||
excludes: ["a", "b"], | ||
}) | ||
|
||
verify.completions({ | ||
marker: ["4"], | ||
includes: ["a"], | ||
}) | ||
|
||
verify.completions({ | ||
marker: ["5"], | ||
includes: ["a", "b"], | ||
}) | ||
|
||
verify.completions({ | ||
marker: ["6"], | ||
excludes: ["b", "c"], | ||
includes: ["a"], | ||
}) | ||
|
||
verify.completions({ | ||
marker: ["7"], | ||
includes: ["a", "b", "d"], | ||
}) | ||
|
||
verify.completions({ | ||
marker: ["T1", "T2"], | ||
excludes: ["K", "L"], | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.