JoosepAlviste / nvim-ts-context-commentstring

Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.
MIT License
1.18k stars 35 forks source link

Svelte only returns html-comment for all locations #100

Open runar-rkmedia opened 8 months ago

runar-rkmedia commented 8 months ago

Minimal reproducible full config

Just the minimal setup from the cloned repository

Description

All the locations return the html-commentstring.

Steps to reproduce

  1. run :TSInstall svelte and restart
  2. e: test.svelte and use content like below:

<script lang="ts">
    let foo = true
</script>

<h1>Header</h1>

<style>
h1 {
  background: blue;
}
</style>

3: run lua print(require('ts_context_commentstring.internal').calculate_commentstring{location = require('ts_context_commentstring.utils').get_cursor_location()}) at various locations, in the script-tag, html-part, and in the css. Could also try key gcc which should comment.

Expected behavior

I am expecting different commentstrings for each location.

Actual behavior

Same comment in all location (html-comment)

Additional context

This originally occurred in my nvim-setup based on astronvim.

stephanedemotte commented 3 months ago

Same here @runar-rkmedia did you find an alternative ? Thank !

runar-rkmedia commented 3 months ago

I am no longer experiencing the problem, although I do use astronvim with svelte-pack from astrocommunity, and it seems to work fine in this regard.