nuxtrdev / nuxtr-vscode

An extension offering commands and tools to make your experience with Nuxt more pleasant.
https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode
336 stars 13 forks source link

[Bug]: vueBase snippet doesn't follow script default language setttings #156

Closed cooldevdotcodes closed 1 month ago

cooldevdotcodes commented 2 months ago

Environment


What went wrong?

I set the default language for script tag to JavaScript as below

"nuxtr.vueFiles.script.defaultLanguage": "js"

but vueBase snippet still set language to TypeScript

<script lang="ts" setup>

</script>

<template>
  <div>

  </div>
</template>

How to reproduce it?

"nuxtr.vueFiles.script.defaultLanguage": "js"

zhaolinlau commented 1 month ago

@cooldevdotcodes May I know if you have installed another Vue 3 snippet extension? Because it works fine for me.

image

image

cooldevdotcodes commented 1 month ago

@zhaolinlau I've just checked it again. It works properly but it requires to restart VS Code or reload the VS Code window to take the effect.

zhaolinlau commented 1 month ago

@cooldevdotcodes for me, I don't need to restart lol

cooldevdotcodes commented 1 month ago

Sadly it doesn't work for me :-( Actually it doesn't work with all Nuxtr's settings, not just the script default language setting.

zhaolinlau commented 1 month ago

@cooldevdotcodes hmm... try using my PR one nuxtr-vscode-0.2.16.vsix.zip

cooldevdotcodes commented 1 month ago

@zhaolinlau I've just installed the extension from your ZIP file and it works perfectly.

BTW, vueBase snippet is missing in this one. I can only see vueBaseLayout snippet.

zhaolinlau commented 1 month ago

@cooldevdotcodes I think you were using the older version of nuxtr? Because I didn't change the snippet things, I only added a new functionality which is default language for nuxt files

cooldevdotcodes commented 1 month ago

Nope, I installed Nuxtr VSIX from your ZIP file. In your screenshot (https://github.com/nuxtrdev/nuxtr-vscode/issues/156#issuecomment-2346924328) I also can only see vueBaseLayout.

Screenshot 2024-09-14 at 3 57 21 PM Screenshot 2024-09-14 at 3 57 05 PM
zhaolinlau commented 1 month ago

I mean even I install the original one from vscode market, it also appears the vueBaseLayout only

zhaolinlau commented 1 month ago

Could you try uninstalling my version and reinstall the original one from vscode extension market?

zhaolinlau commented 1 month ago

@cooldevdotcodes the vueBase snippet got removed in 0.2.16 version of nuxtr

cooldevdotcodes commented 1 month ago

@zhaolinlau I tried to install v0.2.16 from VSCode extension market and Nuxtr default language settings doesn't work. Check my video shot https://drive.google.com/file/d/1fCvRCLP__A2SHJLvEBsjfKmwSyfyUtZ6/view?usp=sharing

zhaolinlau commented 1 month ago

@cooldevdotcodes Yes, because the feature is not existed in v0.2.16, #159 this is my pull request

zhaolinlau commented 1 month ago

If the author/maintainer of this repo merge my pull request #159 , then the feature will only be added in next release

zhaolinlau commented 1 month ago

@zhaolinlau I tried to install v0.2.16 from VSCode extension market and Nuxtr default language settings doesn't work. Check my video shot https://drive.google.com/file/d/1fCvRCLP__A2SHJLvEBsjfKmwSyfyUtZ6/view?usp=sharing

That's a vue file, u should change this setting image

adhamfarrag commented 1 month ago

Hello @cooldevdotcodes, @zhaolinlau

I feel bad to keep issues open but been having issues to respond sooner @cooldevdotcodes :)

Your original issue is clear, and will make sure next release has the issue fixed.

vueBase wasn't removed from Nuxtr or the PR @zhaolinlau made. There are changes regarding extension API and snippets, and I believe more snippets aren't working as expected.

2024-09-14 at 4  39 06@2x

@cooldevdotcodes As much happy I am to see the PR with a major change, it's always better to check the code and build the extension locally yourself after checking these changes instead of installing the VSIX. Please, use build and package script commands for this.

zhaolinlau commented 1 month ago

@adhamfarrag Because my PR is based on your latest commit, and the vueBase snippet is got removed from your latest commit

cooldevdotcodes commented 1 month ago

@zhaolinlau Is there any reason why you remove vueBase snippet? I see it more popular than vueBaseLayout.

zhaolinlau commented 1 month ago

The code block is gone @adhamfarrag

image

src/snippets/index.ts

zhaolinlau commented 1 month ago

@zhaolinlau Is there any reason why you remove vueBase snippet? I see it more popular than vueBaseLayout.

I didn't remove it lol, it's got removed by you

cooldevdotcodes commented 1 month ago

LOL, I'm not @adhamfarrag :-D

zhaolinlau commented 1 month ago

LOL, I'm not @adhamfarrag :-D

My bad XD, got removed by @adhamfarrag

cooldevdotcodes commented 1 month ago

@adhamfarrag Is there any reason why you remove vueBase snippet? I see it more popular than vueBaseLayout.

adhamfarrag commented 1 month ago

Hello @cooldevdotcodes, I didn't mean to delete it. :) Reopening the issue as I'll work on both issues.

adhamfarrag commented 1 month ago

Thanks for reporting this issue @cooldevdotcodes❤️ Pushed a fix and will be added to next release. :)