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
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
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
WIP: add snippet support
  • Loading branch information
gabritto committed Oct 1, 2021
commit d20eb6852aa7ae2fb244e732fe19b4ed6937b6bc
23 changes: 23 additions & 0 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6737,6 +6737,29 @@ namespace ts {
externalHelpers?: boolean;
helpers?: EmitHelper[]; // Emit helpers for the node
startsOnNewLine?: boolean; // If the node should begin on a new line
snippetElement?: SnippetElement; // Snippet element of the node
}

export interface SnippetElement {
kind: SnippetKind;
}

export interface TabStop extends SnippetElement {
kind: SnippetKind.TabStop;
order: number;
}

export interface PlaceHolder extends SnippetElement {
kind: SnippetKind.Placeholder;
order: number;
}

// Reference: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax
export const enum SnippetKind {
TabStop, // `$1`, `$2`
Placeholder, // `${1:foo}`
Choice, // `${1|one,two,three|}`
Variable, // `$name`, `${name:default}`
}

export const enum EmitFlags {
Expand Down