PhpStorm autocompletes "null" to "null()". Can I modify autocomplete list? - autocomplete

Problem
When I type null, and use any form of code completion such as Ctrl-Shift-Return for example, it chooses the top-most option from the auto-complete dropdown, but the top-most option is never the one I want.
Example:
Question
Is it possible to "downvote" an option to rank it lower? Or in any other way modify the priorities of options in the auto-completer?
Extra info
The null() function comes from this project, via composer installation.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc
This problem has persisted for quite a while, and has survived several version upgrades. Current version info:
PhpStorm 2019.1
Build #PS-191.6183.95, built on March 27, 2019
Licensed to [Redacted]
Subscription is active until [Redacted]
JRE: 1.8.0_202-release-1483-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.9.0-8-amd64
I've manually picked the second option, plain null, many times without this affecting the priority of this list, so there's certainly no learning aspect to it.
PS: The tag PhpStorm-2019.1 does not yet exist, and I don't have the reputation required to create it. I added the 2018.1 tag because the problem has existed since that version.

Related

Why nothing happened after selecting "Convert operators to Unicode" in Comma?

After I select "Convert operators to Unicode" in Comma, and enter the following code:
my #array = 1,3,5,7,9;
say #array >>+>> 3;
>>+>> should be converted to »+», but nothing happend.
This is the version of Comma:
Comma 2021.01(Community Edition)
Build #CT-202.6948.81, build on January 29, 2021
Runtime version: 1.8.0_261-bb12 x86_64
VM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation.
In the "Scheme:" combobox you see the "Default (IDE)" value, which means you are currently editing default setting scheme for the IDE. However, it is an IntelliJ thing that this scheme does not automatically equal to your current project settings (which sometimes surprises users).
If you switch it to "Project (Project)" it is highly likely the settings will differ (no Unicode editing, as it is turned off by default), so you enable it for the current project scheme and it should work out, otherwise please report, that would most likely be a bug.

How to fix "The type or namespace name could not be found"?

Visual studio wont recognize certain packages (Entities, and TMPro, to name a few) and it gives the error: The type or namespace name could not be found; but everything compiles fine. I know there are already many questions and answers related to this problem, but so far none of them have worked for me.
So the way I downloaded these packages was by using the Unity Package Manager, so this makes things even more confusing because I installed other packages the same way, and they are recognized no problem.
So far I have tried:
Checking the target framework of the packages and the project (all are .NET Framework 4.6)
Deleting the Library folder
Checking my Unity version (2019.2.0a11)
Some extra notes:
I've had this issue for a long time now (with TMPro to be specific; for about a year) ever since downloading it from the Package Manager in one of the 2018.X versions
In other Unity projects, which are using various versions, give the same result. This leads me to believe it is something to do with my visual studio.
The Entities package shows up on the side, see picture below
I uninstalled Visual Studio 2017 installed Visual Studio 2019 and it fixed my problem. I suspect re-installing like others suggested may have worked too.

Duplicate hints while typing expression in Visual Studio Code

