Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte only returns html-comment for all locations #100

Open
runar-rkmedia opened this issue Mar 18, 2024 · 4 comments
Open

Svelte only returns html-comment for all locations #100

runar-rkmedia opened this issue Mar 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@runar-rkmedia
Copy link

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.

@runar-rkmedia runar-rkmedia added the bug Something isn't working label Mar 18, 2024
@stephanedemotte
Copy link

stephanedemotte commented Aug 9, 2024

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

@runar-rkmedia
Copy link
Author

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.

@j95io
Copy link

j95io commented Nov 25, 2024

can anybody still reproduce this? I had the same problem of getting all HTML comments when I had an incompatible configuration of the highlight setting for treesitter, but once I changed that, it started working fine. Especially using the minimal config also worked for me.

@schmic
Copy link

schmic commented Dec 29, 2024

I could reproduce and fix this (for me) this morning.

So whoever might come along here, I was missing to install "typescript" and "scss" along with the "svelte" treesitter plugins.

:TSInstall svelte typescript scss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants