Open heartacker opened 3 years ago
If I don't miss something, this extension doesn't provide any code snippet.
For the task list, I think it is okay to have an unassigned toggleTaskList
command (like in #551)
For the GFM table, I agree that "A fixed size table snippet is not useful enough". Probably we can introduce an emmet-style expansion (tb
for a default-size table and tbx3x4
for a 3-row 4-column table)
Please also see #23.
If I don't miss something, this extension doesn't provide any code snippet.
In my opinion:
use the same style/way to support creating task list which could make it same experience.
e.g. within vscode snippet:
typing ordered list
could insert order list, so using task list
is harmonious
also we could trigger insert snippet
to insert,
vscode creates those snippet because of vscode include those feature and close those pr because of not included, With this theory, vscode will add those snippet once included. so, this extension implement TASK LIST
, so It is necessary to add.
For the task list, I think it is okay to have an unassigned
toggleTaskList
command (like in #551)
markdown extension. editing. toggleCodeSpan
markdown extension. editing. toggleMath
markdown extension. editing. toggleMathReverse
markdown extension. editing. toggleList
markdown. extension. editing. toggleCodeBlock
markdown extension. editing. toggleBold
markdown extension. editing. toggleItalic
markdown extension. editing. togglestrikethrough
markdown extension. editing. toggleHeadingUp
markdown extension. editing. toggleHeadingDown
are use for toggle exited code/text(or multi lines) to another ,
like: togglelist
could create one prefix char -
when nothing selection, I think that is ==Side effect== of toggle,maybe typing -
is better than trigger the command in a text-editor
it is diffenent between toggle command and snippet, one is for toggle , another is for creating
BTW:
there are 2 questions about toggleCodeBlock:
code block usually expands whole line of editor, diff with inline code
. so, maybe this command should trying to toggle the whole line or multi lines.
when cause using editorTextFocus
and TM_SELECTED_TEXT
, Does this command aim to convert a word to fenced code?
{
"command": "markdown.extension.editing.toggleCodeBlock",
"key": "ctrl+shift+k",
"mac": "cmd+shift+k",
"when": "editorTextFocus && !editorReadonly && editorLangId == markdown"
},
return editor.insertSnippet( new vscode.SnippetString('```language$0 \n$TM_SELECTED_TEXT\n```'));
like(工 stand for Cursor position):
console.log(" I want to convert this line to fenced工 code");
will be convert to
console.log(" I want to convert this line to fenced` ` `language
` ` `
code");
maybe the feature is what we need indeed
editorTextFocus
and editorHasSelection
: convert the whole line of cursor to fenced codeeditorHasMultipleSelections
: convert the whole text block line (from top cursor to least cursor) to fenced codeFor the GFM table, I agree that "A fixed size table snippet is not useful enough". Probably we can introduce an emmet-style expansion (
tb
for a default-size table andtbx3x4
for a 3-row 4-column table) Please also see #23.
- emmet is great, agree
- typing
table
snippet could has the same experience above, even creating a simple table- typing
table
snippet is easy and Intuitive then https://github.com/yzhang-gh/vscode-markdown/issues/23#issuecomment-319990000
I don't see any advantage of the snippet (for task list) except that you need to type even more characters.
There are a number of extensions that generate markdown tables of configurable sizes: https://marketplace.visualstudio.com/items?itemName=JayFiDev.tablegenerator
A fixed size table snippet is not useful enough to include in core Markdown All in One IMO
VS Code introduces User Snippets just for this case.
Proposal
help to input fast with table and task list
References
vscode has created snippet for commonMark https://github.com/microsoft/vscode/blob/cb842dcad0cc6293f207ce4bf26f2b08de3fe261/extensions/markdown-basics/snippets/markdown.code-snippets#L1
now all-in-one support github style, may be we be better to create the snippet for that, like task-list
vscode reject beacuse vscode doesn't include that style, https://github.com/microsoft/vscode/pull/131374 https://github.com/microsoft/vscode/pull/131452
and now all-in-one supported.