How can I add TYPO3 Library to Visual Studio Code? - visual-studio-code

I installed Visual Studio Code with Homebrew Cask Tap and started to code. Now I miss the autocompletion for TYPO3 Classes.
How can I add the TYPO3 Library from eg TYPO3 9.5 to my workspace that my autocompletion works for TYPO3 Classes?
Explanation:
With other IDEs where I adde the TYPO3 Source I could press CMD MOUSE-LEFT (on MAC) on eg. AbstractViewHelper in the Examplecode and my IDE jumps to the destinated Class.
Examplecode:
<?php
namespace MonTea\MonteaBase\ViewHelpers\Format;
class PhonenumberViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
Perhaps it's important:
I use the VS Code Version 1.28.2 (1.28.2).

I found a way to do this with Visual Studio Code:
First I installed the extension: PHP Intelephense V.0.8.8.
Then I add the TYPO3 Source folder to my Workspace
Now I can hop with CMD + Click to all the TYPO3 Classes, but there are more Classes e.g. in the ConnectionPool Class the Doctrine\DBAL\DriverManager
I think sometimes it's also usefull to jump into "third-party-classes" that are used by TYPO3.
I go to the terminal
Switch to the TYPO3 SRC PATH
Do composer install
And now I can also jump to the "third-party-classes".
Visual Studio Code is near an IDE i want to work with. ;)
supplement
I also can hop inside my extensions, if they are in the same workspace. Thanks to the Intelephense Extension.

Related

Autocompletion of import statements in VS code for Java

Whenever I am creating a new java file in Intelij, all the import statement are handled by the IDE itself. Is there any way to get this feature in vs code(any extensions or setting I can toggle)
I have installed the Microsoft extensions for java but that doesn't seem to do the trick out of the box.

'Better comment' extension not working on C/C++ files in vscode

I just discovered that my 'better comment' extension stopped working after updating the visual studio code IDE.
It could not highlight comments in C/C++ files, but worked perfectly in other languages:
Here is the list of extensions I installed:
C/C++ Extension Pack
C/C++
CMake
C/C++ Themes
Doxygen Documentation Generator
I tried reinstalling the extension, but it did not work.
I'm wondering if anyone else got the same issue as me.
Was running into this same problem on C files and it seems to be an issue with a JSON parser for VS Code as explained by https://github.com/aaron-bond/better-comments/issues/437#issuecomment-1274590408
Investigation revealed that the problem was in the file Microsoft VS Code\resources\app\extensions\cpp\language-configuration.json which was missing a comma at the end of line 16
So just adding back in that comma fixed it for me

Netbeans Code Completion

Is there any netbeans trick that would do like Sublime text that if you just type div.header-class then it will then just automatically formulate `
<div class=header-class"></div>
How to do that trick? or is it possible?
I think this is probably through a plugin known as Emmet.
NetBeans has a plugin for it too. The plugin page indicates that it's for older versions, but the comments are reporting success with version 8.1. Incidentally, it doesn't show up in the plugin manager from NetBeans on Windows for me, but the GitHub page looks active though.
The Emmet download page points to this repo.
In Netbeans you have Code templates:
Code templates are prewritten snippets of code provided by NetBeans IDE. You can paste a snippet into your code by using code completion or the template's abbreviation followed by the Tab key.
Following the tutorial linked you can define your own code template to meet your requirements.

Cannot open solution file in Visual Studio Code

I have installed the Visual Studio Code on Windows. When I try to open a solution file in VS Code it opens the solution file, instead of opening all projects in solution. Is there a way to open existing project solutions in VS Code?
When you open a folder in VSCode, it will automatically scan the folder for typical project artifacts like project.json or solution files. From the status bar in the lower left side you can switch between solutions and projects.
Use vscode-solution-explorer extension:
This extension adds a Visual Studio Solution File explorer panel in Visual Studio Code. Now you can navigate into your solution following the original Visual Studio structure.
https://github.com/fernandoescolar/vscode-solution-explorer
Thanks #fernandoescolar
VSCode is a code editor, not a full IDE. Think of VSCode as a notepad on steroids with IntelliSense code completion, richer semantic code understanding of multiple languages, code refactoring, including navigation, keyboard support with customizable bindings, syntax highlighting, bracket matching, auto indentation, and snippets.
It's not meant to replace Visual Studio, but making "Visual Studio" part of the name in VSCode will of course confuse some people at first.
But you can open the folder with the .SLN in to edit the code in the project, which will detect the .SLN to select the library that provides Intellisense.
In the VSCode Marketplace look up and install vscode-solution-explorer

Java FX in Eclipse on Mac OSX 10.7

Since I had problems with compiling JavaFX Code from Eclipse on Mac OSX 10.7 using java development kit 1.7.0_04 i just want to share my intermediate solution with interested people:
Problem:
The jfxrt.jar and other .jar files are not recognized when selecting the new jdk issued by oracle as a new jre/jdk in eclipse.
The jdk is installed within /Library/Java/JavaVirtualMachines/1.7.0.jdk which is recognized as a package.
Adding the path /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre/lib/jfxrt.jar later is not possible since the file open dialog of eclipse does not allow to navigate to the inside of the package
Solution:
Create a symbolic link from outside the package to inside the package and follow the link within the file open dialog.
Simply go to a terminal and execute the following:
[0-/Library/Java/JavaVirtualMachines]:sudo ln -s 1.7.0.jdk/Contents/ 1.7.0.jdk_Contents
This creates the symbolic link 1.7.0.jdk_Contents using super user permissions (sudo).
By this compilation and execution of JavaFx code works fine and as expected.
It's not need to do all said before, just use a allmost unknown behaviour of Finder dialogs: Drag & Drop.
You can open a Finder window from console with:
open /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib
so yo will see jfxrt.jar and other .jar files. Drag this files to Eclipse's Add external jar dialog window... et voila!
Dependencies satisfaced! No link needed!
The initial JavaFX 2.1 release in jdk1.7.0_u4 was not supported by e(fx)clipse.
This support thread indicates that the maintainer of the plugin is aware of the incompatibility issue is pushing a patch to the plugin repository to fix the issue and in the meantime recommends using a JavaFX 2.2 preview build instead.