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

Unrecognised Vue Directive in Jet Brains IDE when using floating-vue directive #991

Open
nirpan opened this issue Oct 8, 2023 · 3 comments

Comments

@nirpan
Copy link

nirpan commented Oct 8, 2023

This issue might not be directly a FloatingVue issue but I feel like it is related to at least raise it and hopefully get some pointers on resolving it.

When using FloatingVue with the install plugin option and then using it within the components, we get an warning Unrecognized Vue directive on all the JetBrains IDE (PHPStorm, WebStorm, Ultimate).
CleanShot 2023-10-08 at 11 58 12@2x.

If we use the directive method of installation, then that warning is not displayed.

This issue has been logged with YouTrack and has a specific example with FloatingVue (https://youtrack.jetbrains.com/issue/WEB-52855/Vue-3-Custom-Directives-not-being-picked-up-by-IDE-if-defined-on-App-object#focus=Comments-27-6228126.0-0).

The solution suggested seems to be the library to provide a WebType definition (https://blog.jetbrains.com/webstorm/2021/01/web-types/) or a temporary fix to not show the error on the JetBrains IDE by creating a web-types file to hide all warnings for the directive. I have created an added the web-types to the package.json which hides the warning but I was wondering if there was a better solution that might even provide autocomplete when using the directive?

{
    "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/v2-preview/web-types.json",
    "name": "hellWorld",
    "framework": "vue",
    "version": "1.0.0",
    "contributions": {
        "html": {
            "vue-directives": [
                {
                    "name": "tooltip",
                    "description": "Floating Vue directive",
                    "doc-url": "https://floating-vue.starpad.dev/guide/",
                    "argument": "tooltip"
                }
            ]
        }
    }
}
Copy link
Owner

Akryum commented Oct 11, 2023

Would having TypeScript types help solve this? I'm not really familiar with Jetbrains IDEs

@nirpan
Copy link
Author

nirpan commented Oct 11, 2023

@Akryum I think it would as normally the suggested solution for these sort of issues is to install types. You can see package like bootstrap-vue auto generate it: https://github.com/bootstrap-vue/bootstrap-vue/blob/dev/package.json#L16C11-L16C11

@Acetyld
Copy link

Acetyld commented Dec 4, 2023

Also a bump for me, indeed it would be good to generate + publish this. Floating-vue is currently leading in the popper/dropdown/tooltip market in vue. Please add this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants