Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Test code provided by alexheretic to filter variable type #65

Merged
merged 2 commits into from
Mar 6, 2018

Conversation

aldonogueira
Copy link
Contributor

This commit in combination with the changes in RLS categorization make the outline view more useful and fixes #58.

These are three outlines for the RLS's rustc.rs file. The first is the previous state where there are many local variables between methods, the second one just filters the local variables in RLS and the third uses the new categorization and filter variables on ide-rust. Notice methods and fields are now properly shown.
image

@alexheretic
Copy link
Member

Thanks for the pr & example. Do you think we should provide a config to toggle this? I wonder if anyone wants the variables in the outline.

I added a comment inline. But this definitely looks like an improvement for the usability of the outline.

lib/index.js Outdated
@@ -577,6 +577,20 @@ class RustLanguageClient extends AutoLanguageClient {
throw new Error("failed to start server: " + e)
}
}

provideOutlines() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a comment on this method just briefly explaining what we're doing & the motivation for filtering variables.

@aldonogueira
Copy link
Contributor Author

I don't think local variables are useful in outline views of static typed languages. This is the behaviour we find in Eclipse JDT, atom-ide-java and atom-ide-csharp, etc. If anyone files a bug about it, which I think unlikely, we can then add the config toggle. Otherwise, in my opinion, it's unnecessary complexity.

@alexheretic alexheretic merged commit 14c5dab into rust-lang:master Mar 6, 2018
@alexheretic
Copy link
Member

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter out variables on Outline view
2 participants