grails development: eclipse vs. intellij idea - javascript

I downloaded sts and installed the grails/groovy plugins which is fine, but I can not use the JavaScript functionality like jumping through classes and functions in the JavaScript editor.
When I click command and on the functions name, I get a dialog saying "you have to make this a JavaScript project etc." :( :(
intellij is much better at this I think, but it takes all my cpu usage which is really sad :( so I need to switch to eclipse...
My question is: Why can't I use the JavaScript editor plugin from eclipse when my project is a "grails project"?

Eclipse's JavaScript editor is part of the Eclipse Web Tools Project (WTP). Thus, it's shipped with SpringSource Tools Suite (STS).
In new STS Grails projects as created by the Grails project creation wizard, however, the JavaScript project facet is not enabled by default.
To enable it,
right-click on the project root in the Project View,
select Properties,
in the Properties dialog, select Project Facets,
click Convert to faceted form...,
mark the JavaScript checkbox,
and click OK.
After that,
there will be a new top-level item JavaScript Resources (where you can browse the sources of ECMA and third-party JavaScript files),
and there'll be code inspection and completion in HTML <script> tags
and JavaScript source files (file extension: .js),
including for third-party libraries.

Related

Eclipse for PHP Developers - Javascript Content Assist and Tasks Not Working

I'm using Eclipse IDE for PHP Developers Version 2020-03 (4.15.0) on Windows 10 Home, 64-bit.
When I create a JavaScript project (or create a PHP project and convert it to a JavaScript project) and edit a .js file or type JavaScript code between tags in an .html file, Content Assist is not giving any suggestions for built-in JavaScript objects or methods, and task tags (like TODO) are not showing in the Tasks view.
Content Assist will suggest functions, variables, objects, and methods created in whatever .js file is currently being edited, but it won't suggest any built-in JavaScript objects or methods unless they've already been used in the file (in which case it treats them as user-defined). ECMAScript Built-In Library, JavaScript Web Project Support, and ECMA 3 Browser Support Library are all included in the project's JavaScript Include Path. I can expand the Libraries under "JavaScript Resources" in the project tree and double-click on any of the entries to open the .js files that contain the definitions for the built-in objects and methods, but Content Assist doesn't suggest any of them when I type and press ctrl+space.
The Tasks view shows task tags in .php, .css, and .html files, but not in .js files. If I add a task tag in a .js file (like "/TODO Fix this/") the tag is highlighted correctly (syntax highlighting in .js files works), but it doesn't register as a task (the task icon doesn't appear in the gutter to the left of the line number the way it does in .html, .css, and .php files).
I've been searching for solutions for hours but everything I find either doesn't work, says to change a setting that's already set correctly, or doesn't apply to this version of Eclipse.
I tried using an older version of Eclipse (Oxygen.3a) and it does exactly the same thing, so I'm assuming I'm doing something wrong?
EDIT: Some answers for older versions of Eclipse that I wasn't able to find on my own showed up after I posted this (such as Eclipse: Content Assist not showing suggestions). I tried downloading an even older version of Eclipse, Mars.2, and everything is working correctly in that version. Are the issues in Eclipse 2020.3 just "bugs"?

How to add Javascript file into Eclipse?

I am using Eclipse Oxygen.
I have web features already installed, I think some packages are missing for javascript files.
When I try to create a new javascript file, I see that there is no javascript file. How to add this feature into eclipse?
screenshot:
You just look in the wrong "folder" ("Web") to create a new JavaScript-file, the proper path is "JavaScript > JavaScript Source File".
You can also take advantage of the search in the Wizards when you type the desired search term at type filter text.
You must be using a perspective, which is not suitable for web development.
Try opening a perspective which suits your development domain. Web and Java EE perspectives for example supports JavaScript development. If such is not available in you Eclipse installation, you have to install additional tools. Which Eclipse package are you using?
In the right perspective you will have the JavaScript Source File option in the New pop-up dialog right clicking your project or an appropriate project folder (eg. WebContent).

Visual Studio project for Javascript,HTML and CSS website with debugging

I'm developling a pure front-end based application in the webbrowser. What I'm using is Javascript (jQuery, Knockout), HTML, CSS (bootstrap). So there is no backend, there is no need for it. In that respect, I can't find a proper project template in Visual Studio (up to 2017). All I can find is either ASP.NET MVC, or Javascript Window Apps. I think those project don't match my goal. I do only want javascript, but not targeting the windows platform, but the browser. I do want a web project, but I do not require ASP.Net.
What I have so far is a blank solution, add existing project, selected the root folder. All files are there in a web project which can be launched via Visual Studio. But I can not debug javascript code this way. Or I do not know how.
So the question is, is there any matching project template I can use, or how do I debug the javascript code?
Sorry, but not just simple Javascript. You can create empty ASP.Net Web site and use it for HTML, CSS, and JavaScript programming. The Webconfig file provided by ASP.NET enables debugging in Visual Studio (or you can use F12 tools when you run the app).
You can create an empty ASP.Net Web site and use it for HTML, CSS, and JavaScript programming.
Actually VS2017 also has the new feature debug the JavaScript.
https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

How to show new JavaScript file option in Intellij?

I following along a Node.JS Tutorial
The instructor is using the IntelliJ IDEA to create a demo server side application with Node.JS.
The first step in the tutorial is to create a static Web Project. With the help of Static Project , I was able to accomplish the task by installing a plugin for that feature.
The next step in the tutorial is to create a new JavaScript file in that project. The instructor was able to do this by right clicking the project name -> new -> JavaScript File (show below)
However when I tried to do the same, here are the options I received (selected option is new)
Does anyone know what plugins I have install to get the JavaScript File option? I tried doing a Google Search but didn't find anything. I also took a look at Editor but I am not trying to tell Intellij to treat another file type as a JavaScript file.
JavaScript support is only available in IntelliJ IDEA Ultimate. It looks like you're running IntelliJ IDEA Community Edition, which does not include JavaScript support.

Code folding in Netbeans for javascript

I just recently started using Netbeans, and i have been working with javascript files, the files are becoming large, and i want the ability to group function in something like this in visual studio, actually code folding.
#region
code goes here
#endregion
After a search i found out that you could use
//<editor-fold>
</editor-fold>
http://wiki.netbeans.org/FaqCustomCodeFolds
but this does not work with .js files, as it's treated like a comment.
Please advise, how to add custom code folding in Netbean on javascript files.
Currently the custom code folding is not supported on javascript files to the current editor.
But will soon be implemented in the new editor in the official distribution of netbeans,
That allows you to edit your javascript files, with all features currently available in other programming languages.
New JavaScript Editor
But if you can not wait more, then you can download the Develoment Version of NetBeans
Implementing the new editor, without losing your current project settings.
Also you will can create your template code, for make a surround block code. Explained in this link.
And this is the new editor in test

Categories