nuxt / components

Scan and auto import components for Nuxt.js 2.13+
MIT License
885 stars 48 forks source link

vetur support #110

Open michaelschufi opened 3 years ago

michaelschufi commented 3 years ago

I enjoy not having to import all the component files. Though, it seems to me, that a lot of the Intellisense stops working if I do not explicitly import a component in the script tag.

Is there any generic solution for this to be able to use the auto-importer but still have props autocompletion and peeking?

nvthuong1996 commented 3 years ago

you can use webstorm instead vscode. :))

lttr commented 3 years ago

This issue is even more visible with the new version 2. Then you have component names that does not match file names.

pi0 commented 3 years ago

We already have basic vetur support (https://github.com/vuejs/vetur/pull/1921) but it requires a full restart in case of any changes. Any contribution to this are more than welcome.

It is also possible to investigate list of auto-generated components from 'components/readme.md`:

image

md preview in vscode:

image

BTW we are aware of this inconvenience. Planning to work on a robust UI solution to browse discovered components :)

stieben commented 3 years ago

Please excuse my ignorance, but is there a way to describe the tags and attributes discovered by the auto-importer, for hover information in the editor?

pi0 commented 3 years ago

if there is an easy way to notify vetur extension .nuxt/vetur/tags.json is updated I think so yes :) /cc @octref if you have any hint for doing this.

SimplyCorey commented 2 years ago

I've added this code to the vetur.config.js file

const fs = require('fs');
const components = JSON.parse(fs.readFileSync('./resources/nuxt/.nuxt/vetur/tags.json', 'utf8'));
const globalComponents = Object.keys(components)
    .filter((name) => !!components[name])
    .map((name) => {
        return {
            name,
            path: './resources/nuxt/' + components[name].description.substring(19),
        };
    });

To work around the issue. I am trying to find a way to auto-reload the VLS server on a file watcher change and have been unsuccessful.