def rescan(self):
        self.mtime = time()
        self.locals.clear()
        self.includes.clear()
        if self.view.file_name() is not None:
            self.setFileName(self.view.file_name())
        fileRegion = sublime.Region(0, self.view.size())
        lines = self.view.lines(fileRegion)
        for l in lines:
            if self.checkintersction(self.view.sel(), l):
                print("intersection")
                continue
            fullLine = self.view.substr(l)
            line = fullLine.strip()
            if len(line) == 0:
                continue
            split = line.split(" ", maxsplit=1)

            if split[0].casefold().startswith("%include".casefold()) and self.view.file_name() is not None:
                print("Scope extension")
                try:
                    fstart = split[1].index('"')
                    fend = split[1].rindex('"')
                    fName = split[1][fstart+1:fend]
                    fName = os.path.join(os.path.dirname(self._fileName), fName)
                    if os.path.isfile(fName):
                        if fName in contexts:
                            # Awesome, we have the file
                            print("Added to includes")
                            self.includes.add(fName)
                            contexts[fName].ensureFresh()
                        else:
                            # We have to load it
                            newView = sublime.active_window().find_open_file(fName)
                            if newView is None:
                                scanRequests.add(fName)
                                sublime.active_window().open_file(fName)
                            else:
                                newView.set_syntax_file("Packages/NASM x86 Assembly/Assembly x86.tmLanguage")
                                context = Context(newView)
                                context.rescan()
                            self.includes.add(fName)
                except:
                    pass

            # figure out how much we skipped, if any.
            lskip = fullLine.index(split[0])
            termStart = l.begin() + lskip
            if is_name(termStart, self.view):
                self.locals.add((split[0].strip(":"), "label"))
        print(self.locals)
dataset/ETHPy150Open Nessphoro/sublimeassembly/code/context.py/Context.rescan/original