Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the programming language for syntax highlighting etc in Adobe Brackets editor?

I was looking for a code editor that uses a browser rendering engine for its GUI so I can work on code that handles various foreign languages in their native scripts.

I'm trying out Adobe Brackets but when I create a new file I can't find a way to set the programming language to get the syntax highlighting.

This happens for instance when I go to File / New then paste in code from somewhere like JSFiddle.

If I right-click on the name of the file in the left column there is a rename menu item, but it doesn't react so I can't add a .js extension for my JavaScript file.

There is an item in the status bar at the bottom right between the INS/OVR toggle and the lint indicator, but for a new unsaved file with no extension it is greyed out and cannot be changed.

There is a doc page titled Language Support but it seems to only cover deeper technical aspects, such as the editor's programming API.

How can I set the programming language? Is this editor just immature or is there a feature I can't find?

like image 673
hippietrail Avatar asked Sep 01 '14 06:09

hippietrail


People also ask

What languages support Brackets?

Brackets supports codes from multiple file types from C++, C, VBScript to Java, JavaScript, HTML, Python, Perl and Ruby.

How do you use Brackets in coding?

Brackets works directly with your browser to push code edits instantly, so your browser preview is always up to date while you're coding — no page reloads needed. In order to keep your current web browsing unaffected, Brackets Live Preview opens an additional copy of Chrome using a separate Chrome profile.

How do I run a Python code in Brackets?

Open the "Edit" menu and choose "Edit Builder". Find the reference to " python " in the Python section. Close and re-start Brackets. You should now be able to use the green arrow icon on the right side of the screen to run your programs in Python 3.

How does syntax highlighting change the program?

Syntax highlighting also helps programmers find errors in their program. For example, most editors highlight string literals in a different color. Consequently, spotting a missing delimiter is much easier because of the contrasting color of the text.


2 Answers

Currently, you cannot switch the language for untitled files. Once a file exists on disk, you can use the dropdown in the status bar to change the language (or just rename the file to a different extension, of course).

Sadly, the only reason it's disabled for untitled files is that the JS code hinting engine (which is quite complex) has bugs when it encounters untitled files. So really, only the JS language option in the dropdown needs to be disabled... but to avoid confusion, the entire switcher is disabled instead.

If you want to see that fixed, please upvote the feature request in the Brackets backlog.

like image 98
peterflynn Avatar answered Oct 03 '22 16:10

peterflynn


Try manually typing the file type when you save eg: index.html (including the extension) instead of just index

This worked for me!

like image 25
Andrew Avatar answered Oct 03 '22 15:10

Andrew