From the beginning, I should have neatly placed all my components in a components folder, just like my services and models and directives, but I didn't...
In a large project, is there a way of simply transferring all the scattered components and services and models and directives into such directories without having to resolve all the ensuing issues, such as changing ./componentName to ../components/componentName, or do I have to deal with the move/relocation manually one by one?
I thought if you move a file/folder in VSCode (by dragging) the imports would be adjusted automatically, but they don't.
I also have the Angular Essentials extension installed, but that doesn't do that either.
Is there a way to deal with move import adjustments automatically?
I don't know for sure if there is a way to do this using the terminal (probably it exists).
But in VS code, you can simply rename the component to include the folder you want to use as a container and everything will be updated automatically.
Let's say you have some like:
And you want to move the component named 'single-value-card' to the 'visualization' folder.
Then all you have to do is to rename the component folder as shown:
And voilá:
Note: After renaming, VS Code will ask you if you want to apply the reference refactor. As I've answered 'Always apply the reference update' (or smth like that) it never asked me again
Related
Most of my projects have files scattered in different directories. I am just checking out vs code and am wondering if there are sufficient project management features to suit this need.
Ideally, it would have a way to place files from different locations into a named 'group'. The group could be opened and closed (I mean brought in to view, or loaded into vs code) easily via a pick list. A file could be moved from group A to group B; the file location on disk would remain the same, just it's membership in a group would change. I would want the relationsip between the groups and the related files to be savable so that the same groups and associated files would be accessible after vs code as been closed and the opened again.
vs code looks very capable, but I've only gone over a few tutorials and haven't use it for anything real yet. It does say it's file and folder centric, and OS level folders are not how these files are organized. Maybe there is a feature I've not seen yet or a plugin.
I too was looking for something similar, but unable to find a solution. I did find a work-around though. There is an extension called File Group that allows creating a group of file with full path to locations of each file. New to vsCode myself, it took me a while to figure it out, but worth the effort. Hint, once installed, go to settings, Extensions, File Group and Edit in settings.json to add your file list.
I created three files, one material, one enum, one blueprint actor. In blueprint actor, I created a dynamic material instance to access material and a variable to access enum as a dropdown list. This functions all work fine, but when I move these three files to others' PC, the blueprint actor become doesn't work, the dynamic material instance lost material parameter and the type of the variable I created are not enum anymore. Is that means I have to set these parameters every single time when I move these to other places? Anyone can help? Thanks in advance!
BTW, I want to use the stuff I created as a tool and share with others if every time the parameters have been setted again, it is really annoying.
When you change the structure of a project, Unreal engine leaves behind small files called "Redirectors". These preserve the structure of your project and are mere hookup points so references are not lost.
You can finish the job by right-clicking in the folders you refactored and selecting "Fix-up redirections in folder". This will remove the redirectors and perform a thorough run through the blueprints, structs and data assets to make the references consistent.
Please note that sometimes, interfaces can stop recognizing certain types (structs in particular). In those cases, the workaround is to just change the attribute type to the same struct and recompile the interface.
Copy-pasting files from one project to another can be done directly from the Explorer, as long as you copy all the references (the ones that are not copied will be broken) and paste them in exactly the same hierarchy. This means you need to copy the files and replicate the folder structure starting from the base Content folder. It can be tricky, yes, but you can just right click > Asset Actions > Migrate, which will copy the files preserving both the folder structure and the references.
I am developing a couple of packages for sublime text, and to avoid copy and pasting massive amounts of code I began to move my classes into separate files. I have been avoiding this so far, since, in my current workflow, changes to files that are not in the main plugin file won't get updated when saved and only go into effect when I restart sublime.
Is there a way to reload a package, including all it's files, without restarting Sublime Text?
You don't actually have to restart the editor. You will have to restructure your plugins though to take advantage of this. Essentially, you can load the plugin files from some top level file. As an example, take a look at Package Control. I also do it in PersistentRegexHighlight (though the package control solution is likely more robust (I did base it on that). Still not as good as simply saving a particular file, but better than restarting! In fact, you could probably tie into the on_post_save event to automatically save the top level file when you modify a child file.
I personally found the easiest solution was to install Package Reloader, and just put a new file in the top directory of my plugin named .build. Save your top-level plugin file and enjoy not having to restart.
Virtually no restructuring of code required.
From the unofficial docs:
Sublime Text will reload top-level Python modules from packages as they change (perhaps because you are editing a .py file). By contrast, Python subpackages won’t be reloaded automatically, and this can lead to confusion while you’re developing plugins. Generally speaking, it’s best to restart Sublime Text after you’ve made changes to plugin files, so all changes can take effect.
Unfortunately, plugins are not loaded into a scope visible from the console (Ctrl`), so you can't just reload() it. EDIT But, you can call reload() from within your top-level plugin file, as detailed in #skuroda's answer.
You'll have to make the decisions on when to break classes out into separate files vs. keeping them together in one monolithic collection. Having 50 files, each with only two or three function definitions is overkill in one direction, while having 20 classes each with 10 or 15 methods all in one file is going overboard in the other, so just do what feels best for the particular project. In my experience killing/restarting ST2 doesn't take too long in any of the supported operating systems (except on XP, for some reason...), so hopefully it's not too much of a delay on your workflow. One suggestion I'd give is to create a portable installation (if you're on Windows) with just the bare essentials in extra plugins if your startup time is too long.
Good luck!
Is it possible to create StarTeam shortcut, opening project and overriding working directory?
Is it possible to create one StarTeam shortcut, opening several projects at a time?
Problem is: I have several solutions, which use the same StarTeam project, and I have to manually change working folder very often (View -> Properties -> Working folder). It is not possible to share data between solutions: local view should be located in separate place for each solution.
You could create different views for each project. Different views can have different working folders; in fact, they do by default. Keep in mind, a view can be set to behave pretty much the same as the default view, with regards to which revisions of files you see. But they can have their own working folders. The downside of this technique is that Change Requests and the like will also be "in the view," so moving them will not necessarily affect other views. But given that you are working on an entirely separate projects, that might not be all such a bad thing. As usual, you should experiment with this in a test project, and make sure you're happy with the behavior, before using it on your "life" repository.
The override/alternate directory for each project and folder is maintained inside a local file - not on the server. The default working folder is kept on the server, and any time you update it the changes are propigating to all other users.
The shortcut xml has no place to specify a working folder.
If you don't need the StarTeam GUI, stcmd allows you to specify a new working folder for most operations with the -rp and -fp flags.
If the projects that need this common library code are in their own views, you could also share the common project into a new subfolder within those other projects. You can use a relative path for this new subfolder that includes .. to move it outside the containing project's folder. This lets you use common code in many projects while allowing you to specify the location of that common code per project.
Shares come with some overhead, so be aware, but other than that it would probably work for what you're trying to do.
I am developing for the iPhone and the prevailing advice on auto-generating files from entities, when using Core Data, is to select the *.xcdatamodel file and the create the new file(s) etc. This creates the *.m and *.h files in the Resources directory. These are then moved to the Classes directory or a subdirectory of Classes.
However, when viewing my github repository I notice that all of the model files which have been auto-generated in the above mentioned way are present on the root of the project folder (as if they were a resource).
The underlying file structure may or may not matter (I'm unsure on this point) but I would like to make my repository less disorganised. I can see entropy taking over as the project gets much bigger and there are more files to contend with.
My question is therefore: is there a way to organise the underlying file structure without messing up the project settings or the way github sees the project?
I hope the above isn't unclear and I look forward to your replies.
Yes, this is possible. The Xcode groups (the yellow "folders," like your Resources) are completely independent of the file system - they don't directly represent directories. If you select a group and go to File -> Get Info, you can select the base path for that group of files. You can create and select a new folder through the file chooser there.
Once you do this, all the files in that group will go red - Xcode can no longer find them through the new path. Use the Finder (or Git) to move them into your new directory, and all should be well.
Xcode defaults to placing new Managed Object classes in the folder that the model is in, so new resources will get placed there automatically.
As a sidenote, I highly recommend Rentzsch's Mogenerator to handle Managed Object class creation. It divorces Xcode's auto-generated code from your custom code, and then automagically regenerates the template code every time your model changes (without losing your own code).