corneliusio / svelte-sublime

💡Sublime Text syntax highlighting for Svelte components
MIT License
58 stars 6 forks source link

update has broken the package #8

Closed dekdevy closed 4 years ago

dekdevy commented 4 years ago

Hello, when loading svelte files i get a crash with the newest update:

Error loading syntax file. Packages/Svelte/Svelte.sublime-syntax: Apparent recursion within a with_prototype action: 25000 context sanity limit.

Seems to be happening for all my files. Example file:

<script>
  import Window from 'client/ui/components/modules/widgets/Window.html'
  import { interaction } from 'client/stores/game.js'
  import { send } from 'client/net/socket.js'
  import { netSchemas } from 'core/schemas/schemas.js'
  import { imgAlpha } from 'client/util/support.js'
  import { fullInterp } from 'client/util/textinterpolate.js'
  function interact(i) {
    send(netSchemas.clientPlayerInteract.packData({
      id: i
    }))
    $interaction = undefined
  }
</script>

{#if $interaction}
<div class='l-upperLeftModal container uiscaled'>
  <Window title="Interaction" on:close={()=>{$interaction = undefined}}>
    <div class=container>
      <h3 class='textprimary name'>{$interaction.title}</h3>
      <p>{$interaction.text}</p>
      {#each $interaction.choices as choice,i}
        <div class='choice' value={i} on:click={e=>interact(i)}>
          <span>{@html fullInterp(choice) }</span>
        </div>
      {/each}
    </div>
  </Window>
</div>
{/if}

<style lang=sass>
  @import '../../variables.scss';
  .name {
    font-weight:bold;
  }
  .container{
    min-width:300px;
    max-width:400px;
    width: 30%;
    height:50%;
    z-index: $_CSS_ZINDEX_INTERACTION;
  }
</style>
corneliusio commented 4 years ago

Thanks for sending over an example file for debugging, definitely helps a lot. Oddly, I am not having the issue with this file.

Could you send me the current build you're using for Sublime?

Also, could you try uninstalling the Svelte package, restarting Sublime, and reinstalling the package to see if that possibly clears up any issues?

dekdevy commented 4 years ago

Sublime Build is 3.2.2 3211 Restarting and reinstalling unfortunately does not solve it.

corneliusio commented 4 years ago

I'm pretty sure I found the issue, do you by change have Java​Script​Next - ES6 Syntax installed? This syntax hasn't been updated in quite a bit and seems to cause this issue with quite a few other syntax definitions. I would recommend uninstalling it and using Sublime's built in Javascript syntax definitions (creator of Sublime also recommended this).

That said, I do believe I found a workaround that keeps the conflict from occurring. Could you:

  1. Download the recently pushed commit of Svelte.sublime-syntax in this repo
  2. Disable the current Svelte package (available option in the Command Palette as "Package Control: Disable Package")
  3. Place the downloaded version of Svelte.sublime-syntax in ~/Library/Application Support/Sublime Text 3/Packages/User (you can navigate directly to the Packages directory with the Command Palette by selecting "Preferences: Browse Packages)
  4. Then set the syntax of your Svelte file to the new definition.

If all goes as planned, everything should be working as expected. If the issue still occurs, could you send me a list of all of your third-party packages that are installed to help find any other conflicts?

Thanks.

corneliusio commented 4 years ago

I've gone ahead and published these changes and will assume issue is resolved if I don't hear back.