Changelog:
- [2021-04-22] v0.10.0 - Updated dependencies to get the extension working again. Typescript compiler is now 4.x, vscode 1.53 (Jan 2021). Could dissect versions further as it should run unmodified on earlier VS Code versions too, but took the opportunity to depend on built-in node v12 version and compile to straight async-await (es2019) instead of es6, from now on. It seems that template literal editor has been downloaded almost 30 000 times.
- [2018-04-09] v0.9.0 - Work around problems surfaced due to latest vscode text edits being slower than before. Fast edits could overlap, causing synchronization errors between editors, and the extension would close the literal editor for safety. Please report if it happens anymore. Also prevented an error condition when closing the literal editor where the original document could be reverted on error, or the cursor position could be synced on wrong document. In addition, avoids viewport scrolling when closing the literal editor -- scrolls only if the cursor is outside of the viewport. Note that the latest vscode seems to apply decorations later than previously, so editing will cause flicker as decorations are rerendered. One could perhaps fix this by tracking and syncing changed regions only, but that would be more bug prone. So let's wait if vscode will allow synchronous decorations, as it worked fine before. Happy editing, template literal editor has now been downloaded more than 10 000 times.
- [2018-04-08] v0.8.6 - Upgraded typescript parser to 2.8, affects only js and ts host document languages.
- [2018-04-08] v0.8.5 - Enabled for js template literals inside html files.
- [2017-04-25] v0.8.4 - Modified the default regexes for Erlang, F#, Julia, Kotlin, OCaml, R. Also added an informational message if a literal could not be found under the cursor with the current regex configuration. Should be quick to close with enter, but please complain if it is too intrusive for you.
- [2017-04-25] v0.8.3 - Added default regexes for OCaml, R, Scala, Visual Basic. If you are using any of the regexes (i.e. any other language than JavaScript or TypeScript) and would like to see some improvements (such as configuring multiple literal styles for a language via an array of regexes, or notifications also outside dev tools when literal could not be found with the configured regex) please make yourself heard by filing an issue in the repository. Also included the compiled extension to repository, so the repo can be installed directly if needed, and possible changes in typescript emit will be easier to diff.
- [2017-04-20] v0.8.2 - Changed the default keybinding of the rarely used close all literal editors action from Ctrl+Backspace to Ctrl+Shift+Backspace, as it shadowed an existing command.
- [2017-04-16] v0.8.1 - Published the repository to GitHub, so issues may be reported more conveniently. It should be straightforward to take in pull requests updating the default regexes, for example, but for further development such as a possible plugin system for parsing different languages more properly, consider taking a role in the repo, forking the extension, or just modifying it locally for your needs. If nothing major comes up and you are happy with the extension as is, I'll cut the 1.0.0 version soon.
- [2017-04-16] v0.8.0 - Now Ctrl+Enter on an already opened literal editor closes it, keeping the cursor position, so using only Ctrl+Enter is now enough for most use cases. Opening literals inside literals (such as editing code in a markdown block in a string literal) was not supported in any case, as all editors would need to be orchestrated to be simultaneusly visible for sync edits to work. Ctrl+Backspace is still available, and it closes all open literal editors, from any editor. Also it seems that closing literal editors automatically when reloading VS Code works now (at least it clears them), so there should not be stale editors left. And as a bonus feature remembers the last opened language as the default, for quicker use.
- [2017-04-13] v0.7.0 - Got tired of habitually hitting Save when working with template literals, so now saving the template literal editor results in saving of the original document, so for example build watchers work as usual. As this kind of saving override stretches VS Code API limits, please report if you experience issues so that the feature can be improved or possibly gated under a configuration flag. Also fixed syncing the initial cursor position inside template when there are wrapped lines.
- [2017-04-13] v0.6.2 - Uses new VS Code v1.11 API to set content of untitled documents so that template undo history won't include the initially empty document. As default Ctrl+Enter is now almost always better than using named documents, and a bit slower loading is not usually an issue as reloading is rarely needed due to sync working both ways, Ctrl+Shift+Enter is now deprecated and will be removed in a future version.
- [2017-04-12] v0.6.1 - Added default regexes for cpp, csharp, d, dart, eiffel, elixir, fsharp, go, groovy, lua, markdown, objective-cpp, perl, php, powershell, python, racket, razor, ruby, rust, bash/shellscript. They act as placeholder regexes that you can tune to your needs, as you may use different heredoc identifiers or perhaps even custom comments as delimiters or a C pre-processor via
define QUOTE(...) #__VA_ARGS__
. See "templateLiteralEditor.regexes" for defaults. - [2017-04-11] v0.6.0 - Now syncs also changes from original document, if changes don't touch the boundaries of the literal in focus. This means you can keep the editor open and jump between two side-by-side languages to get language support on both. Could not break it when smoke testing, but please report if you find major bugs affecting your workflow.
- [2017-04-09] v0.5.1 - Fixed a regression in syncing the initial cursor position inside template for convenience.
- [2017-04-08] v0.5.0 - Now simply "Template Literal Editor", as any language can be enabled for literal editing via configuration. For example, default "templateLiteralEditor.regexes.coffeescript": "(""")([\s\S]*?)(""")" enables literal editing in CoffeeScript. Other language literal matchers can be customized for your needs, just remember that the regexp needs to be in an escaped string form and have exactly three capture groups without gaps. Matching literals with regexes is fragile and certainly won't cover all development needs, so JavaScript and TypeScript is still parsed by TypeScript parser by default as previously, to find only the proper literals and identify the outermost literal if there is nesting, commented code, etc. Enjoy!
- [2017-03-29] v0.4.1 - Added an icon to package.
- [2017-03-28] v0.4.0 - Ctrl+Backspace or Ctrl+Shift+Backspace closes open template editors quickly. Alternatively you can use "Revert and Close Editor" action.
- [2017-03-27] v0.3.2 - Fixes CHANGELOG.md link and formatting in README.md. Have a nice day!
- [2017-03-27] v0.3.1 - Adds use cases, changelog, and notes/caveats to README.md. This extension is maybe feature complete as a proof-of-concept for now until VS Code Extension API offers new opportunities. Typescript dependency is currently "^2.2.1", but it could be "next" too, if the need arises.
- [2017-03-25] v0.3.0 - Adds a 100 ms delay when reopening untitled templates (Ctrl+Enter), so reopening should work better. Templates with filenames (Ctrl+Shift+Enter) are a bit faster and easier to identify for those who can use them. Both have their caveats in terms of undo behavior, unnecessary save dialogs, stale editors when reloading, and platform support.
- [2017-03-24] v0.2.0 - Pushes extension API limits and closes stale template editors automatically by clearing them first (so save dialog does not appear), and then quickly giving them focus, so they can be closed via closeActiveEditor action. In some circumstances this may result in your keypresses diverting temporarily to wrong editor, so beware, but it can be worked with.
- [2017-03-24] v0.1.3 - Experiment with viewport scroll sync. Seems not possible from an extension, unfortunately.
- [2017-03-24] v0.1.2 - Clears stale editors so that they can be closed without a save dialog appearing. Unfortunately the empty editors can be a bit confusing now as the helpful message is gone.
- [2017-03-24] v0.1.1 - Reuses stale editors so that reopening a template won't always create a new untitled document.
- [2017-03-24] v0.1.0 - Ctrl+Enter now uses another way to create untitled documents, which may work better on some platforms. Previous way of creating named documents is now Ctrl+Shift+Enter, use which one works for you.
- [2017-03-24] v0.0.4 - Add SQL keyword to description
- [2017-03-23] v0.0.3 - Add typescript as a dependency proper
- [2017-03-23] v0.0.2 - Activate for js and ts
- [2017-03-23] v0.0.1 - Initial proof-of-concept release