Qt Creator 4.3.1 code highlighting for custom files not working - qt-creator

I am using Qt Creator and opening TypeScript files using it but the code highlighting is not working. I used the "Import existing project" option to open a project that contains some .ts files, opened one of the files and the "a highlight definition was not found" error. Then I added *.ts to the patterns of the application/javascript MIME type but this didn't make the highlighting work. Then I tried renaming the file from filename.ts to filename.js but this also didn't make the highlighting work. How do I get the IDE to highlight my ts files?
Update: it seems that the IDE is highlighting ts files as html files.

It seems that this is a bug in the IDE. I submitted a bug report: https://bugreports.qt.io/browse/QTCREATORBUG-19449

Related

How do I activate syntax highlighting of an Xcode file template?

I’m creating a file template for a file with an extension that Xcode doesn’t recognise. Xcode doesn’t apply syntax highlighting to the file but I’d like it to. I would like Xcode to recognise the file as com.netscape.javascript-source even though the file extension isn’t .js (the file is actually jsonnet). I tried setting the AllowedTypes property of the TemplateInfo.plist to the UTI of JavaScript but that had no effect.
Alternatively, is it possible to define a new file extension for an existing UTI?
This question was answered on similar question.
It looks the only possible solution is to create a Cocoa Project that declares a new UTI.
Check those:
How to make XCode recognize a custom file extension as Objective-C for syntax highlighting?
Adding syntax coloring to Xcode for unknown file extension such as ".tcl"

Visual Studio not recognizing file after changing from erroneous extension

I've been struggling with this for a couple of hours and then I just fixed that.
Problem is, when I was creating another .cpp file I misspelled the extension with .cp and then I immediately changed that file back to .cpp with Visual Studio's rename file feature.
The linking just stopped working after that. It was saying to me that i have unresolved external. My .h file couldn't be linked with that .cpp file which I renamed from .cp.
Somehow, when I created the file with a wrong extension, VS remembered that and even after renaming that file back to the correct extension, it still didn't recognize it.
I fixed my problem by just creating a new .cpp file (this time without an error), and everything just started working.
Has anyone experienced that before? Someone probably knows but I have not found anything related to this problem yet.
If you acidentaly typed wrong extension when creating C++ file then to make VS treat it as C++ file you should right click on the file item in Solution Explorer, open Properties dialog and change Item type on General tab from does not participate in build to C++ compiler (or to C++ header if it suppose to be a header file).

Typescript will not properly compile in VS2012

For no clear reason, Typescript has suddenly stopped reliably compiling into JS code.
Using VS2012, Typescript for VS ver 0.8.3.1 and Web Essentials ver 2.6 (set to "Compile on Save").
I can create a new Typescript file and make simple changes to it (such as export a simnple var or function). I can save TS file and see the JS translation.
HOWEVER, once I add one or more TS definition files (I'm using AMD) and then edit the TS file, NO FURTHER CHANGES APPEAR IN THE CORRESPONDING JS FILE. Edits to the TS file will no longer update the JS. Typescript no longer checks for errors either.
Only when I close and reopen VS2012 will the proper JS file finally appear.
I've uninstalled/reinstalled Typescript, Web Essentials and VS2012 to no avail.
Does anyone have any suggestions on how I can fix this problem? I'm at a loss.
EDIT
This is an entirely reproducible condition. Today, I formatted my drive and re-installed VS2012 anew. USING 64-bit version of Windows 7. Created a new MVC4 project. Created a new TS file. Added a couple of definition files. Attempted to edit the default getDist() function. Saved. No update to the JS file. Removed the definition files. Saved. JS file is properly updated as expected.
IT'S IMPOSSIBLE TO IMAGINE THAT I'M THE ONLY ONE EXPERIENCING THIS PROBLEM!!
Please help!
RE-EDIT
Problem solved. See below.
it happened to me,
i solved this issue by setting the build action of the ts file to TypeScriptCompile
Please see : Preview pane for TypeScript missing and/or not updating in VS2012/13
Also check that there are no compile errors in the TS files - a language update can create an error without you noticing, and the new version of WE simply does not update the preview pane like it used to.

Exporting a Property Sheet in Visual Studio?

Sometimes when working on projects that people have posted online, I have to frantically modify my own property sheets to match theirs in order for my project to work (things like: MTd, linker stuff, Unicode/Multibyte settings).
I was wondering if I could just export a property sheet in Visual Studio for later use instead of creating one from scratch.
Not if you use their project file, its settings are "last" and override anything you'd set in a project property sheet.
Nothing that you couldn't fix with a text editor btw, open the .vcproj or .vcxproj file with, say, Notepad to see how you could delete settings so a property sheet can work. Or copy/paste settings from your own project file.

Export Visual Studio Template error: "Unable to read an exported file"

When exporting a Visual Studio project to a Template (File/Export Template...) I get the following error upon clicking the Finish button:
Unable to read an exported file for the following
reason: The file cannot be opened with the selected
editor. Please choose another editor.
Screenshot http://img687.yfrog.com/img687/1756/templateerror.png
A Google search for this error has only led to several dead ends. There aren't any unusual file types in this project. Any ideas what could be going on?
By laborious trial and error (start with an empty project, add a folder, try to export template) I was able to narrow this down to a single Javascript file. As it happens, it's one of the language definitions for prettify.js (which is used on this site for code coloring). The file in question is lang-hs.js, and for some reason Windows on my machine treats this file differently from other Javascript files: It opens in Notepad, when I have the .js extension mapped to Visual Studio.
I'm not sure what the underlying explanation is, but I've already wasted enough time on this and I believe I can live without Haskell code coloring (!) so I'm just deleting this file and moving on.
It seems ".cur" files are often a culprit in this error. I have removed them from my project and now the exportation works correctly.
Microsoft staff suggest looking at log files (../windows/system32/compmgmt.msc) but this error does not spawn an entry into the Application EventLog.

Resources