View>Function List python functions showing up outside of tree
-
Hello, I’m on NPP 7.8.1 and writing Python code. I’m having a problem when using View>Function List. When adding functions to a class in files I’ve been working on over a period of days and weeks, the functions are showing up outside of the class tree instead of in the class. At first I thought it was indentation issues, but that wasn’t the case. How can I figure out what the problem is and fix this?
Thank you! -
Perhaps showing some examples of the abnormal behavior would be a great place to start?
-
Hi, hope the img below is what you mean. Every function between the Catalog class and main() should be showing up as a method in the Catalog class.

If you’re asking for code, here’s a snippet of where the functions suddenly show outside of the Class. Thanks for any ideas!
def convert_raw_title_to_standard(self, raw_title: str) -> str: tt = self.cleanup_raw_title(raw_title) tt = uutil.change_chars_to_space(tt, '-') tt = tt.title() return tt def make_links_from_soup(self, src_url: str, soup: BeautifulSoup) -> list: stories = [] story = {} if bool(soup.find_all('div', class_='ftr')): div_rows = soup.find_all('div', class_='ftr') else: return stories for row in div_rows: self.entries_count = self.entries_count + 1 if 'dir' in row.find('div').text.lower(): dir_type = 'dir' story_dir = row.a['href']+'/' story_dir = story_dir.replace(r'//', r'/') else: dir_type = 'text' story_dir = row.a['href'] story_dir = Path(self.src_url).joinpath(story_dir) title = self.convert_raw_title_to_standard(\ row.a['href']) story = CatEntry(**{ 'id': str(self.entries_count), 'title': title, 'dir_type': dir_type, 'dir_name': Path(row.a['href']), 'url': story_dir, # local or web }) stories.append(story) return stories ### KEEP def save_catalog_to_file(self, stories: list, file=WindowsPath): if not file.exists(): uutil.make_parent_dir(file) with open(file, 'w+', encoding='utf-8') as cat: for story in stories: cat.write('{0}, {1}, {2}, {3}, {4}\n'.format( str(story.id), story.title, story.dir_type, story.dir_name, story.url)) cat.close() -
Wow, so I just tried deleting all the comments that were left and when I deleted
### Keepand saved, it repositioned the methods correctly. So I’m not sure if that’s a bug or intentional. Can anyone explain? Thank you!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login