vscode-restructuredtext icon indicating copy to clipboard operation
vscode-restructuredtext copied to clipboard

Snippets tagging selected text

Open lindhor opened this issue 6 years ago • 5 comments
trafficstars

This adds support for tagging selected text as roles/directives. This makes tagging existing text a lot easier. The negative side effect is that example default text can not be provided in a nice way and has therefor been removed. If included the default text would be appended to the selected text which is confusing.

For roles, the selected text is scanned for newline characters and replaced by space since these characters are not allowed. Normally a single or a few words are expected to be selected.

Included is also an example keyboard shortcut file for each snippet. You might want to add that to the default setup. I have used ctrl-k to initiate the shortcut sequence and tried to use reasonable second letters to select which snippet to use.

Also adds a snippet for the todo directive.

see #145

lindhor avatar Feb 10 '19 00:02 lindhor

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 10 '19 00:02 CLAassistant

I just want to check if there is anything more I can do to get this MR approved and merged. Best regards Roger

lindhor avatar Apr 06 '19 06:04 lindhor

Generally speaking, adding too many keyboard shortcuts is not recommended for an extension, as it might conflict with other extensions (or VSCode). So I don't plan to accept it at this moment.

lextm avatar Apr 06 '19 15:04 lextm

Ok, but isn’t possible to have the shortcuts only active for only rst documents? However I guess it still would risk conflicting with shortcuts that are valid for all file types. Would you accept an MR with a much reduced set of shortcuts, ie only the most commonly used?

lindhor avatar Apr 06 '19 15:04 lindhor

There seems to be a separate extension (not by me) already, so you might consider sending the changes to that,

https://marketplace.visualstudio.com/items?itemName=snowkylin.restructuredtext-shortcut

lextm avatar Apr 13 '19 15:04 lextm