add hover function
This commit is contained in:
@@ -17,10 +17,15 @@ KIND_MAP = {
|
||||
|
||||
class StandardCompletionItems:
|
||||
def __init__(self):
|
||||
self.__json_data: dict = self.__load_json()
|
||||
self.__tcl_keyword_list = self.__load_tcl_keyword()
|
||||
self.__nx_procs = self.__load_nx_procs()
|
||||
self.__nx_variables = self.__load_nx_variables()
|
||||
|
||||
@property
|
||||
def json_data(self):
|
||||
return self.__json_data
|
||||
|
||||
@property
|
||||
def tcl_keyword_list(self):
|
||||
return self.__tcl_keyword_list
|
||||
@@ -33,11 +38,15 @@ class StandardCompletionItems:
|
||||
def nx_variables(self):
|
||||
return self.__nx_variables
|
||||
|
||||
def __load_tcl_keyword(self) -> list[lsp.CompletionItem]:
|
||||
def __load_json(self) -> dict:
|
||||
with open(
|
||||
pathlib.Path(__file__).parent.joinpath("completion_list.json"), "r"
|
||||
) as f:
|
||||
data = json.load(f)
|
||||
return data
|
||||
|
||||
def __load_tcl_keyword(self) -> list[lsp.CompletionItem]:
|
||||
data = self.json_data
|
||||
|
||||
items = []
|
||||
for i in data.get("tcl", []):
|
||||
@@ -50,10 +59,7 @@ class StandardCompletionItems:
|
||||
return items
|
||||
|
||||
def __load_nx_variables(self):
|
||||
with open(
|
||||
pathlib.Path(__file__).parent.joinpath("completion_list.json"), "r"
|
||||
) as f:
|
||||
data = json.load(f)
|
||||
data = self.json_data
|
||||
items = []
|
||||
for var in data.get("mom_variables", []):
|
||||
label = var.get("label", "")
|
||||
@@ -85,11 +91,7 @@ class StandardCompletionItems:
|
||||
return items
|
||||
|
||||
def __load_nx_procs(self) -> list[lsp.CompletionItem]:
|
||||
with open(
|
||||
pathlib.Path(__file__).parent.joinpath("completion_list.json"), "r"
|
||||
) as f:
|
||||
data = json.load(f)
|
||||
|
||||
data = self.json_data
|
||||
items = []
|
||||
for proc in data.get("MOM_procs", []):
|
||||
label = proc.get("label", "")
|
||||
|
||||
Reference in New Issue
Block a user