I was trying to add JavaScript syntax and I can't find it.
Go to Sublime Text -> Preferences -> Settings and then in the right panel (Preferences.sublime-settings-settings -- User) remove "Javascript" from the "ignored_packages".
This version of Sublime does include a default Syntax viewer via a package. Verify that the file:
./Contents/MacOS/Packages/JavaScript.sublime-package
exists within your Sublime text install. (The above is for OSX. There is a similar path on Windows). If the file is missing, you may have to reinstall or find the package on the Internet.
A simple work-around would be to install a package such as https://packagecontrol.io/packages/JavaScript%20Ultimate. This has an improved syntax highlighter over the standard syntax highlighter.
Related
I recently started the official reactjs tutorial and noticed that the sublime text highlighting is completely screwed.
How can i fix this?
Install babel with the package control package, if you don't have it, get it here.
Open the package control, select install package, type babel, select it and press enter.
Setting as the default syntax
To set it as the default syntax for a particular extension:
Open a file with that extension, Select View from the menu, Then
Syntax -> Open all with current extension as... -> Babel ->
JavaScript (Babel). Repeat this for each extension (e.g.: .js and
.jsx).
Setting a Color Scheme
Babel comes bundled with Next and Monokai from Benvie/JavaScriptNext.tmLanguage. Select one from Preferences -> Color Scheme -> Babel
Follow this link to install the package manager for sublime text
Now to open the command palette, press ctrl+shift+p (Win, Linux) or cmd+shift+p (OS X). From the search results select Package Control: Install Package. Now find and select packages Babel and Babel Snippets.
Now to enable proper syntax highlighting for your JSX code, open your .js/.jsx file, select View -> Syntax -> Open all with current extension as... -> Babel -> JavaScript (Babel).
Installing the following sublime package should fix those problems:
https://github.com/babel/babel-sublime
Install babel via the package control. It'll fix the syntax highlighting and adds few more features.
check https://packagecontrol.io/packages/Babel
I have a Coffeescript project that I'd like to edit using Eclipse.
Many people suggested that I should install the Nodeclipse Coffeescript Viewer module in order to have colors and highlights.
I did install the module but I'm still getting a plain black and white file.
What should I do?
Thanks!
PS : I have Eclipse Luna under Win7.
Seems like you have not installed well, reinstall
http://marketplace.eclipse.org/content/nodeclipse-coffeescript-viewer-editor-eclipse-431
You would get editor for .coffee files by default.
Also Nodeclipse EditBox helps a lot to see indentation
If this is not a new file, right-click on it and look in the "Open With..." menu. Eclipse will reopen the same editor you used the last time for a given file.
I've been trying for some time to get SublimeLinter to start, but don't really see it do anything.
I downloaded it here: https://github.com/SublimeLinter/SublimeLinter
Installed with Sublime Package Control http://wbond.net/sublime_packages/package_control
It added SublimeLinter under Sublime Text 2 > Preferences > Package Settings
It shows me the README.md and it gives me a Package Control message where it says that SublimeLinter by default runs in the background.
But when I try typing in some syntax errors it doesn't say a word or hint that something is wrong. Nor when I save.
What's up? Where is the on-switch that I missed?
Thanks
I encountered this error on Linux when installing from package manager (old version). The solution was to download the last version from Github and manually copy it in packages folder.
You'll see that the size of the folder containing indexes for the language scanned (PHP in my case) is incrementing.
I just installed netbeans 7.0.1 in ubuntu 12.04, and there NO JAVASCRIPT support whatsoever. I am not getting any errors, but my .js files just appear as regular text files with no syntax highlighting.
My situation is different from this post because when I go to Tools -> Options -> Misc -> Files, under "Associated File Type (MIME)" i don't have an option for "text/javascript".
Also in my previous installation of netbeans, I could right-click on the "Source Files" folder of my project, select New -> other and I could create a new .JS file like this. But now there is no option for .js files. Only PHP (since i installed the PHP plugin), XML, SQL, CSS and a handful of others.
Another thing, I often embed javascript in .php files. My embedded js just shows up as plain text, no syntax highlighting.
I also checked for additional plugins for JS, but nothing jumped out at me as being the solution. Does anyone know how I can enable the JS file recognition and syntax highlighting?
Thanks!
** UPDATE **
This installation is acting very weird (when editing text, pressing enter has no reaction, no line return, nothing) so I will try re-installing, will update with results.
** UPDATE 2 **
Installed 7.1 for linux from the netbeans website and everything is working well. It must have been a faulty installation from the Ubuntu software center.
I was using Netbeans 7.0.1 on Ubuntu 12.04 64-bit. Installing Netbeans 7.1.2 fixed my color/syntax problems.
For those who need to re-install, here is the download page: http://netbeans.org/downloads/index.html
Be sure to check Tools -> Options -> Misc -> Files to ensure that everything looks right.
P.S. #jeffery_the_wind Thank you for your update! This had been driving me crazy today, and I googled for hours and couldn't find the solution.
Is there any tool to detect code duplication in JavaScript? I tried "PMD Duplicate code detector" but it is not supporting .js extension.
I would recommend JSCPD
Installation
npm install -g jscpd
Run
jscpd ./path/to/code
(you have several type of reporters, default is console, but you can use html like this: jscpd -r html ./path/to/code)
Other solutions:
JSinspect wasn't good for me because didn't support .ts and .tsx (jscpd supports 150+ formats
InteliJ IDEs (I'm a big fan of them) don't seem to work since WebStorm found no duplicated code.
You can use JS Inspect it detects copy-pasted and structurally similar code, also supports *.js
Installation
npm install -g jsinspect
Run
jsinspect -t 50 ./path/to/src
I would recommend looking at this thread (also on stackoverflow):
Javascript source code analysis ( specifically duplication checking )
IDE can have this functionality. I use IntelliJ, this IDE has a built-in duplicate code checking mechanism at 2 scopes:
Inline: Duplicate codes are underlined when opened in editor so that developer can easily catch and do refactoring.
Analysis: Go to menu Analyze->Locate Duplicates.., specify scope to run through and list all duplications.