Master VS Code: Workspaces

Поділитися
Вставка
  • Опубліковано 23 лис 2019
  • Want to master VS Code? Click here: andrecasal.com/courses/master...
    Want to upgrade web dev skills? Subscribe to the newsletter here: andrecasal.com/posts
    I hope you've enjoyed this video!

КОМЕНТАРІ • 41

  • @AnthonyJackman
    @AnthonyJackman 4 роки тому +2

    @andre, Thank you for the video training here. It took someone 'drawing with crayons' for me to understand the difference levels of code-workspaces and how they are managed. Please keep teaching!

    •  3 роки тому

      I'm very glad it was useful Anthony, thanks! 👍

  • @FredrickLackey
    @FredrickLackey 4 роки тому +2

    Great video. Quick answer/suggestion to your question of how to handle parallel workspace files. The way I handle this is with a more traditional approach / hierarchy using a "component / project / solution" hierarchy. Within my source folder (~/Source or C:\_) are three folders ... components, projects, and solutions. Every component has its own repo and can be anything from a reusable library to a web UI for an app. They all exist by themselves and have their own workspace. The next level up is "projects" which is parallel to components. As with each "component", each "project" has its own repo. There is one project repo for the body of work and acts as the umbrella to the components. This is where I keep project-level documentation and artifacts. Most of the source code in the project repo is more for setup and deployment of the individual components since each is configured based on how they relate to the overall "project" they are being used within. And, as you may have guessed, each project repo has its own workspace which contains the relative paths to the individual component projects. The beauty of this pattern is that my components folder is filled with repos which I use but my view, within VSCode, is filtered to show only the components which are relevant to the actual "project" i am working with at the moment. When I need to spend my day working on a DIFFERENT project, I may see the codebase for a few of the components again, but that is only because those components are being used in that project as well.

    •  4 роки тому +1

      Hey Fred, I think I get it, but I would love to see a screenshot of your folder tree. It does seem like a smart workaround. Could you shoot me an email so we can get into contact (check the about section of my channel)? Cheers mate!

  • @bobbysilver272
    @bobbysilver272 2 роки тому +3

    I didn't realise I was confused about workspaces until I saw this video. Sadly now I know I am confused even after watching this video :-(

    •  2 роки тому

      Hey Bobby, that's both great and too bad 😅 Is there any concept I can help clarify?

  • @danielsears1522
    @danielsears1522 4 роки тому +1

    This is a very helpful video. At 9:00 you talked about the folders array and you found that by default VS Code creates a .code-workspace file *outside* of the workspace. Then you moved the file into the workspace and edited it to change the location of the workplace root folder to ".", the current directory. I played with this and found that you can use absolute paths (e.g. "/opt/salesproj"). Relative paths probably work as well. In fact, I think the .code-workplace file can be located anywhere as long as the paths in the folders array make sense. I tried to take this a step further and use an environment variable, but JSON doesn't accept environment variables even if Javascript does (e.g. process.env.SALESPROJ_HOME).

    •  4 роки тому

      Hey Daniel! Yeah, the .code-workspace file accepts relative or absolute paths, but doesn't seem to recognise environment variables. I haven't tested with this with the latest versions. Either way, it makes more sense to me to have the .code-workspace file inside the repository itself with a relative path of '.'

  • @brookster7772
    @brookster7772 9 місяців тому

    As a Visual Studio (not code) user I have also been struggling with this "little" issue for years now. Visual Studio has a "Solution" concept that does the job. And What about "Profiles" we need to fit that into the picture. Would love if you can do an update video. keep up the great work your doing for the community! Cheers Mate.

    •  2 місяці тому

      Thanks mate! Frankly, I've just given up trying to use codespaces at all. I just keep independent VS Code windows opened, one for each repo.

    • @brookster7772
      @brookster7772 2 місяці тому +1

      @ Yup me too.. thanks man!

  • @adrianswebvideos
    @adrianswebvideos 4 роки тому +1

    Thanks for the video
    André, it's been helpful and given me much clearer understanding of a workspace. It seems that a workspace is essentially an index or table of contents which allows you to group folders which you want to work on at any given time while allowing settings to be configured for how VS Code handles those folders/files. This is similar to a Visual Studio solution file. The solution file, at its simplest form, is a grouping of projects with certain settings applied. This would explain why the workspace file was created one directory above the "andrecasal.com" folder you mention at 9:10. I would guess that a workspace could be created anywhere(relative pathing aside) since it is simply a grouping of references to folders, but by default, is created one folder above the folder you are in when you create it.

    •  4 роки тому +1

      Hey Adrian, that's exactly right, good way of putting it. My gripe is not so much with the file being saved one folder above, it's the fact that if you select a specific folder to save the file in, VS Code will save it one folder above whatever you selected. I was searching VS Code's github for the relevant issue, but now I'm wondering if I ever actually submitted this issue to the VS Code team 🧐 I'll let you know when I do.

    •  4 роки тому +1

      I just checked and this problem has been solved in the latest version of VS Code Insiders 1.47 (which means that even if it isn't yet fixed in VS Code, it will pretty soon).

    • @adrianswebvideos
      @adrianswebvideos 4 роки тому

      @ How was it resolved?

    • @frederic_millenial
      @frederic_millenial 4 роки тому

      @ I didn't see anything about workspace in v1.47 release notes. Can you elaborate?

  • @ramesherrabolu1590
    @ramesherrabolu1590 2 роки тому

    Bit new to VSCODE and IDE's. I am wondering how I can build a workspace that has only a subset of the folders in the workspace i.e. I want to have only some of the child, grand-child, great-grant-child folders. I would like the workspace to reflect this working organization. In VSCODE I seem to be able to add individual folders but they get added at the same level i.e. they don't maintain the folder hierarchy. Any ideas on how to do this

    •  2 роки тому

      Hey Ramesh. If you open the top-level folder, you'll see all folders within it. But I seldom use workspaces anymore, they are too cumbersome. I prefer to use a single folders instead. You also get some benefits for doing that, like workspace level settings being applied to that single folder. Useful if you have two VS Code windows opened and want to change the top-bar color for client and server, for example. This wouldn't work with a workspace.

  • @naineshrathod2392
    @naineshrathod2392 3 роки тому

    when I open vs code it shows me the folders and files of the last time I was working on, is there any setting so that whenever I open vs code its empty ??

    •  3 роки тому

      Hey Nainesh, checkout "window.restoreWindows": "none" and "files.hotExit": "off".

  • @deepalmoon
    @deepalmoon 4 роки тому +2

    First 5 minutes was very good. Then the presentation got a bit confusing and tedious to follow along. But those 5 minutes were very useful. Hopefully the author whiteboard or use a few info-graphics to explain what he is doing.

    •  4 роки тому +1

      Hey Deepal, thanks for the feedback. I agree the video is too long and I could have explained this in a shorter video. I might record another one if something changes with the workspaces.

  • @Metruzanca
    @Metruzanca 2 роки тому +1

    Personally, I always prefer to use legacy single folder workspaces. I'd usually use something like peacock to help differentiate the windows or just only keep one open that I'm currently working on. Though, I'm considering trying out vscode workspaces, however i think that npm workspaces suit my needs a bit better.

    •  2 роки тому

      Agreed, workspaces doesn't work well for me either. Single folders feel more practical. Peacock is a nice choice. Personally I prefer to set my own colors manually.

  • @hcgreier6037
    @hcgreier6037 Рік тому

    Now I'm more confused than I was before....🤣

    •  Рік тому +2

      Apologies for that 😅 VS Code's documentation has changed a bit and this video makes less sense now. I'll record another one 👍

  • @blameItleaveit
    @blameItleaveit 3 роки тому

    which font is that on your vscode ?

    • @meer_kat5158
      @meer_kat5158 3 роки тому

      Fira Code

    •  3 роки тому

      That's actually Operator Mono with ligatures 😉

  •  3 роки тому

    Tho I consider this a clear explanation of how to work with workspaces settings, I didn't get what that is and what do I gain from using this feature.

    •  3 роки тому

      I've since realized that implicit/unsaved and explicit/saved workspaces are only useful for some edge cases like having both the code and the documentation repositories opened. In most of my work I never use them. So the usefulness has more to with knowing how and why settings are applied within each folder/implicit/explicit workspace context and less to do with actually using them. Personally I'm almost always in the single folder workspace mode.

    •  3 роки тому

      I might have a use for it: my own "framework" is in one folder and I've got many project all refering to it.

    •  3 роки тому

      @ Are you using a *.code-workspace file for this? If so, what do you use it for?

  • @Norfeldt
    @Norfeldt 3 роки тому +1

    Good presentation. Regarding the saving of workspace folders with version control I would suggest you to look into dotfile management dotfiles.github.io/ - the TLDR ; make a git repo for your entire Mac user root, gitignore everything except the dotfiles of interest.

    •  3 роки тому +1

      Wow, that's an incredibly awesome idea Norfeldt, thanks for the tip!

    • @Norfeldt
      @Norfeldt 3 роки тому +1

      André Casal thanks. Can't remember if it has to be a 'bare' repo. - you might want to check that out

  • @ken30096
    @ken30096 2 роки тому +7

    This video over complicates VS Code Workspaces. For a much more concise explanation see the video "Workspaces in VS Code on Windows 10 Explained" at the following link: ua-cam.com/video/W4xLtxLSm-o/v-deo.html

  • @robitops1547
    @robitops1547 3 роки тому

    Totally confused Settings, Everything goes over my head.
    (Cool ha? )

  • @akemp06
    @akemp06 3 роки тому +1

    You should script your videos before you tape them. You are more confusing than helping. The stuff you showing is all correct but the jumps you do are not easy to follow.

    •  3 роки тому +1

      Thanks for the feedback Alexander and I'm sorry this isn't the easiest to follow video. If there's anything I can help you clarify, please let me know.