IntelliJ - View a *single* method in a class full of many methods
Is there a way to just see one method of a class in the IntelliJ IDEA editor and hide everything else, and/or toggle between this and the regular view.
Please note, I'm not looking to fold/collapse other methods, which is certainly a way to minimize getting lost in a large file.
I am looking for a way to only view a specific method I'm working on within a class.
e.g. If there is a legacy code where an existing class has 10 long
methods (each ~50 lines long), and I'm working on one of them and don't wish to be lost in
the 500 lines of code and need to focus on a single method thereby narrowing my view to 50
lines of code.
I do remember a few versions back that this was possible, but am not able to find that setting now.
Further clarifying my question. Consider the method selected in the image below
I am interested in a view that'll show just the method like below (with all the java capabilities like code highlighting, refactoring etc., enabled of course):
java intellij-idea
|
show 5 more comments
Is there a way to just see one method of a class in the IntelliJ IDEA editor and hide everything else, and/or toggle between this and the regular view.
Please note, I'm not looking to fold/collapse other methods, which is certainly a way to minimize getting lost in a large file.
I am looking for a way to only view a specific method I'm working on within a class.
e.g. If there is a legacy code where an existing class has 10 long
methods (each ~50 lines long), and I'm working on one of them and don't wish to be lost in
the 500 lines of code and need to focus on a single method thereby narrowing my view to 50
lines of code.
I do remember a few versions back that this was possible, but am not able to find that setting now.
Further clarifying my question. Consider the method selected in the image below
I am interested in a view that'll show just the method like below (with all the java capabilities like code highlighting, refactoring etc., enabled of course):
java intellij-idea
2
I believe this is what you're looking for. <stackoverflow.com/a/35841320/10499941>
– Haleem
Jan 1 at 22:18
No, I know how to collapse other methods. I am looking for a way to only view a specific method I'm working on within a class. e.g. If there is a legacy code where an existing class has 10 long methods, and I'm working on one of them and don't wish to be lost in the 500 lines of code and need to focus on a single method with 20 lines of code.
– vivekmore
Jan 2 at 3:44
@basil-bourque - please unmark this as duplicate since it isn't really a duplicate of the question what you've mentioned
– vivekmore
Jan 2 at 13:30
@vivekmore Edit your Question to explain more clearly what your want. I do not understand how collapsing all other methods but one is not the same thing as focusing on just one method of many. Seems like two ways of saying the same thing.
– Basil Bourque
Jan 2 at 15:30
Collapsing would still show the outline/signature of the methods. I'm not interested in that. I'm looking for a way to see just the method content in the editor (no imports, no class definiton, no other methods, nothing but the method) I know I could do that I just cannot find the setting name to enable such a view. Again - I'm not interested in collapsing the remainder code, but entirely hide it and ability to see only one method that I am working on.
– vivekmore
Jan 2 at 15:35
|
show 5 more comments
Is there a way to just see one method of a class in the IntelliJ IDEA editor and hide everything else, and/or toggle between this and the regular view.
Please note, I'm not looking to fold/collapse other methods, which is certainly a way to minimize getting lost in a large file.
I am looking for a way to only view a specific method I'm working on within a class.
e.g. If there is a legacy code where an existing class has 10 long
methods (each ~50 lines long), and I'm working on one of them and don't wish to be lost in
the 500 lines of code and need to focus on a single method thereby narrowing my view to 50
lines of code.
I do remember a few versions back that this was possible, but am not able to find that setting now.
Further clarifying my question. Consider the method selected in the image below
I am interested in a view that'll show just the method like below (with all the java capabilities like code highlighting, refactoring etc., enabled of course):
java intellij-idea
Is there a way to just see one method of a class in the IntelliJ IDEA editor and hide everything else, and/or toggle between this and the regular view.
Please note, I'm not looking to fold/collapse other methods, which is certainly a way to minimize getting lost in a large file.
I am looking for a way to only view a specific method I'm working on within a class.
e.g. If there is a legacy code where an existing class has 10 long
methods (each ~50 lines long), and I'm working on one of them and don't wish to be lost in
the 500 lines of code and need to focus on a single method thereby narrowing my view to 50
lines of code.
I do remember a few versions back that this was possible, but am not able to find that setting now.
Further clarifying my question. Consider the method selected in the image below
I am interested in a view that'll show just the method like below (with all the java capabilities like code highlighting, refactoring etc., enabled of course):
java intellij-idea
java intellij-idea
edited Jan 2 at 15:50
vivekmore
asked Jan 1 at 21:58


