Everlaw / nbts

NetBeans TypeScript editor plugin
283 stars 46 forks source link

Hide generated JavaScript file #60

Closed idarous closed 7 years ago

idarous commented 8 years ago

Hello,

I'm developping a project with Netbeans and TypeScript. I use source maps and the commonjs module way. This is why for each TypeScript file I generate a JavaScript file and a map file.

The problem is that in my editor there are the TypeScript files but also all the files that are generated. Is there a way to hide these files in the editor ? If not, is it possible to implement this feature ? For example, with WebStorm you can show and hide the JavaScript and Map files generated for each TypeScript file. It will be very good if Netbeans has the same option. :)

jeffrey-easyesi commented 8 years ago

How does it work in Netbeans for other preprocessors, e.g. scss -> css?

idarous commented 8 years ago

For Sass preprocessors, you should specify in the project properties the directory that contains input files and the directory that contains output files. However, Netbeans displays the .scss and the generated css and css.map, but it not a problem beacuse all the generated files are under a only one directory that contains only generated files (that is not the same things when I use TypeScript to generate JavaScript files on using a commonjs module way).

This stackoverflow question gives an overview of the sass usage on Netbeans. http://stackoverflow.com/questions/25965982/how-to-use-sass-with-netbeans-8-0-1

jeffrey-easyesi commented 8 years ago

You can do the same thing in TypeScript by using the outDir option in tsconfig.json. For example, if your source is in ts/ and you want to write JS files to js/, you would put in ts/tsconfig.json:

{
    "compilerOptions": {
        "outDir": "../js"
    }
}
idarous commented 8 years ago

I know that, but my project is a little bit complicated , so even if I can use the outDir property of the tsconfig.json, for some reasons it more convenient to have the generated JavaScript files near to its TypeScript files.

With Visual Studio code, for example you can exclude each JavaScript files that comes from TypeScript files. http://stackoverflow.com/a/32604188

With IntelliJ and other Jetbrains IDE (like WebStorm or PyCharm), it's more easy because you can hide from the files panel the generates JavaScript files.

As far I know with Netbeans we can use simple regex to hide files that follow the patterns. For example in a full TypeScript project, we can use this tuto to hide all JavaScript and map files but JavaScript files that are not generated from TypeScript files are also hidden and it can be a problem. For example in my project, I have a gulpfile.js file.

jeffrey-easyesi commented 7 years ago

Hiding files is part of NetBeans, but it sounds like it's not powerful enough to do what you want. Since other language plugins for NetBeans don't add their own file-hiding functionality, I have to say this is out of scope.