I have installed Sublime Text2. I want auto formatting php code to PSR Standards. Can anyone please help me how to configure in Sublime Text2
I just yesterday installed one plugin that you could use for PSR-1 and PSR-2.
Link that I found for this is:
sublimetext-codeformatter
Install it in Sublime Text 3 via console and after that you can use from Command Pallete [CTRL + P windows (default keyboard shortcut)] and type format and choose Codeformatter: Format code and this will format your code. You can see also the options for PHP and adapt them as you want, see 2nd image.
Default PHP settings:
I also adjusted my own keyboard shortcut in Preferences -> Keybindings
{ "keys": ["ctrl+alt+l"], "command": "code_formatter"}
If you need something more, tag me below in comments and I'll gladly reply back.
I believe that to achive what you are looking for, there are several steps included:
1) Download and install Sublime PHPCS
2) Configure according php packages you intend to use (Available: PHP_CodeSniffer, PHP Mess Detector, PHP CS Fixer, Scheck and PHP Code Beautifier)
3) Lastly you will need to configure the plugin inside of sublime text.
According to this link here, you can configure it to comply with PSR-2 standard.
Hope this helps!
Some ST2 plugins have references to module sublime_api in their Python files. I've found such text in several github.com projects.
What is this sublime_api module? Where can I see it and/or where does it come from? Maybe it's somehow sitting in memory only. What is background of this module, seems it's important for ST2 plugins.
So far I found info only about sublime and sublime_plugin modules.
sublime_api is hard-coded into the Sublime text executable - it's not a separate Python file. However, you can find an API reference on sublimetext.com (replace the 2 with a 3 in the URL for ST3) and a broader ST2 reference here contained within the "unofficial documentation", both with some info about the API.
Is it possible to get code-hinting in JetBrains WebStorm for a non-core node package? Specifically, I'd like to get hinting/completion working for buster. I can't seem to find any information on this. Thanks much!
For buster.js, download buster-test.js and save it somewhere the WebStorm/PyCharm project can see it. Hinting should show up immediately.
WebStorm 2020.1
There's a trick to getting "coding assistance" for 3rd party packages that support community stubs (AKA Typescript definition files):
Open the project's package.json
Position the cursor on the package (within the dependencies section)
Press alt+enter (or click the light bulb)
Choose Install '#types/name' (where name is the dependency)
For example:
Currently Sublime Text 2 with installed LaTeXTools bundle stumbles over Sweave/knitr code blocks. How can I tell ST to either ignore everything of the form
<<arguments here>>=
#
or, even better, to treat it as R source code?
The Sweave Textmate bundle (or at least the essential parts) will also work with Sublime Text 2. Just download the bundle from https://github.com/textmate/sweave.tmbundle and move it to the Packages directory.
There's now the SublimeKnitr bundle that's made specifically made for Sublime Text. Install from GitHub source or via Package Control.
Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused.
(Note: I don't want to download the source. I just want to browse it online, to see how some methods are implemented.)
OpenJDK is now on GitHub: https://github.com/openjdk/jdk
It is a large project, but you will find the implementations of the core classes under jdk/src/java.base/share/classes.
For instance you can find the implementation of java.util.List here.
If you need to browse older versions, you still need to use the old Mercurial interface.
The Mercurial interface there is quite confusing if you are not used to it, and since this is a large project, it can be hard to find what you are looking for.
Here is an example:
To find the JDK6 implementation java.util.List, select jdk6, jdk, select browse. Then browse to src/share/classes/java/util/List.java.
You should end up at http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/tip/src/share/classes/java/util/List.java
The latest JDK 8 OpenJDK Java Class Library source code can be found here: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/classes/
Here is the basic step to get latest or any released version of Openjdk 8 (or any existing java version) source code, and use them in Eclipse.
Steps:
[browse source]
Open url for jdk, e.g http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/
click tags
choose proper tag, e.g jdk8u73-b02
then click browse,
then browse into folder src/share/classes,
[download source]
then click one of bz2 / zip / gz, to download source in relevant compressed format, (e.g for jdk8u73-b02 in zip format, the url will be: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/archive/2ab13901d6f1.zip/src/share/classes/)
[use in eclipse]
uncompress it,
zip the folder "classes/", make "classes/" as the root dir of .zip file, (e.g first cd jdk-2ab13901d6f1/src/share/, then zip -r openjdk_8u73_b2_src.zip classes/)
move the created zip file to proper location, it will stay there for a while, (e.g mv openjdk_8u73_b2_src.zip /media/Eric/software/java/jdk/openjdk/openjdk8u73-b02/source/)
in eclipse, specify source file for jars of installed jre, could specify the source attachment for each jar of installed jre respectively, the most common jar is probably rt.jar,
optionally, might need refresh project to make it totally take effect, not sure is that necessary,
test it: in eclipse, ctrl + shift + t, then input Cancellable, select the sun.nio.fs.Cancellable of corresponding installed jre,
if the source code is available, then it's good, because this source is not available in jdk_home/src.zip, it must be from the additional openjdk source,
switch source back: could switch back to use "jdk_home/src.zip", if don't want to use the external openjdk source,
ok
Here's a way to browse the repositories and look at just the bits you want.
http://hg.openjdk.java.net/
Is that what you are asking?
Append a "/file" to the root URLs to view the browser like this:
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/
http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file
Grepcode.com is great for similar things - not only OpenJDK sources, with searching in classes/methods and links between classes directly in highlighted code:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/net/Socket.java
As mentioned in the other answers, the source code repository is at https://hg.openjdk.java.net
However, the OpenJDK team mirrors some of the projects on GitHub: https://github.com/openjdk
Including the latest Java version project (https://hg.openjdk.java.net/jdk/jdk): https://github.com/openjdk/jdk
Surely http://hg.openjdk.java.net is one good option. The other equally good source is zGrepCode https://zgrepcode.com/java/openjdk/ . It has both Open JDK and Oracle java versions.