vivekmorevivekmore
155113
155113
2
I believe this is what you're looking for. <stackoverflow.com/a/35841320/10499941>
– Haleem
Jan 1 at 22:18
No, I know how to collapse other methods. I am looking for a way to only view a specific method I'm working on within a class. e.g. If there is a legacy code where an existing class has 10 long methods, and I'm working on one of them and don't wish to be lost in the 500 lines of code and need to focus on a single method with 20 lines of code.
– vivekmore
Jan 2 at 3:44
@basil-bourque - please unmark this as duplicate since it isn't really a duplicate of the question what you've mentioned
– vivekmore
Jan 2 at 13:30
@vivekmore Edit your Question to explain more clearly what your want. I do not understand how collapsing all other methods but one is not the same thing as focusing on just one method of many. Seems like two ways of saying the same thing.
– Basil Bourque
Jan 2 at 15:30
Collapsing would still show the outline/signature of the methods. I'm not interested in that. I'm looking for a way to see just the method content in the editor (no imports, no class definiton, no other methods, nothing but the method) I know I could do that I just cannot find the setting name to enable such a view. Again - I'm not interested in collapsing the remainder code, but entirely hide it and ability to see only one method that I am working on.
– vivekmore
Jan 2 at 15:35
|
show 5 more comments
2
I believe this is what you're looking for. <stackoverflow.com/a/35841320/10499941>
– Haleem
Jan 1 at 22:18
No, I know how to collapse other methods. I am looking for a way to only view a specific method I'm working on within a class. e.g. If there is a legacy code where an existing class has 10 long methods, and I'm working on one of them and don't wish to be lost in the 500 lines of code and need to focus on a single method with 20 lines of code.
– vivekmore
Jan 2 at 3:44
@basil-bourque - please unmark this as duplicate since it isn't really a duplicate of the question what you've mentioned
– vivekmore
Jan 2 at 13:30
@vivekmore Edit your Question to explain more clearly what your want. I do not understand how collapsing all other methods but one is not the same thing as focusing on just one method of many. Seems like two ways of saying the same thing.
– Basil Bourque
Jan 2 at 15:30
Collapsing would still show the outline/signature of the methods. I'm not interested in that. I'm looking for a way to see just the method content in the editor (no imports, no class definiton, no other methods, nothing but the method) I know I could do that I just cannot find the setting name to enable such a view. Again - I'm not interested in collapsing the remainder code, but entirely hide it and ability to see only one method that I am working on.
– vivekmore
Jan 2 at 15:35
2
2
I believe this is what you're looking for. <stackoverflow.com/a/35841320/10499941>
– Haleem
Jan 1 at 22:18
I believe this is what you're looking for. <stackoverflow.com/a/35841320/10499941>
– Haleem
Jan 1 at 22:18
No, I know how to collapse other methods. I am looking for a way to only view a specific method I'm working on within a class. e.g. If there is a legacy code where an existing class has 10 long methods, and I'm working on one of them and don't wish to be lost in the 500 lines of code and need to focus on a single method with 20 lines of code.
– vivekmore
Jan 2 at 3:44
No, I know how to collapse other methods. I am looking for a way to only view a specific method I'm working on within a class. e.g. If there is a legacy code where an existing class has 10 long methods, and I'm working on one of them and don't wish to be lost in the 500 lines of code and need to focus on a single method with 20 lines of code.
– vivekmore
Jan 2 at 3:44
@basil-bourque - please unmark this as duplicate since it isn't really a duplicate of the question what you've mentioned
– vivekmore
Jan 2 at 13:30
@basil-bourque - please unmark this as duplicate since it isn't really a duplicate of the question what you've mentioned
– vivekmore
Jan 2 at 13:30
@vivekmore Edit your Question to explain more clearly what your want. I do not understand how collapsing all other methods but one is not the same thing as focusing on just one method of many. Seems like two ways of saying the same thing.
– Basil Bourque
Jan 2 at 15:30
@vivekmore Edit your Question to explain more clearly what your want. I do not understand how collapsing all other methods but one is not the same thing as focusing on just one method of many. Seems like two ways of saying the same thing.
– Basil Bourque
Jan 2 at 15:30
Collapsing would still show the outline/signature of the methods. I'm not interested in that. I'm looking for a way to see just the method content in the editor (no imports, no class definiton, no other methods, nothing but the method) I know I could do that I just cannot find the setting name to enable such a view. Again - I'm not interested in collapsing the remainder code, but entirely hide it and ability to see only one method that I am working on.
– vivekmore
Jan 2 at 15:35
Collapsing would still show the outline/signature of the methods. I'm not interested in that. I'm looking for a way to see just the method content in the editor (no imports, no class definiton, no other methods, nothing but the method) I know I could do that I just cannot find the setting name to enable such a view. Again - I'm not interested in collapsing the remainder code, but entirely hide it and ability to see only one method that I am working on.
– vivekmore
Jan 2 at 15:35
|
show 5 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999259%2fintellij-view-a-single-method-in-a-class-full-of-many-methods%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999259%2fintellij-view-a-single-method-in-a-class-full-of-many-methods%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
I believe this is what you're looking for. <stackoverflow.com/a/35841320/10499941>
– Haleem
Jan 1 at 22:18
No, I know how to collapse other methods. I am looking for a way to only view a specific method I'm working on within a class. e.g. If there is a legacy code where an existing class has 10 long methods, and I'm working on one of them and don't wish to be lost in the 500 lines of code and need to focus on a single method with 20 lines of code.
– vivekmore
Jan 2 at 3:44
@basil-bourque - please unmark this as duplicate since it isn't really a duplicate of the question what you've mentioned
– vivekmore
Jan 2 at 13:30
@vivekmore Edit your Question to explain more clearly what your want. I do not understand how collapsing all other methods but one is not the same thing as focusing on just one method of many. Seems like two ways of saying the same thing.
– Basil Bourque
Jan 2 at 15:30
Collapsing would still show the outline/signature of the methods. I'm not interested in that. I'm looking for a way to see just the method content in the editor (no imports, no class definiton, no other methods, nothing but the method) I know I could do that I just cannot find the setting name to enable such a view. Again - I'm not interested in collapsing the remainder code, but entirely hide it and ability to see only one method that I am working on.
– vivekmore
Jan 2 at 15:35