[Visual Studio Code] Announcing Syntax Highlighting and Intellisense Plugin for TW5

138 views
Skip to first unread message

Joshua Fontany

unread,
Jul 17, 2020, 3:49:57 PM7/17/20
to TiddlyWiki
https://marketplace.visualstudio.com/items?itemName=joshua-fontany.tw5-syntax 

  • Automatically highlight HTML/Wikitext syntax.
  • Almost all TW-Wikitext syntax is recognized
    •  (it chokes a bit on system tiddler names in macro definitions, :P )
  • Intellisense auto-fills means you can type a "snippet" like "set", then press tab, and have a whole block of text inserted, with your cursor placed at a good point to keep typing, like so:
    <$set name="|cursor|"> </$set>
  • Automatically recognizes if the text file is a *.tid file with a block of fields above a wiki-text body, or if it is a multid (*.multids), or just wikitext (*.tw5).

Have fun! Bug report appreciated. You should also be able to search for it via the VS Code internal plugins tab (it way wait a few minutes, I literally jut pushed publish).

This seems to be working out really well, and is in a state that I believe we could adapt it for the TW-Highlighting plugin. I just haven't used that very much, so would need some help there.

I have some more exciting stuff coming along the pipe here soon. Watch this space. ;)

Best,
Joshua Fontany

Atronoush

unread,
Jul 17, 2020, 11:31:22 PM7/17/20
to TiddlyWiki
Many thanks Joshua.

Small issues

1. The first line is not highlighted
2. Type set and press tab, the below text will be displayed
<set name="variable" >
  
</set>

while it should display
<$set name="variable" >
  
</$set>

The same is true for other widgets.

Thanks
Atro

TiddlyTweeter

unread,
Jul 18, 2020, 11:21:21 AM7/18/20
to TiddlyWiki
Ciao Joshua

Visual Studio is a Good tool. Free. Can be installed as a portable application. Works well.

Its excellent to see your innovation.

Sure it would be Good to get it made highlights.js compatible so we can use TW code highlighting natively in TW. But I don't think its trivial to do so. I can't really grasp the methodology in highlights.js code templating.

Best wishes
Josiah

TiddlyTweeter

unread,
Jul 18, 2020, 11:51:40 AM7/18/20
to TiddlyWiki
It is a doddle to install in Visual Studio ... Fire it up. Go to your address & bingo!

Annotation 2020-07-18 174738.jpg


TT

Joshua Fontany

unread,
Jul 18, 2020, 1:27:18 PM7/18/20
to TiddlyWiki
Thanks for the Bug Report, Atro!

I have filed an issue on GitHub to track it:  https://github.com/joshuafontany/VSCode-TW5-Syntax/issues/6  

I haven't used many of the snippets myself, having borrowed them from one of my sources.

I probably just need to "escape" that character in the snippets file.

Best,
Joshua Fontany

_Phi / hpx1

unread,
Jul 18, 2020, 6:57:18 PM7/18/20
to tiddl...@googlegroups.com
thanks for the highlighter/autocomplete ! very useful.
here's a vscode snippet to automatically create metadata when you type 'tid' :
"tiddlerMetadata": {
        "prefix""tid",
        "body": [
            "created: $CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE${CURRENT_SECOND}000",
            "modified: $CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE${CURRENT_SECOND}333",
            "tags: ${1:spaceseparator}",
            "title: ${2:$TM_FILENAME_BASE}",
            "type: $0"
        ],
        "description""insert tiddler metadata"
    }

insert in vscode code snippets. type 'tid' and tab to autocomplete, it should create metadata field with current date UUID (use tab to change field) like so :
created: 20200719005201000
modified: 20200719005201333
tags: spaceseparator
title: Untitled-1
type:

it's useful when you create .tid or .meta manually in vscode
Reply all
Reply to author
Forward
0 new messages