This is kind of irritating, but I am using Eclipse PDT and code hinting only works on already saved portions of data. That is, assume I write code:
$o = new SomeObject();
$o->
(assuming SomeObject has public properties) Now when I hit Ctrl+space I get "No matches found". If I save and then hit Ctrl+space, suddenly PDT knows properties of SomeObject. Now let's assume I have this code saved:
$o = new SomeObject();
$o->destroyTheUniverse();
When I place caret right after -> and hit Ctrl+space hinting works. But if I add another line of code
$o->
It won't give me any hints about the newly written code. That makes coding rather irritating.
I tried to look through the preferences but failed to find the solution (the same for Googling) so I am asking here - how to make PDT smarter with code hinting?
Related
I didn't really know how to title this error but yeah, I used the quick replace function in vb and replaced "comp" instead of "comp." now I have a massive error, my designer isn't loading (it included the word comp) and I need to find and add the word comp back to where it is required. The error is
"The class frmuterDetails can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. "
If I could go back to an earlier stage of my work that would be good too.
I have tried not saving and closing and reopening, didn't work for some reason it auto saved.
Ctrl + Z didn't work either it did up to a point but it didn't fix this error.
smaller issue than I thought I changed "frmComputerDetails" at the top to "frmmuterDetails" and then relaunched the project the designer worked but then of course things that called "frmComputerDetails" didn't so I changed the first class from "frmmuterDetails" back to "frmComputerDetails" and it works as normal.
:)
I am using IntelliJ IDEA Community Edition 16 Preview (version IC-144.4199.23). I need to rename a couple Enum entries using IDEA's Refactoring system.
For instance, I currently have an enum entry named black, and I need to rename it and its usages to BLACK, which I do by Right-clicking the entry, selecting Refactor -> Rename..., and entering BLACK.
The problem is that IDEA prompts me with the Looking for Usages progress dialog, freezes the dialog, and never actually refactors the entry name.
This issue is pretty odd, because when I use Find Usages on the entry directly, it perfectly says that there is "No usages found in Project Files" (which is normal). However, the aforementioned dialog freezes at a roughly 99% progress bar in searching for occurrences, and does not proceed in renaming the entry.
Edit: Issue also applies to IntelliJ IDEA 15.0.2, apparently.
When you click the type of refactoring, make sure that in the 'Choose scope where change signature may occur:' you DO NOT choose "All Files", but rather something else - such as "Project Files". Otherwise, it's going to take forever!
Do this in VS 2010 with VB.NET:
On a blank line, type anything that isn't a variable, property, method, etc. I will use woo as an example.
Hit Enter or move the cursor up or down a line.
VS will add parenthesis to the end of it, turning it into woo().
Annoying, isn't it? Now insert foo in front of woo(), separated by a space like this: foo woo().
Move the cursor up or down (don't use Enter). VS turns it into foo(woo()), somehow drawing the conclusion that you want to pass woo() through foo(). What gave it that idea?
I know that the IDE isn't a text editor, but there are many times when I will want to paste in some text from a business requirements document or even some SQL and then comment it out after the fact. c# is great for this since it never assumes that I am trying to do anything, but the VB.NET IDE ends up parsing the holy love out of whatever block of text I paste into it and I end up having to edit out everything it added in.
Why does it do this? Can I tell it not to?
Unselect Pretty listing (reformatting) of code. You can find this under: Tools -> Options -> Text Editor -> Basic -> VB Specific
When I'm debugging my application something is not right, and I can't continue.
So is it possible to see the output code of my app while I'm testing it to see what is wrong?
I open the output window but nothing happens in there it's just stay blank.
In two words: I want to see what my app is actually doing while I'm testing it.
I'm using Visual Studio 2010.
So is it possible to see the output code of my app while im testing it to see what is wrong?
Yes, but you actually have to output something, otherwise nothing will show up. In VB.NET (which is the language you're using if you have Visual Studio 2010), this is accomplished with the following code:
Debug.Print("Here is some text that will be output.")
The documentation for the Debug.Print method is here. In order to call it like that, you will also have to have imported the System.Diagnostics namespace. You do so by placing the following line at the top of your code file (with all the other statements that look like it):
Imports System.Diagnostics
The output will automatically appear in the Output Window. If you still don't see anything, ensure that output is not being redirected to the Immediate Window instead: Tools -> Options -> Debugging -> General -> uncheck the option "Redirect all Output Window text to the Immediate Window".
Confusingly, you use the word "code" in your question, saying that you wish to "see the output code of [your] app while testing it". I'm not sure if by "code" you actually mean "output", in which case the solution above will work for you.
If you actually mean code, as in your program's source code, then you can use the Break toolbar button (or press Ctrl+Break) in the IDE to pause the execution of your program. This will automatically dump you back into the code editor with the currently-executing line of code highlighted.
Visual Studio has some very powerful debugging tools. If you don't already have a general idea of how to use them, I strongly recommend picking up a book on either it or VB 2010 that will teach these things to you. They can be very confusing to learn by trial and error, but are not all that difficult if you have a good guide. Spend that time debugging your code, not figuring out how to use the IDE.
Based on IntelliJ's documentation, when folding an anonymous class you should still be able to see the contents of the inner method. See image below taken from their documentation:
This isn't the behavior I'm seeing though. Here is what I see:
I can only seem to collapse the inner method contents or the entire anonymous class body. Is this just an error in their documentation or is there a way to actually achieve this behavior?
======= UPDATE =========
I've accepted the answer from Peter Gromov, but there still seems to be something amiss with my version. When I have files open and set folding closures by default (File -> Settings -> Editor -> Code Folding -> Select 'Closures' under 'Collapse by default:'), it does seem to fold correctly as seen in the following image:
Notice that the expanded Because shows a single collapsible region in the margin. Closing the file and reopening produces the following (after I collapse the first one):
When first opening the file, both of these statements are expanded (issue #1). After collapsing the outer most region for the first statement, it folds over the entire anonymous class (issue #2) rather than how it worked before I closed the file. Notice also that the second statement that I've left open has an additional collapsible region for the method of the anonymous class (issue #3). This is how it behaves with the default folding settings for closures are turned off. There's definitely something buggy here. Since I've posted this question, there has been a new version released so perhaps the issue is only with the version I have (10.0.3), but as far as I know this is a fairly old feature. I'd welcome any explanation as to why I might be seeing these issues (including "Works on my machine").
What you want is called 'Closure folding' and can be turned on in the Code Folding settings.