how to code up a lsp client to find references programatically?
I know as python-lsp-server is a language server and theoreticallty I can connect to it and extract references from a function call is invoked.
For example for the following code:
import os
from getpass import getpass
from GPT4Readability.utils import *
import importlib.resources as pkg_resources
def generate_readme(root_dir, output_name, model):
"""Generates a README.md file based on the python files in the provided directory
Args:
root_dir (str): The root directory of the python package to parse and generate a readme for
"""
# prompt_folder_name = os.path.join(os.path.dirname(__file__), "prompts")
# prompt_path = os.path.join(prompt_folder_name, "readme_prompt.txt")
with pkg_resources.open_text('GPT4Readability.prompts','readme_prompt.txt') as f:
inb_msg = f.read()
# with open(prompt_path) as f:
# lines = f.readlines()
# inb_msg = "".join(lines)
file_check_result = check_files_in_directory(root_dir)
Here I need to find out check_files_in_directory is defined in the GPT4Readability.utils.
I am struggling to find this informaiton and any help is welcome.
how to code up a lsp client to find references programatically?
I know as python-lsp-server is a language server and theoreticallty I can connect to it and extract references from a function call is invoked.
For example for the following code:
Here I need to find out
check_files_in_directory
is defined in theGPT4Readability.utils
.I am struggling to find this informaiton and any help is welcome.