-
-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support of ultisnips snippet (#3682)
The goal is better support for ultinips python features, including: - Dependencies of placeholder with python block, like: ``` snippet ${1:`!p snip.rv = t[2]`} ${2:`!p snip.rv = t[3]`} ${3:`!p snip.rv = t[4][0]`} ${4:bar} ``` - Variables like `snip.c`: ``` snippet #ifndef ${1:`!p if not snip.c: import random, string name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper() rand = ''.join(random.sample(string.ascii_letters+string.digits, 8)) snip.rv = ('%s_%s' % (name,rand)).upper() else: snip.rv = snip.c`} #define $1 ``` - Calculate code blocks on placeholder change, like: ``` snippet `!p box = make_box(len(t[1])) snip.rv = box[0] snip += box[1] `${1:${VISUAL:content}}`!p box = make_box(len(t[1])) snip.rv = box[2] snip += box[3]` $0 ``` Other changes: - Fixed the changed placeholder could be wrong. - Add highlight support for current active placeholders. - Improved text edit on change by reduce the range as much as possible. - Nested placeholder support when insert nested snippet. - New synchronize logic which support cancellation. - Not jump to last placeholder when invoke `g:coc_snippet_prev` on first placeholder - Use `<Cmd>` for key mapping to avoid mode change. - Improve python code error by include python code. - Improve snippet preview by resolve python code. New VSCode snippet variables: - RELATIVE_FILEPATH - RANDOM - RANDOM_HEX - UUID - BLOCK_COMMENT_START - BLOCK_COMMENT_END - LINE_COMMENT - WORKSPACE_NAME - WORKSPACE_FOLDER
- Loading branch information
Showing
40 changed files
with
3,096 additions
and
1,435 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.