-
Notifications
You must be signed in to change notification settings - Fork 646
Differentiate between interfaces and structs in outline #2114
Conversation
@ramya-rao-a No idea why the test failed :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using document.getText(range).includes('struct')
can give us false positives.
Instead fetch just the first line and use a regular expression to check struct definition.
@karthikraobr I think I am missing something here... Below is the screenshot from using the latest Go extension The interface and struct are appearing separately for me without the changes in this PR. What am I missing? |
@ramya-rao-a I am on the latest version of vscode and the plugin as well. But doesn't work for me. Moreover, a struct being displayed as a class is wrong. Finally, I might be wrong , but there is no code to detect classes right? Are you using a beta? |
Weird, I don't see that anymore.. I have pushed a commit to make the regex cover scenarios with extra spaces and make it stricter to match the current struct only. Can you update the test case? |
@ramya-rao-a Thanks a ton for fixing the regex. I have added tests for struct outline. Let me know if I need to add more tests. |
This PR also fixes breadcrumbs for go files. |
Thanks @karthikraobr! |
This PR fixes the code outline from erroneously displaying structs as interfaces.
Before
After