Why do I have the same suggestions while typing expression?
Example:
I had exactly the same problem. After a week or so, it get really annoying.
basically, as the comments hint to, there are probably multiple linting or intelisense tools. In my case (for python) i had the pylance extension added.
When i disabled this, the problem went away, but features were missing. So i added it back...
For some reason (i dont know why), this fixed the problem !!!
I can only hypothesise that in some way the extension was corrupted. Nevertheless, it worked.
EDIT:
I can also confirm that unchecking this setting appears to work:
Jupyter: Pylance Handles Notebooks
My current system is Windows 11, with python 3.10.
Final edit (8 Dec 2022):
This is resolved here:
Please could you install VS Code 1.74 and the latest Jupyter, PyLance and Python extension and confirm this still exists.
Visual Studio Code provides an API so third-party extensions and built-in modules can contribute suggestions for auto-completion pop-ups. The system is currently designed so suggestions are merely appended—there's no duplicate detection or removal (perhaps because extensions can also take care of sorting suggestions and such algorithm would get on the way). That means that if you have more than one extension or module for a given language you can easily get duplicate entries.
Having several extensions for PHP is not necessarily a bad idea since they can address different needs (for instance, PHP DocBlocker just creates annotations, it doesn't provide auto-completion suggestions) but you have at least two extensions (PHP Intelephense and PHP Intellisense) that do exactly the same things. That's likely to hurt performance (all your workspace files will be scanned several times) and just adds noise.
I suggest you read the extension descriptions carefully to learn what they do exactly and then figure out which ones you need. Remember that extensions can be enabled/disabled in a per-workspace basis.
The following is just my own totally subjective opinion. Among the PHP extensions that provide code intelligence only two of them seem mature enough:
PHP Intelephense
PHP Intellisense
I've tried both. PHP Intelephense works best for me than PHP Intellisense so that's the one I've kept. I've also disabled php.suggest.basic following the installation instructions because basic suggestions didn't add any value to me (they were blind string matching):
Turn off the php.suggest.basic setting for best results.
... as well as taming builtin Emmet support, which was providing really dumb suggestions:
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly"
YMMV.
TLDR; Installing pre-release version of Jupyter solves (v2022.11...)
Ok, so after some more extensive experimentation I think I found what's causing this in my case. After looking at the processes I noticed that there were two Pylance processes running, and consistently this would only be a problem if I was working in a session with a jupyter notebook open or one that had been opened.
saun89 17740 37.3 0.3 1008004 199492 ? Sl 20:58 0:22 /home/saun89/.vscode-server-insiders/bin/fef85ea792f6627c83024d1df726ca729d8c9cb3/node /home/saun89/.vscode-server-insiders/extensions/ms-python.vscode-pylance-2022.11.32/dist/server.bundle.js --cancellationReceive=file:9178e897a2b78b36bfd167f79b36c3bdad2931d71b --node-ipc --clientProcessId=17651
saun89 18743 257 0.7 1304584 382288 ? Sl 20:59 0:20 /home/saun89/.vscode-server-insiders/bin/fef85ea792f6627c83024d1df726ca729d8c9cb3/node /home/saun89/.vscode-server-insiders/extensions/ms-python.vscode-pylance-2022.11.32/dist/server.bundle.js --cancellationReceive=file:8744a321767eed92821fd737be4dc7dcfb728284e5 --node-ipc --clientProcessId=17651
Pylance basically spins up a service for the workspace, and then spins up a separate service for the notebook.
Output from "Python Language Server" logs:
Disabling Jupyter removes the duplication, and after installing an earlier version of the extension (v2022.4) this appears to have fully resolved the issue. I'm going to go ahead and log the extension bug once I have something reproducible.
As of 11/30/22, Jupyter Extension Pre-Release version v2022.11.1003281132 is the latest version fixes this issue. Click the gear icon next to the extension and you should see "install another version..." Then you can select version v2022.11.1003281132.

Netbeans won't install on Windows 10

I'm trying to install Netbeans 8.2 Java EE, but whenever I start the installer it quits after configuring it. I am trying to install it on Windows 10 64-bit.
This is not going to make sense at all, but do you happen to have the "God Mode" item on your desktop? Take it off the desktop (delete it, move it somewhere else, whatever). I have no idea why, but it worked for me: I found the solution in this bug report - https://netbeans.org/bugzilla/show_bug.cgi?id=269988
I do hope this helps you, too.
This is an Java issue, which was came up due to recent windows 10 update, that started treated differently for GodMode folder/shortcut.
This has been already fixed - https://bugs.openjdk.java.net/browse/JDK-8179014
You can verify the fix in early access build of JDK8 update 152, which is available here
We have verified the issue only with GodMode, do let us k now if there are any other scenarios that can cause such similar issues.
I'm adding this because: I had a different issue which I was unable to find addressed anywhere, this question appears near the top of a web search for "NetBeans 8.2 ee won't install on Windows 10", and someone else may have the problem I had.
My NetBeans install was almost immediately crashing with the following error:
An unexpected exception happened in thread main
Exception: javax.xml.parsers.FactoryConfigurationError: Provider for
class javax.xml.parsers.DocumentBuilderFactory cannot be created
In my Windows 10 System Properties -> Environment Variables -> System Variables, I had a previously created _JAVA_OPTIONS variable values using -Xbootclasspath/a to append some jar files to the end of the bootstrap class path. These files are used with some work I'm doing with the Oracle BI Publisher plug-in for Microsoft Word.
As soon as I renamed the _JAVA_OPTIONS variable to something else, my NetBeans installation started normally and completed with no issues.
After NetBeans installation, I reset the name of this variable back to _JAVA_OPTIONS, and discovered that the values I have for this System Variable cause NetBeans launch to crash. (Which does not completely make sense to me since I am only appending these files/classes to the class path, and not overwriting.)
Regardless, I'll have to go back to the drawing board for my work with the BI Publisher plug-in; but at least I can use NetBeans now!
Uninstall any Java installations along with NetBeans, and install Java with NetBeans (bundle) from the Oracle website.
I had the same issue, and then installed the bundle, works perfectly.

How to make completion works at first time in PhpStorm 2016.2

I'm using PhpStorm 2016.2 and my code completion does not seem to work properly. When typing $this->assertCo
it suggest only function names that are up to third level ancestors of my class. But when I use Ctrl+Space it suggest correct items.
This is my class diagram:
and missing suggestions are in PHPUnit_Framework_Assert class.
How can I make it work without using Ctrl+Space every time?
PhpStorm and OpenJDK info:
PhpStorm 2016.2
Build #PS-162.1121.38, built on July 12, 2016
JRE: 1.8.0_76-release-b216 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Reason for current behaviour: it was asked by users (WI-9403) to hide static methods when completing methods using this->.
PHPUnit apparently has all assertXXX methods done as static although recommends accessing them via $this-> (same way how it's done in JUnit -- the original tool where PHPUnit devs took inspiration from).
How can I make it work without using Ctrl+Space every time?
Right at the moment -- no way.
But in 2016.2.1 it will work as before for PHPUnit methods/inside PHPUnit test files (WI-32530 -- already implemented).
You may also consider voting for https://youtrack.jetbrains.com/issue/WI-32713 -- to have such behaviour completely optional (additional setting) even outside of PHPUnit tests.