def run(self): # Retrieve path of project st_project = get_project_file(self.window.id()) if st_project is not None: active_view = self.window.active_view() filename = active_view.file_name() try: directory = os.path.dirname(st_project) relative_path = os.path.relpath(filename, directory) # Set input file name, extension = os.path.splitext(relative_path) if extension.lower() == ".nim": set_nim_project(st_project, relative_path) except: raise # pass
def idetool(win, cmd, filename, line, col, dirtyFile=""): filePath = filename projFile = get_project_file(win) if projFile is None: projFile = filename if dirtyFile != "": filePath = filePath + '";"' + dirtyFile # Ensure IDE Tools server is running Idetools.ensure_service(projFile) # Call the server args = 'def "' + filePath + '":' + str(line) + ":" + str(col) print(args) # Write to service & read result result = Idetools.sendrecv(args) if result is not None: return result