- Notifications
You must be signed in to change notification settings - Fork12.9k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
39 commits Select commitHold shift + click to select a range
701c5f3
prototype creation for method override completion snippet
gabritto2c84d88
WIP: start using codefix `addNewNodeForMemberSymbol` to create method…
gabritto4d2d476
update type of addNewNodeForMemberSymbol
gabrittoc608a6e
add more tests and support more cases
gabritto2fa43e8
add more tests and fix some details
gabritto1d04720
wip: more fixes and tests
gabritto905caad
expose check override modifier in checker
gabritto8ad4042
fix test
gabrittod20eb68
WIP: add snippet support
gabrittoc81f385
WIP: snippet support on emitter, adding snippets in completions
gabrittob124c84
make add snippets work with overloads (not synced)
gabrittodb408cc
fix snippet adding
gabrittod7809c1
rebase
gabritto41a3c19
WIP: try to add snippet escaping in emitter
gabritto69ee9fc
support escaping in snippets
gabrittoc3a64bc
small fixes; fixed tests
gabrittoe079f71
more tests and fixes
gabrittod7c26c4
fix new tests
gabrittofe4fce8
fix modifier inheritance for overloads
gabrittob8bb27a
Merge branch 'main' into gabritto/issue45670
gabritto952aac1
merge conflict fixes; remove comments
gabritto00dc206
throw error if setOptions is called but not implemented
gabritto28539b6
fix newline handling
gabritto01eb2bb
fix weird stuff
gabritto70ebe86
fix tests
gabrittoe76c18d
fix more tests
gabritto35c1ea3
Fix unbound host.getNewLine
andrewbrancha639aef
fix isParameterDeclaration changes
gabritto4571e98
rename diagnostic to status and remove snippets from public api
gabritto3a6b6bf
rename emitter functions + fix indentation
gabritto302c0fc
check completion kind before calling isclasslikemembercompletion
gabritto7bdeaa8
fix missing type parameters
gabritto68e5913
Revert "fix missing type parameters"
gabrittod796043
add isAmbient flag to addNewNodeForMemberSymbol
gabrittof6ea5f2
add test for abstract overloads
gabritto221edac
refactor snippet escaping support
gabritto8e9cac9
add user preference flag for enabling class member snippets
gabrittoc5f1166
update API baseline
gabrittoa2665d8
update tabstop order
gabrittoFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
PrevPrevious commit
update tabstop order
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commita2665d8cf8f85a4d226c75b1587b724fad50553c
There are no files selected for viewing
14 changes: 8 additions & 6 deletionssrc/services/completions.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
2 changes: 1 addition & 1 deletiontests/cases/fourslash/completionsOverridingMethod2.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
39 changes: 39 additions & 0 deletionstests/cases/fourslash/completionsOverridingProperties.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,39 @@ | ||
/// <reference path="fourslash.ts" /> | ||
// @newline: LF | ||
// @Filename: a.ts | ||
// Case: Properties | ||
////class Base { | ||
//// protected foo: string = "bar"; | ||
//// | ||
////} | ||
//// | ||
////class Sub extends Base { | ||
//// /*a*/ | ||
////} | ||
verify.completions({ | ||
marker: "a", | ||
isNewIdentifierLocation: true, | ||
preferences: { | ||
includeCompletionsWithInsertText: true, | ||
includeCompletionsWithSnippetText: false, | ||
includeCompletionsWithClassMemberSnippets: true, | ||
}, | ||
includes: [ | ||
{ | ||
name: "foo", | ||
sortText: completion.SortText.LocationPriority, | ||
replacementSpan: { | ||
fileName: "", | ||
pos: 0, | ||
end: 0, | ||
}, | ||
insertText: | ||
"protected foo: string;\n", | ||
} | ||
], | ||
}); |
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.