When I start a new method all the previous code gets red wavy underlines. This happens every time I want to create a second(or third etc) method after the first one. It does go away after I declare the name of the new method.
IntelliJ flags it for "Class member declared outside of a class".
I believe it started with the latest update of IntelliJ but cant seem to find a way to get rid of it. Its just very annoying.
The issue covering the described case, please follow: https://youtrack.jetbrains.com/issue/IDEA-274893
Related
https://i.imgur.com/SlQ41BS.jpg
Here is an example. For some reason code is simply not being highlighted using the Lua 5.2 interpreter. Autocomplete doesn't appear to be working correctly either. Also whenever I declare a function it doesn't automatically add a space in the middle and the end at the bottom which I've seen. These would all be immensely helpful starting off. I have never coded before.
I don't see any issue with the highlighting, as the Lua code in your snapshot is highlighted. I'm not sure why auto-complete is not working in your case, but if you type "pr" and don't see "print" and "pairs" offered when Lua 5.2 interpreter is selected, you may want to open a ticket and we'll investigate.
Just upgraded from VS2013 to VS2015 Enterprise Update 3 and discovered that intellisense seems broken with enums.
With VS2013, typing space after, for instance:
dim myEnum as MyEnumType =
... would immediately give a choice of enum values of the correct type.
This was also true with more complex situations, where, when choosing from a number of overloaded versions of a method, you could down-arrow through the overloads till you got to the right overload, then type space again, and it would give you a choice of the right enum values of the correct type, for the argument you had got to in the list.
Here's what VS2013 did, for instance:
However, this is the VS2015 equivalent, on the exact same line of code, after scrolling through to the correct overload:
As you can see, it gives a completely wrong list of possible options.
There was a similar problem with a previous version of Studio that eventually got fixed after the whole community howled in pain.
It seems to be back with VS2015 - a significant retrograde step. Now you have to know the exact type it's expecting before it will give you options.
A similar issue seems to have been reported a year ago re the Community Edition but it, or a more subtle version of it is clearly also affecting Update 3 of Enterprise.
Is there any way to reproduce the Common/All tabs behaviour of VS2013?
Edit: here are my selected options:
They're the same as I had in VS2013.
What the intellisense shows is the list of member according to the current signature (or what the compiler thinks it could be), not according to the overload tooltip.
For example see this
It shows the same overall behaviour as in your post.
But to obtain it, after having written the comma after "caption" I changed the current overload tooltip manually using up/down arrow on keyboard.
Note, it was not mandatory to change it manually even without that it was proposing me some overload which takes an IWin32Window for first argument even with an already present string as first argument
Then I pressed space and the intellisense showed what is appropriate given the context not the tooltip.
In your post we can see it's not the same overload in both screen.
I can't say for sure it is what happened for you (given I changed the overload tooltip on purpose) but if I had to bet, I would go that way.
Xcode's desire to complete certain things drives me nuts. If I type "else" and hit return, for example, I want to just end up on the next line after my "else", but instead I accidentally select Xcode's "else" completion and I'm still on the same line, which is literally never what I want. I like code completion in general, it's these ones that effectively replace normal code typing that bother me. Is there a way to disable specific completions in Xcode 6? This question asked basically the same thing (the author was even also bugged by the "else" completion – seriously, Apple, please remove that one), but all of the answers to it are out of date and do not apply to Xcode 6. (I would have just commented on that question, but doing so requires 50 reputation, so I had to start a new question instead, grr.) Xcode 6 has the macro browser thing where you can add new completions, but it does not seem to be possible to disable their built-in completions there. Is there a config file somewhere that can be edited?
The problem that Xcode doesn't have completion snippet for "else" statement. It has only for "if" and "if - else" statements.
I propose to create custom snippet for your goal.
Here is an example how it should look like:
I have an Eclipse custom editor and I implemented 'report errors as you type', but every now and then my error squigglies (using JFace annotations) are not shown or linger after they should be removed.
I am using MonoReconciler with my implementation of IReconcilingStrategy. During the reconcile step I call annotationModel.replaceAnnotations to remove the old errors and add the new ones. Most of the times this works fine. Every now and then the updates are lost, and I notice the following:
the red stamp on the left ruler disappears, but the red underlines stay
on the next character I type, the underline disappears
I verified in the debugger that the annotations are correctly calculated. The underline disappears immediately after typing a character, and not after the 500ms delay of the reconciler. It looks like a lost UI update/redraw.
There must be a race condition somewhere (the reconciler runs in its own thread). What am I doing wrong? I couldn't find any documentation about this use-case.
Edit: To reproduce, checkout the scala-worksheet and create a new one. Type
object Test {
val m = Map( 't' -> 1 )
}
Now edit the arrow: remove the >. The underline is missing. Type a space, it comes back. Add it back, the underline is still there until you type another space.
I fixed it by calling invalidateTextPresentation on the underling SourceViewer, but it seems to me that shouldn't be necessary. I'd like to understand what is the correct way to use editor annotations.
PS. The lost updates can also be seen in this screencast.
It's hard to tell from a distance, typically in eclipse, any changes that impact the ui should be executed on the ui thread (and eclipse will not always warn about this).
Normally you use Display.getDefault().asyncExec(...) to execute something on the ui thread but you probably already know this. It can happen that 2 queued up changes cause a race.
(I have implemented semantic highlighting, error highlighting etc several times for the company I work for, Sigasi. If you can point me to your implementation I may be able to figure out what's going wrong.)
It really annoys me that IntelliJ highlights certain 'errors' (that don't prevent successful compilation) the same way that real errors are highlighted. For example, a magic number is not really an error, but it will be flagged in exactly the same way as an incompatible type error.
How can I change this?
Go to Settings -> Inspections. Then you need to search through the long list for the offending inspection, which you can get the name of by hovering on the warning marker in the margin. You can change the severity of the inspection, whether it's an error, warning, etc. or just disable it altogether.
Edit: if you search for "magic" in Settings, you get the following, which should be helpful:
Whenever you see an inspection warning/error you can place the caret on it and press Alt+Enter (a light bulb also appears that tells you that). A menu will appear with suggested quick fixes. You may need to open a submenu by pressing Right, and you'll find "Edit inspection settings" there. Having invoked that, you may proceed as in hvgotcodes's answer :), it's just a faster way of getting to those settings.
As Michael Calvin said you can use the SuppressWarnings annotation. For example:
#SuppressWarnings("OptionalUsedAsFieldOrParameterType")
See https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/src/inspectionDescriptions/OptionalUsedAsFieldOrParameterType.html
Usually searching the internet for the exact description leads me to this.
Not directly relevant to the OP, but may be of use to future Googlers
I got to this question while trying to figure out how to disable IntelliJ IDEA's warnings about Guava functionalities that have been replaced by Java 8 features. I'm not able to use the Java 8 versions of these features in my case because of a library we're using that was built with Guava (despite being a Java 8 project). So to solve that, I added a SuppressWarnings annotation before any class using Guava:
#SuppressWarnings(Guava)
public final class...