• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Format Java Script code and have auto suggestions like its for Java in eclipse

 
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I work with Java in Eclipse , I can easily format the code using control shift F and then that makes it readable and easily understandable. Also, it gives easy auto suggestions for suggested keywords etc.

I have been working on Java Script in both Eclipse and Visual Studio. However ,the problem I face, is that am not able to get the formated code as I could do with control shift F for Java. What's the preferred way for these while working on Java Script in project .

Thanks

 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There may be JS plugins for those IDEs, but I've never used either of them (even when I am writing Java).

The most common IDEs used for JS development today seem to be WebStorm or IntelliJ from JetBrains, or VS Code from MS. All have top-notch JS integration.
 
Marshal
Posts: 3655
516
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can find the default VSCode keyboard shortcuts here which includes format-document and format-selection:
    Windows
    Mac
    Linux


 
Saloon Keeper
Posts: 24325
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse has plug-ins for almost everything - including Java.

Joke.

Eclipse is really just an OSGi framework and the "Java IDE" that most of us think of as "Eclipse" is actually just a spin that has Java plugins pre-installed. Or JEE, if that's the spin you choose. There are plugins for C/C++ (including a full spin), JavaScript, Python, Unix Shell Scripts and even COBOL and LISP. Often the hard choice is determining which one of several similar plugins to install and use. I think that I'm using "Eclipse Java Web Development Tools", myself. While JavaScript is certainly not Java, there's enough syntactical overlap that it's for one set of plugins to support both.

While the IntelliJ world has lots of plugins, last time I checked, Eclipse had more. IntelliJ is like traditional Apple. It does the important things very well, but doesn't try to do everything. Eclipse is more like Unix, in that it's not as well-focused on specific common tasks, but it makes up for it by being more open-ended. Which one is preferable depends on your needs. I like to run debugging sessions that dig intol multiple apps and servers in a single session, and IntelliJ couldn't handle that last time I looked, but it's second-nature for Eclipse. Conversely, I've never seen a good WYSIWYG Swing editor for Eclipse, but it's built into IntelliJ. And JetBrains has done considerable pioneering work in their own right. Consider Kotlin, for example. There's a Kotlin plugin for Eclipse. Provided by JetBrains.
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Eclipse has plug-ins for almost everything - including Java.

Joke.

Eclipse is really just an OSGi framework and the "Java IDE" that most of us think of as "Eclipse" is actually just a spin that has Java plugins pre-installed. Or JEE, if that's the spin you choose. There are plugins for C/C++ (including a full spin), JavaScript, Python, Unix Shell Scripts and even COBOL and LISP. Often the hard choice is determining which one of several similar plugins to install and use. I think that I'm using "Eclipse Java Web Development Tools", myself. While JavaScript is certainly not Java, there's enough syntactical overlap that it's for one set of plugins to support both.

While the IntelliJ world has lots of plugins, last time I checked, Eclipse had more. IntelliJ is like traditional Apple. It does the important things very well, but doesn't try to do everything. Eclipse is more like Unix, in that it's not as well-focused on specific common tasks, but it makes up for it by being more open-ended. Which one is preferable depends on your needs. I like to run debugging sessions that dig intol multiple apps and servers in a single session, and IntelliJ couldn't handle that last time I looked, but it's second-nature for Eclipse. Conversely, I've never seen a good WYSIWYG Swing editor for Eclipse, but it's built into IntelliJ. And JetBrains has done considerable pioneering work in their own right. Consider Kotlin, for example. There's a Kotlin plugin for Eclipse. Provided by JetBrains.



Thanks. So, if I use the eclipse Java Script plugin then would the same shortcuts work as as in Java .E.g control shift F for formatting the code ?
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:There may be JS plugins for those IDEs, but I've never used either of them (even when I am writing Java).

The most common IDEs used for JS development today seem to be WebStorm or IntelliJ from JetBrains, or VS Code from MS. All have top-notch JS integration.


Thanks
So does that mean if someone is working on Eclipse on a Java web project which uses Java Script then take that Java Script code alone to say Webstrom or IntelliJ and once that piece of JS work is done ,bring back to eclipse ?
 
Tim Holloway
Saloon Keeper
Posts: 24325
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both Eclipse and IntelliJ are non-invasive IDEs. By "Non-invasive" I mean that they don't distort the project structure or incorporate vendor-specific code into the work. You youngsters have no idea of how liberating that is compared to older development environments. Think Maven directory structure without the Maven amenities and a whole ship-load of Maven-specific code.

In fact, you can turn a Maven project into an Eclipse (+Maven) project by rubnning "mvc eclipse:eclipse" as a goal. And guess what? You can do "intellij:intellij" as well. I don't know about NetBeans.

Eclipse projects keep their primary secrets in a file named ".project". It also uses a few other invisible files based on the project properties (for example, the classpaths). IntelliJ uses a trio of XML files, one for overall project, one for per-user and one for internal stuff. So there's no overlap and you can bounce a project back and forth over a source repository (or whatever) between people using whichever IDE they liked and there'd be minimal disruption.
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:.

In fact, you can turn a Maven project into an Eclipse (+Maven) project by rubnning "mvc eclipse:eclipse" as a goal. And guess what? You can do "intellij:intellij" as well. I don't know about NetBeans.



Once I was working on an application in eclipse where eclipse would suddenly start showing errors and I would do mvn eclipse:eclipse from console and it would work fine.However, after few days it would against start giving those errors which would go only by doing a mvn eclipse:eclipse from console. The thing that had surprised me was that why I had to do mvn eclipse:eclipse again and again

 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When we have to work on multiple IDEs example eclipse and IntelliJ or any two IDEs, I find it challenging to deal with confusion regarding the difference in shortcuts in the two IDEs for the same operation. I often end up subconsciously attempting shortcut of one on the other before realising it.Some rythem gets lost due to this in my case. Does anyone deal with it ? Thanks
 
Tim Holloway
Saloon Keeper
Posts: 24325
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My most common issues are when I switch between Emacs and almost anything else. Because in Emacs, Control-S is "Search", but in most other apps, that's "Save" and "search" is Ctrl-F ("Find"). So I do a lot of cursing and canelling.

Some of the IDEs actually have compatibility features to make them work more like other IDEs. And/or some allow you to do local overrides for the stuff that annoys you most.
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all.What I understand is that working on multiple IDEs is bound to be challenging for everyone specially because of subconscious mind attempting shortcuts of one IDE on another and vice versa , but one has to deal with this and having a chart of shortcuts handy may help. The shortcuts which I commonly use in any IDE  are for running ,debugging ,auto formatting and for print statement(System.out.println in case of Java).
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic