TiddlyWiki5 Syntax in the Visual Studio Marketplace, By Joshua Fontany

I’m just working with some TW + NodeJS stuff, and finding that my VS Code editor is suggesting a great TW5 syntax plugin.

Thanks @joshuafontany for creating this!

7 Likes

It auto suggested it for you? Cool! Very glad it is useful.

1 Like

Bump. v2.0.0 has been released!

3 Likes


I usually add a line like this to my project

1 Like

procedure and conditional syntax is supported, thanks for the update!

1 Like

That’s cool. Perhaps we should add a .vscode directory to the TW5 repo, and include a recommendation for tw5-syntax. Are there other features that would be helpful to include?


Another place is the mapping of the info file

1 Like

Update v2.0.2 posted.

  • Merged all snippets/snippets.json fixes from @pmario
  • Fixed “named filter run prefixes”, i.e. :anything, and “shortcut filter run prefixes”, i.e. +|-|~|=

THANKS!

I was able to find out how to include this in the plugin’s /contributes section. Automatic JSON highlighting for all *.info and *.files files!

Thank you for the update @joshuafontany, it is highly appreciated. A small request if you have time, support for detecting indented macros/procedures.

Example code:


\procedure saveNewWikiActions()
    \procedure saveNewWikiCallback()
        \procedure failureHandler()
        <$action-log status="error saving new wiki to the server"/>
        <$action-setfield $tiddler={{{ [[$:/temp/webdav/error/]addsuffix<now [UTC]YYYY0MM0DD0hh0mm0ssXXX]>] }}} text={{{ [[There was an error creating the new wiki. ]addsuffix<error>] }}} component="WebDAV save new wiki" tags="$:/tags/Alert"/>
        \end failureHandler
    <$list filter="201 204 :intersection[<status>]" variable="null" emptyMessage=<<saveNewWikiCallbackFailure>> >
        <$action-sendmessage $message="tm-notify" $param="$:/plugins/sq/webdav-utils/ui/templates/wiki-created" path=<<destinationURL>> />
        <$action-deletetiddler $filter="$:/temp/sq/fs/new-wiki-template-url $:/temp/sq/fs/new-wiki-name"/>
        <$action-sendmessage $message="tm-webdav-ls" $param={{{ [<destinationURL>split[/]butlast[]join[/]trim[/]!is[blank]addsuffix[/]addprefix[/]] :else[[/]] }}} />
    </$list>
    \end saveNewWikiCallback
<$wikify name="myplugins" text={{$:/plugins/sq/webdav-utils/templates/new-wiki-plugins}}>
    <$action-sendmessage
        $message="tm-http-request"
        method="PUT"
        bind-status="$:/state/webdav/http-status"
        oncompletion=<<saveNewWikiCallback>>
        url=<<destinationURL>>
        body={{{ [<data>addprefix<myplugins>] }}}
        var-destinationURL=<<destinationURL>>
        >
</$wikify>
\end saveNewWikiActions
1 Like

Mahalo (thanks). Clean example code like this makes it much easier to test these types of updates.

Update 2.0.6 released just now (give it 5 minutes).

2 Likes