WebStorm make text file instead needed - webstorm

After making *.jsx file WebStorm thinks that it is a text file:

Please ensure that this file (or a pattern that represents it) is not listed under
Settings → Editor → File Types→ Text files
For OS X
Preferences → Editor → File Types→ Text files

Related

WebStorm refresh file metadata after renaming

In WebStorm (2020.2.2) I accidentally named a file foo.jss and I renamed the file name to .js but WebStorm has not recognized the change. I already removed my .idea folder.
I appreciate any help or hint.
Focus the file in the Project View (just like you have on your screenshot).
Now invoke View | Quick Documentation: IDE will show a popup with file info. The info you are after is the File Type (how IDE treats this file).
I cannot say what the file type might be as it shows WebStorm's icon (never seen that before)... but .jss file extension usually stands for "JavaScript Style Sheet".
Now go to the Settings/Preferences | File Types, locate that file type in the top list, then look in the middle list (patterns) and remove such unwanted pattern (will be similar to the original file name before the rename).
If it's not under that file type... then also look through other file types, "Files Opened In Associated Applications" entry in particular (the idea based on the WebStorm file icon).
If such unwanted pattern cannot be found under any of the file types for some reason... then we need to look into the actual config files where such info is stored.

Adding a CSV file to a project in Visual Studio

I am working on a project where I have to read in serveral pre-existing CSV (dog.csv, horse.csv, etc.). I want to know how would I add these file into my project so that I may test to see if my print functions work (the code is written in c++). Would I have to copy and paste the files into the debugging folder or would I place it under the test folder of the project?
You can include the files in your project in whatever (sub)folder you wish by using Right click -> Add -> Existing Item. Then, right-click on each file and choose Properties. Set up "Copy to output directory" to "Copy if newer".
Then after build, your files will be copied into the bin/debug folder.
To read the file, you can just use:
System.IO.File.ReadAllText("dog.csv");
Another possible way is to add a file within project, right click and select properties, and then in Copy to Output Directory, select Copy always. This way, csv file will be automatically copied in your debug and release packages too.
string executableLocation = Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location);
string csvLocation= Path.Combine(executableLocation, "file.csv");
Above code will read file location from bin directory where your csv file will be stored.
This link should help guide you how to add CSV files to a project.
If you wanted to do a down and dirty way you could just save the CSV's somewhere on your local machine, and then hard code the file path to that location.
Example:
c:\test\Dog.csv and then set that as a variable for whenever you need to read in the csv file.

SAS Syntax Highlighting in Sublime

I would like to be able to use Sublime 3 as my SAS text editor but cannot seem to configure Sublime to do so. I've visited http://implementing-vdw.blogspot.com/2012/10/new-sublime-text-package-available-for.html and haven't been able to actually get the SAS syntax highlighting to work in
Sublime.
Here's what I did, I don't have/know github so I downloaded the zip file as instructed and placed its contents in C:\Program Files\Sublime Text 3\Packages\SAS. I closed sublime and reopened but don't see SAS as an available syntax.
I'm sure I need to perform another step or two but I don't know what.
Determined what the issue was, the 'Packages' directory where I installed Sublime Text 3 isn't the exact directory where you need to place the SAS folder. As a doublecheck to ensure you are placing the SAS folder in the correct location open Sublime -> Preferences -> Browse Packages..., this is the location where the SAS folder should be placed. Once done you will see SAS syntax available under View -> Syntax.
Here's how I got this to work:
download the zip file from the above blogspot location (I also tried
using git but got a publickey access error)
use Sublime -> Preferences -> Browse Packages to find the directory where this needs to be unzipped
unzip the zip file into the appropriate directory (on MacOS, it was ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/)
rename the unzipped folder to SAS
at this point, I can select the SAS syntax in Sublime via View -> Syntax -> SAS

Loading google.vim indent file in Vim

I am attempting to use the google.vim (and on vim.org) indent style for my c++ project, but I can't seem to load it. I installed google.vim using vundle and opened up a cpp file and noticed that my tabstops, shiftwidths, etc did not change. If you set global ts and sw parameters, are they not overwritten? How do you force a certain indention when editing a file in vim? I want everything in my vimrc file to be overwritten by the google.vim file when I edit a cpp file.
Running the :filetype command in vim reveals this information:
detection:ON plugin:ON indent:ON
The bottom line is that I don't understand how to tell vim to use my google.vim file located under ~/.vim/vundle/google.vim/indent/google.vim. From what I have read, vim detects that filetype of your current file and uses the appropriate .vim file for syntax and indentation. So would I then have to rename my google.vim file to something like cpp.vim?
In most cases I like to use a tabstop of 3 and a shiftwidth of 3, so I set these in my .vimrc file. However, when I edit a cpp file, I want all my settings to be changed from what I have set globally to what the google.vim file sets.
You must rename the file from google.vim to cpp.vim, as indicated in the description of the plugin on vim.org.
General explanation:
Adding filetype plugin indent on to your ~/.vimrc allows Vim to detect the filetype of the files you edit (usually based on the file extention) and source filetype-specific plugins and indent scripts.
The idea is simple: you edit a file with {{LANGUAGE}} filetype and Vim tries to source any ftplugin/{{LANGUAGE}}.vim and indent/{{LANGUAGE}}.vim it finds in your runtimepath.
Because the filetype of your file is cpp, Vim will blissfully ignore your google.vim indent script so… you must rename it to cpp.vim for it to work.
Or you could rename all your C++ files foobar.google and teach Vim to recognize *.google files but, well… it doesn't sound right ;-)

How to feed Visual Studio Clang-Format plugin with clang-format file?

So I downloaded, installed, and inserted into path the clang formatting plugin. I also tested it and it works for Google (Mozilla, etc.) formatting options out of the box, yet I cannot get it working with my .clang-format file. (I've put my file into the same folder as my source file, changed its encoding into UTF-8, also tried to put it into clang install folder, add file into project, write its contents inside '{key:value}' yet formatting does not happen). So how do you feed formatting file to chrome-format extension?
My file contents:
{ BasedOnStyle: "LLVM", IndentWidth: 4 }
My file name:nm.clang-format
Go to Tools->Options->LLVM/Clang->ClangFormat and put file in the Style option field.
Then place your style file named .clang-format (this is the full filename, not an extension) either in the source file's directory or one of its parent directories. Windows Explorer won't let you create filenames with leading . so you need to go to the console for this.
If like me you got confused later on where the .clang-format was living, use procmon to track the file reads of clang-format.exe
For the record, it seems that if both "Fallback Style" and "Style" are set to "file", no formatting will happen even if the style file is at its correct location. Setting "Fallback Style" to something different than "file" (e.g. "none") helps.
In VS2019 works if the clang-format file is named as .clang-format.
It must be .clang-format, not .clang-format.txt or clang-format.txt.