question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement 'Synced Regions' for Svelte

See original GitHub issue

HTML for VS Code recently introduced Synced Regions for HTML tags. In summary, if you edit an opening tag, the same edits appear in the closing tag and vice versa.

This API is available for other extensions as of two weeks ago.

This is an issue to track the implementation of Synced Regions for: (Tip: | is the cursor)

  • Svelte markup (e.g <div|></div|>)
  • Svelte control flow (e.g {#each| n}{/each|}).
  • ** Svelte classes & ids (e.g <div class="apple|"></div> <style> .apple| {color: red}</style> )
  • ** JavaScript
    • <script> let world| = "" </script><div>Hello {world|}</div>.
    • <script> import Component| from "./component"</script><Component|></Component|>

** Syncing JavaScript and CSS classes and ids is iffy since I can imagine wanting to edit a variable/class without changing others in many situations. I haven’t experimented with how flexible the LinkedEditingRangeProvider API is, but if possible, we could require a key-binding to get into synced mode for these contentious regions. Requiring a key-binding will likely hurt feature discovery + usage of syncing for these regions, so discussion of other possible implementations is very welcome.

I’d suggest four separate settings options for HTML, flow control, CSS and JS. Where HTML & flow control are on by default, but CSS & JS are off by default.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dummdidummcommented, Mar 10, 2021

This feature is now live for html tags. Still not sure if other areas are valid use cases.

1reaction
jasonlyu123commented, Dec 26, 2020

The markup part would be easy to implement and it probably is what it’s designed for. The svelte control flow is viable but probably only possible when there’s no syntax error in the file. The proposal of CSS class name, id, and javascript identifier feel more like a rename symbol to me. We already have it for javascript but not CSS. And about the partly rename you can always use multiple cursors to achieve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Svelte integration - Javascript CRDT based real-time sync
SyncedStore works seamlessly together with Svelte Stores. Create a Svelte Store from your SyncedStore using svelteSyncedStore from the @syncedstore/svelte ...
Read more >
Svelte Tutorial for Beginners: the {@html} tag - YouTube
If you have a html string and you want to insert it into your Svelte component, you may be looking at the {@html}...
Read more >
Svelte I18n | internationalization Library for Svelte - Morioh
svelte -i18n helps you localize your app using the reactive tools Svelte provides. By using stores to keep track of the current locale...
Read more >
Create a Map in SvelteJS Using FusionCharts
Maps are used to plot geographical data like revenue by regions, population by state, ... npx degit sveltejs/template my-first-svelte-project
Read more >
SvelteKit 1.0 | Hacker News
Svelte is a frontend framework, which you can use to build anything from a full SPA to a single button. SvelteKit is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found