Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Autocompletion problems in VSCode.

Discussion in 'Project Tiny' started by illinar, Jan 12, 2019.

  1. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    857
    upload_2019-1-12_22-25-33.png

    The folder is properly opened. Project compiles. VS Code doesn't see many classes or namespaces. Errors disappear when I reload VSCode, but reappear if I edit any file or go to it from unity. Same happens with any file I edit or go to.

    This is breaking my workflow completely, unfortunately.

    I have the same issues when using normal ECS and have any asmdef files present anywhere in the Assets folder.

    Is there any solution?


    Do I need some VSCode plugin?
     
    Last edited: Jan 12, 2019
  2. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    857
    Removed all the sample projects except one, and now it works.
     
  3. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    120
    Hey @illinar,

    We've seen VSCode act weirdly depending on the OS and the load on the machine (sometimes IDEs take a while to update). Just wondering did this problem occur in the middle of creating a Tiny project or have you just recently installed it and tried playing with the samples.

    Also, if this problem occurs frequently and repeatedly please update this post.
    Thanks!
     
  4. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    857
    I'm on Windows 10. I can easily reproduce it. Seems to occur only with multiple.. umm.. subprojects, build configuration files or whatever they are called.
    • So, step one. I have one sample (GalaxyRaiders) in the project and nothing else. It works perfectly fine.
    • Step two. I duplicate it and go to VSCode the new GalaxyRaiders1 now works perfectly fine but the original one doesn't work, doesn't recognize those same namespaces and types.
    • Step three. I reload the VSCode and now the GalaxyRaiders works and GalaxyRaiders1 doesn't.
    Thank you.

    P.S. That's good news because I don't need more than one utproject there.
     
    Last edited: Jan 13, 2019
  5. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    120
    VSCode will only recognize the namespaces and types with the Tiny project that is currently opened. If you switch projects you will not get the autocomplete unless you switch projects within the Unity Editor.
     
  6. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    857
    Thanks. I suspected that. Although I couldn't confirm when I tried to load different projects and see if autocompletion is working inside them. I could have been doing something wrong though.