Visual Studio Code include single file on excluded path - visual-studio-code

I have configured Visual Studio Code (VCS) to exclude the imported directory and all code under it using:
"files.exclude": {
"**/imported": true
}
This imported folder is very large, containing many large code bases. It is excluded for performance reasons.
However I want to still include some imported library interface files so they can be source indexed.
For example, I want to still include imported/library-a/library-a-interface.h to simplify development using these interfaces (structure fields shown in the editor, etc).
Is this possible? if so how?

As of VS Code 1.15, we don't have a good story for this. We are tracking the issue here

Related

VS Code resx file extension

Seems like there is no way to automatically create and manage resx files in VS Code now. Does someone know extension for it?
P.S. Yeah, I know that I can edit resx file as bare xml, but it`s not a right way.
The problem with resx is that it uses a Visual Studio "Custom Tool" to generate the code for the resources, and so requires Visual Studio to function fully.
I've been working on a replacement to resx that should also work from VS Code. It uses json rather than xml to define the resources, but otherwise behaves much like a resx file. The json resources file uses a ".resj" extension, and has a very simple structure. It currently only supports string resources that can be defined either inline in the json, or in an external file reference.
The project is open source on GitHub here:
https://github.com/MarkPflug/Elemental.JsonResource/
This is available as a nuget package "Elemental.JsonResource", currently only pre-release. Simply add this package to your project to enable using resj files. It doesn't add a runtime dependency to your project, everything is done at build-time. My hope is to provide feature-parity with what a resx file can do, but it could be useful even in its current state.

How can I refactor file names in Visual Studio Code?

Is it possible to refactor the name of the files in a project and automatically update all the imports, without caring about breaking something each time a file name is changed?
In the same manner as in the JetBrains' products. You change the file name and everything is automatically updated.
Actually you can. Natively on Visual Studio Code (>= v1.28) with import path renaming:
Or with some extension like Move TS.
Sorry, but the answer is just simple: No, you can't.
At least not currently. It's up to the authors of the language modes to implement such things. There is support for the occasional variable refactoring here and thereā€¦ And there are some additional extensions in the JavaScript space that support method extraction and stuff, but none of them handles filename refactoring.
This should be easier with VSCode 1.53 (Jan. 2021):
Improved Refactor Participants UI
Extension can participant when use create, move, rename, or delete files.
This is useful to automatically run refactorings, e.g. when renaming a Java file you also need to rename its public class.
There is now unified UI for these participants which allows you to accept, skip, and preview additional changes an extension is making.

Importing source files and folders into IAR Workbench

I have a cup of source files in a certain folder structure in my file system. I want to use this structure for a project in the IAR Workbench. Thinking of Eclipse, that could be so easy! But in the IAR Workbench, the folders will become to "Groups", which are only kind of virtual folders. The Workbench doesn't care about folders.
Is there some easy and fast way to import them?
Up to now I have to add the groups manually each and then add the files to the groups, and that's really annoying!
Is there maybe a tool to generate a proper project file (*.ewp) out of a file/folder structure path?
This would help me a lot!
You should have a look at IAR Project/Add Project Connection command.
Although IAR doesn't seem to have any public documentation on the xml syntax, or at least I couldn't find any, you can find Infineon DAVE (Config.xml) and Freescale PE (ProjectInfo.xml) files if you search around. These can be used as examples to figure out the syntax on how to write your own xml files in one of these interfaces, to allow you to specify where all your c, h, assembly and library files are from where ever they may be in your file system. They also allow you to define preprocessor includes for compiler/assembler, and DAVE allows you to define a path variable, which is also very useful.
See: https://mcuoneclipse.com/2013/11/01/iar-arm-v6-7-comes-with-improved-processor-expert-support/
I have modified a DAVE Config.xml file and found it EXTREMELY useful for managing and migrating even just a handful of project files. For example to upgrade to a new release with all files having a new directory root, you just change a single line in the xml file (defining the new root), and all source files, compiler includes etc are all updated to the new level. No more manually editing the preprocessor includes or replacing all the files in the project. And no more fiddling around with ../../ file system hierarchy navigation stuff, you just specify directly (or indirectly via a path to) where the files are, no more relative from where your project happens to be. VERY NICE.
IAR should consider opening this up (documenting) for general users, as it is very useful for project management and migration. While at it they should also consider generalizing the xml syntax a little bit and allow for definition of IAR group heading names, specifying linker file name, and definitely allowing multiple xml files to be included (connected) (so that subprojects can be easily added or removed without effecting the other subproject definition files) and a few basic things like that.
If they where to do a bang up job on this, they might consider allowing most/all aspects of IAR project configuration that might be required by the subproject, to be defined in these xml files, and then entire (sub)projects could just be plopped down anywhere and be up an running extremely quickly (OK, just let me dream a bit :)
For anyone who happens upon this you may want to check out https://github.com/IARSystems/project-migration-tools. They have a tool for pulling in file trees here.

How can I configure Visual Studio Code to recognize files with extensions other than .js as Javascript

We have a QA tool (SmartBear's TestComplete) that uses javascript as a scripting language, but names the file with a ".sj" extension instead of ".js". I would like to use Visual Studio Code to edit those files, with all the nice intellisense and other tooling that comes with it, but I can't figure out how to configure it to recognize .sj files as javascript files. Any ideas?
Answering my own question, just for future readers that may be searching for the same thing.
According to a tweet from #code, this is not yet possible, but is coming "soon".

Grouping Files in Project Explorer in Eclipse

I am newbie to Eclipse, I am planning to use it for AVR development with WinAVR and gcc.
The feature I am looking for is the grouping of different files in the project, like all headers together, all source files together and all files excluded from the build together etc.
I tried AVR Studio from Atmel, it has this grouping feature but it lacks several other features which Eclipse supports. Any help to configure Eclipse Project explorer to display the project files in this way would be appreciated and helpful for me to decide the IDE to use.
Note: I know that I can manually add different folders for each of these groups and move the files, but that moves the physical files, and breaks the relative path in the code, and other comilers/IDE's. I am looking for logical grouping of files.
Unfortunately there is no general way for a user to configure the grouping in the Project Explorer, the grouping is setup based on the code that controls the content (i.e. CDT, JDT, etc). I think it would be interesting to have this feature, but it's not clear the UI that can be used to specify it. You are welcome to submit an enhancement request to add this to the Eclipse Platform UI project. And giving an example of how it's done in another product would be helpful.
Thanks Francis, looking at your profile I think I found the right person to solve my issue :)
I have opened it as a bug (as I could not find a feature request in bugzila) Bug 296514 - Logical Grouping Files in Project Explorer in Eclipse
I have attcahed screenshots of both AVR Studio and Eclipse project explorer. That should give you an idea of what kind of UI features I am requesting. I can difinetely provide more information if you want.
I think what you are looking for can be done with Working Sets.