Skip to main content

Hiding JS and Related Files While Working with TypeScript : Visual Studio Code

While I was exploring Angular 2, following their Tour of Heroes tutorial, I was excited to see it is using TypeScript. As we know, TypeScript is not directly supported by browsers. It has to be transpiled into JS code for it to work. Good thing, the guys at Google has come up with a startup kit when developing Angular application ( instruction how to get it here ). Now you dont have to worry about manually transpiling TypeScript codes to JS, the package will do that for you and a lot more ( BrowserSync, yeah). With that being taken care of, you only have to worry about your TS code. Because the transpiled files reside on the same folder, these files may cloud up your Visual Studio Code file list. I asked StackOverflow ( Google for devs haha ) and got a working solution, pronto!

FileList Before the Fix

The Fix

  1. Edit VSCode Preferences.
  2. Edit Settings. This will open the settings.json file. You can either edit the User Setting or the Workspace Setting.
  3. Search for the "files.exclude"
  4. Add the following values :
    "**/*": true,
     "**/*.js": {"when": "$(basename).ts"}
Note : The extra arguments on the last entry make sure that we only hide JS files when a file with the same base name but with a TS extension is present.

The Resulting List

Now you can concentrate on the TypeScript files. Enjoy coding!



Popular posts from this blog

Hiding Unwanted Python Folders and Files in Visual Studio Code

Visual Studio Code is a universal editor and pretty good at it. However, the explorer view maybe cluttered with the automatically generated folders and files confusing developers. Python is no different. Below are example files and folders generated by Python.

The __pycache__ folder and *.pyc files  are totally unnecessary to the developer. To hide these files from the explorer view, we need to edit the settings.json for VSCode. Add the folder and the files as shown below:
Copy and paste the lines below :


renaming default namespaces for VSTO projects in VS2008

So here is the scenario , you are starting a VSTO project and decided that your default namespace is ExcelAddInTesterApp . You created the project and started coding the project. After several days , your boss called and said "hey marvin , make use of this namespace OurCompany.ExcelAddInTesterApp , we have to add our company name to it got it?" . You get back to your machine thinking its just a simple property just like any project you've been working on. So you right clicked the VSTO project and hit properties . Boom! What the F@#$? The default namespace textbox is disabled!!!!

I've been through this and I googled for ways to do it and ended up with a blog from a Microsoft MVP telling me it can't be done because it is disabled. Then I thought of Refactoring, the beauty and grandeur of the renaming process. I selected the namespace and hit the refactor menu hoping that this would solve the problem . Unfortunately , it did not rather it displayed the message box …

Getting Started with Stateless : A Lightweight Workflow Library Alternative for .NET

A year ago, I was looking for a simple workflow manager for a project I was working. Its a medium sized application that involves tracking the state of assets in the system. Back in 2008, Microsoft (MS) introduced new technologies along with the release of Visual Studio 2008: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and Windows Workflow Foundation(WF). Having worked in a company utilizing mostly MS products for development, my first option was to go with WF. After doing some time reading and studying the library, I paused and decided it was too complex for my requirement. Using WF would be an overkill and the fact that it has, a rather, steep learning curve, there has to be another option. My mind toyed with the idea of developing a simple workflow library myself. It would be a learning experience but it might end up consuming a lot of time.

Why reinvent the wheel? So I started querying the internet for a better solution. I stumbled upon Stateless