Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jonForum

how avoid the auto-import vscode IntelliSense

Recommended Posts

Hi guys, i import the libs gsap from `npm` for only get @type description with intelisence.
But each time i use the tweenLite or tweenMax, it add this line to top of my file

import { TweenLite } from "gsap";

how i can remove this feature am pretty sure it comes from gsap because it not happen with my other npm libs @type . 

I use the npm only for get type description for intelisence, so i no need import each time i use it because am working on a node-webkit app, and i don't use import features, tweenlite are already injected in all the core app..

IHs8HidV_o.png

 

 

Also this should not happen because i exclude node_modules import in my jsconfig, but it seems no effect with your libs. !

 

{
    "compilerOptions": {
        "target": "ES6"
    },
    "exclude": [
        "node_modules","bower_components","temp","tmp","jspm_packages",
        "./js/__old/","./js/libs/"
    ]
}

thanks

Link to comment
Share on other sites

Sorry, I have no idea about what vscode might be doing (I've never used it) - that import code is NOT something that GSAP is forcing. I wish I had an answer for you, but I'm pretty sure this has nothing to do directly with the GSAP files. Perhaps someone else knows what might be going on? 

Link to comment
Share on other sites

i was think about gsap, because i not get this issue and behavior with other libs @type intalled in my node module.

all other libs here dont do this behavior ! and the import feature is manually , not automatic.
 

9ZBOAAsv_o.png

 

Only gsap do this ! 

Link to comment
Share on other sites

Do you know why it's doing that import automatically? Is there something in GSAP's files that you think is causing it? I've never heard anything like this before. Is this related to TypeScript definitions? Do you have them installed? I'm not very familiar with them myself, so I probably can't speak to any TypeScript-related issues, but I can assure you that there's no code in the GSAP files that's intentionally forcing vscode to add imports automatically to your project. Perhaps you should reach out to the vscode people and see what they say.  

  • Thanks 1
Link to comment
Share on other sites

thank i will do, and not i found anything that can cause this kind of behavior in gsap, and if you say you do nothing to force this kind of feature 
It will maybe something in vscode and my setup ! i will try check this in deeper.
Thank for your answer. 

Link to comment
Share on other sites

Indeed this is happening since the latest VSCode update and is more likely a VSCode thing and how intellisense (not too intelligent it seems? ;)) is working.

 

One solution could be to define global variables in your workspace or change the settings. Much like you I've seen this behaviour when working with VSCode, lucky me, in the project I'm working right now I'm using webstorm, so I don't have to deal with this for the next weeks :D, but still you could start an issue in VSCode repo or look in stack overflow.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

solved thank.
Just remove 'Unscope' the 

declare namespace gsap {

in all d.ts files, it work fine for me.

oEn2EORM_o.png

 

and than you will get intellisense work fine for all projet without import module :):)

BB9i9cnC_o.png

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×