How can I find out what file mode VSCode is using for an open file? - visual-studio-code

I was trying to get yapf configured for a Python project, and so I created a .style.yapf file, which VSCode did not recognize by its extension. I thought it was in TOML format, but when I changed the file association for .style.yapf to TOML, the parser shows an error (because values aren't quoted). So I tried changing the name of the file (not really a solution, because the tool is looking for a file with that name), and found that if I change it to a name ending in .cfg, VSCode seems to parse and highlight it appropriately. Unfortunately, there doesn't seem to be anything in the list of file associations corresponding to this file mode.
I expected to find a cfg mode in the file associations list, but there wasn't an entry with that name, nor was there an entry that used the same gear icon displayed next to the open file name in its tab (which I have been assuming is an indicator of the mode that VSCode is using to display and format the file).
Is there any way for me to get VSCode to tell me what the current file mode is for an open file? Or give me a list of the default associations?
I'm more interested in understanding the tools in general than solving the one minor annoyance that sparked the question, but I'll settle for a solution to that problem, too.
Edit: Here's the content of the .style.yapf file in question:
[style]
based_on_style = google
If I rename the file to .yapf.cfg (or any other name ending in .cfg, I believe), it gets handled properly, but all of the file associations I've tried (including ini, Properties, and TOML) indicate an error because there are no quotes around google.

Related

Unix file associations of mime-type with multiple extensions

Unix File Associations is a welcome new feature in install4j 8.
I'm trying to register multiple file extensions as file associations with the same mime-type with the install4j 8.0.1 Unix Shell Installer.
The "Create a File Association" action only seems to accept one file extension so I initially tried adding multiple of these actions with a different extension but the same mime-type. This seems valid, but when it translates into the actual installation of the application it appears that the mime-info XML files being made are named with the same mime-type and so all but one get overwritten. This leads to only one file extension being associated with the mime-type.
I've also tried various separators (space, comma, semi-colon) in the file extension field, but this just ends up as a single unlikely looking extension in the mime-info XML file!
(e.g.
<glob pattern="*.ext1,ext2" weight="60"/>
)
The mime-info XML format allows multiple <glob> elements, so the mime-info XML file could contain, e.g.
<glob pattern=".ext1" weight="60"/>
<glob pattern=".ext2" weight="60"/>
but I can't see a way to get to this from install4j8.
Is there a way?
As of 8.0.1, this is indeed not possible. In 8.0.2, you will be able to specify multiple extensions separated by commas. Please contact support#ej-technologies.com to get a build where this is already implemented.

Liquid-XML Editor Line Numbers for text files

I am able to open large files and it works great, however I do not get line numbers even though that option is on by default. It does for xml files, but a text file with .xml extension does not.
Any ideas on how to get the line numbers or maybe the software is not meant to do that?
The Large File Editor does not display line numbers.
It does have the concept of lines, so you can move to a specific line using menu Edit->Go to... (Ctrl+G).
Depending on your PCs specification, you may be able to open larger files without invoking the Large File Editor, please see:
Opening Large XML Documents in Liquid XML Studio

Doxygen-produced PDF - change url color?

I’m using Doxygen 1.8.10 (on Windows) to generate LaTeX files, and MiKTex 2.9 to generate a PDF. The PDF is functional, but not very pretty. I’ve figured out how to customize the title page (I added graphics and non-default text) and how to get the images into the PDF.
But... how do I change the styling for things such as the color of URLs (which are just text in the Doxygen comments, and then Doxygen turns them into \href items)?
**** I believe I need to change something in the hyperref package’s config or what Doxygen writes to the .tex files, but I’m not sure which approach is right, nor how to do either one...
I’ve created a custom_doxygen.sty file, and assigned it to the LATEX_EXTRA_STYLESHEET. I assume that it’s being picked up by Doxygen because Doxygen is successfully picking up my custom LATEX_HEADER file, which is in the same directory as the custom_doxygen.sty file. But what I don’t know is what to put into the custom_doxygen.sty file?
If I run everything as default (that is, no LATEX_EXTRA_STYLESHEET), the following code gets written to the refman.tex file:
% Hyperlinks (required, but should be loaded last)
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex,pagebackref=true]{hyperref}
\else
\usepackage[ps2pdf,pagebackref=true]{hyperref}
\fi
\hypersetup{%
colorlinks=true,%
linkcolor=blue,%
citecolor=blue,%
unicode%
}
And what I need is for the “urlcolor” to also be blue (its default in the hyperref package is magenta—an odd choice for sure).
I tried just basically copying what was in the refman.tex file to the custom_doxygen.sty file (and making sure that the custom_doxygen.sty file is assigned to the LATEX_EXTRA_STYLESHEET setting in my Doxyfile) and adding a “urlcolor=blue,%” to the setup section, but there’s no change in the output.
If I manually edit the refman.tex file (that is, I add "citecolor=blue,%" to the \hypersetup) after it's output from Doxygen, and then use the edited file as input to MiKTeX, I get the desired output.
So a workaround could be to just script the desired change and run the script every time. But it would be certainly be better to get Doxygen to write the necessary configuration. Plus, there are other things I want to customize (such as the font of explicit html hrefs), so I'd like to learn how to do things properly.

How to duplicate a Scala class in the same directory

I'm surprised that IntelliJ 13.1.6 can't do this.
I've tried the solution in this answer but it shows the pictured dialog without the ability to specify a file name. So choosing the same directory causes an error saying we can't create the file because it already exists (obviously -- I want to be able to rename it!).
It only applies to files with both an class and object (or multiple of either).
Is there anything I can do to duplicate a file or must I switch to explorer and do it there?

Eclipse find all in one file

In Eclipse (CDT), is there a way to find all occurrences of a string in a single file? I can search the entire workspace easily enough using Ctrl-H, and can do "find-next" using Ctrl-F, but I want to be able to see a list of all matches for just one file.
It would be possible to do by setting up a custom file filter for each file I want to search, but that's very clunky. Eclipse should be able to work out which file I have open and just search that file.
This seems like it should be easy, but I can't find an appropriate option...does it exist?
Use CTRL+H and switch to File Search as you already mentioned, but set Scope to Selected resources. Now you can either search the current file, or selected multiple files and search all of them