Show `.map` files under their respectives files in WebStorm/IntelliJ - intellij-idea

Using Filewatchers it's possible to show a generated file under it's respective source file:
The problem I am having is that only the generated .jsfile is 'watched' and grouped whilst the .map file still shows up separately. Is there a way to set it up so that both files are shown under their respective source file?

You need to modify your file watcher settings accordingly. Please make sure to set 'Output paths to refresh' to '$FileNameWithoutExtension$.js:$FileNameWithoutExtension$.map'

Related

How to get all files and folders recursively using GetMetadata activity

I need to delete many folders with an exempt list which has a list of folders and files that I should not delete. So I tried delete activity and tried to use if function of Add dynamic content to check whether the file or folder name is the same of the specified ones. But I do not have what should be the parameters #if(). In other words, to use these functions, how do we get the file name or folder name?
It is difficult to get all files and folders by using GetMetadata activity.
As workarounds, you can try these ways:
1.create a Delete activity and select List of files option. Then create a file filled with those path of files and folders need to be deleted.(relative path to the path configured in the dataset).
2.using blob SDK to do this thing.

IntelliJ - File watchers: wrong output of macros

I am trying to setup a file watcher for scss files which is working on files with a filename not starting with _.
But if I have a file named _file_name.scss the output of any macros that include the filename will be file.name.scss.
The first _ is removed and following ones are replaced by ..
Even though in the insert macros selection tool I can see that the output when you select a macro is correct.
Like $FilePathRelativeToProjectRoot$ will display mypath/_file_name.scss in the selection tool but then my command from this file watcher will output mypath/file.name.scss.
Am I missing a parameter here ?
Full configuration:
For me, existing file names are not changed when using similar file watcher. But files with names starting the _ are not prettified, the main .scss that includes them is processed instead.
To avoid this, try adding COMPILE_PARTIAL=true variable to your file watcher settings:
Also, make sure that Track only root files is off.
See the comments in https://youtrack.jetbrains.com/issue/WEB-13459

WebStorm's Safe Delete doesn't check XML file

I'm deleting a CSS file that is referenced in an XML file. I select "Safe delete (with usage search)" and "Search in comments and strings" but the reference in the XML file is not found.
The XML file is in a directory included in the project. The XML file contains the complete file name in a string.
Are there some settings for Safe Delete somewhere or something more general that might exclude XML files?
Thanks for any help.
<resourceSet name="HeaderStylesCss" type="css">
<resource path="~/Legacy/Content/Css/HeaderStyles.css"/>
</resourceSet>
path value is treated as simple string, so CSS file usage is not found and thus not taken into account when deleting a file.
You can try injecting File reference language in path="" value manually via Alt+Enter, Inject language or reference:
but paths starting with ~ won't work there, I'd suggest using relative paths rather than absolute

Need help on Pig

I am executing a Pig script, which reads files from a directory, performs some operation and stores to some output directory. In output directory I'm getting one or more "part" files, one _SUCCESS file and one _logs directory. My questions are:
Is there any way to control the name of files generated (upon execution of STORE command) in output directory. To be specific, I don't want the names to be "part-.......". I want Pig to generate files according to the file name pattern I specify.
Is there any way to suppress the _SUCCESS file and the _log directory? Basically I don't want the _SUCCESS and _logs to be generated in the output directory.
Regards
Biswajit
See this post.
To remove _SUCCESS, use SET mapreduce.fileoutputcommitter.marksuccessfuljobs false;. I'm not 100% sure how to remove _logs but you could try SET pig.streaming.log.persist false;.

load script from other file extension?

is it possible to load module from file with extension other than .lua?
require("grid.txt") results in:
module 'grid.txt' not found:
no field package.preload['grid.txt']
no file './grid/txt.lua'
no file '/usr/local/share/lua/5.1/grid/txt.lua'
no file '/usr/local/share/lua/5.1/grid/txt/init.lua'
no file '/usr/local/lib/lua/5.1/grid/txt.lua'
no file '/usr/local/lib/lua/5.1/grid/txt/init.lua'
no file './grid/txt.so'
no file '/usr/local/lib/lua/5.1/grid/txt.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './grid.so'
no file '/usr/local/lib/lua/5.1/grid.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
I suspect that it's somehow possible to load the script into package.preaload['grid.txt'] (whatever that is) before calling require?
It depends on what you mean by load.
If you want to execute the code in a file named grid.txt in the current directory, then just do dofile"grid.txt". If grid.txt is in a different directory, give a path to it.
If you want to use the path search that require performs, then add a template for .txt in package.path, with the correct path and then do require"grid". Note the absence of suffix: require loads modules identified by names, not by paths.
If you want require("grid.txt") to work should someone try that then yes, you'll need to manually loadfile and run the script and put whatever it returns (or whatever require is documented to return when the module doesn't return anything) into package.loaded["grid.txt"].
Alternatively, you could write your own loader just for entries like this which you set into package.preload["grid.txt"] which finds and loads/runs the file or, more generically, you could write yourself a loader function, insert it into package.loaders, and then let it do its job whenever it sees a "*.txt" module come its way.