update settings
This commit is contained in:
@@ -79,7 +79,7 @@ export async function getWorkspaceSettings(
|
|||||||
interpreter: resolveVariables(interpreter, workspace),
|
interpreter: resolveVariables(interpreter, workspace),
|
||||||
importStrategy: config.get<string>(`importStrategy`) ?? "useBundled",
|
importStrategy: config.get<string>(`importStrategy`) ?? "useBundled",
|
||||||
showNotifications: config.get<string>(`showNotifications`) ?? "off",
|
showNotifications: config.get<string>(`showNotifications`) ?? "off",
|
||||||
formatter: config.get<boolean>(`formatter`) ?? false
|
formatter: config.get<boolean>(`formatter`) ?? true
|
||||||
}
|
}
|
||||||
return workspaceSetting
|
return workspaceSetting
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ export async function getGlobalSettings(
|
|||||||
interpreter: interpreter,
|
interpreter: interpreter,
|
||||||
importStrategy: getGlobalValue<string>(config, "importStrategy", "useBundled"),
|
importStrategy: getGlobalValue<string>(config, "importStrategy", "useBundled"),
|
||||||
showNotifications: getGlobalValue<string>(config, "showNotifications", "off"),
|
showNotifications: getGlobalValue<string>(config, "showNotifications", "off"),
|
||||||
formatter: config.get<boolean>(`formatter`) ?? false
|
formatter: config.get<boolean>(`formatter`) ?? true
|
||||||
}
|
}
|
||||||
return setting
|
return setting
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
"label": "proc",
|
"label": "proc",
|
||||||
"kind": "keyword"
|
"kind": "keyword"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "switch",
|
||||||
|
"kind": "keyword"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "if",
|
"label": "if",
|
||||||
"kind": "keyword"
|
"kind": "keyword"
|
||||||
@@ -19,6 +23,10 @@
|
|||||||
{
|
{
|
||||||
"label": "puts",
|
"label": "puts",
|
||||||
"kind": "function"
|
"kind": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "set",
|
||||||
|
"kind": "keyword"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"MOM_procs": [
|
"MOM_procs": [
|
||||||
@@ -233,6 +241,72 @@
|
|||||||
"set path [MOM_ask_env_var UGII_CAM_POST_CONFIG_FILE]"
|
"set path [MOM_ask_env_var UGII_CAM_POST_CONFIG_FILE]"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "MOM_ask_ess_exp_value",
|
||||||
|
"kind": "function",
|
||||||
|
"description": "This function provides access to the variables of the NX Expression module. The NX Expression module allows users to define variables and expressions to use as parameters for NX entities such as modeling features.",
|
||||||
|
"format": "MOM_ask_ess_exp_value <variable_name>",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "variable_name",
|
||||||
|
"desc": "Name of the NX Expression variable."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"Value of the NX Expression variable."
|
||||||
|
],
|
||||||
|
"example": [
|
||||||
|
"MOM_ask_ess_exp_value diameter"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "MOM_ask_event_type",
|
||||||
|
"kind": "function",
|
||||||
|
"description": "This procedure returns the name of the current event. This is the last event that the event generator executed.",
|
||||||
|
"format": "MOM_ask_event_type",
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [
|
||||||
|
"Name of current event."
|
||||||
|
],
|
||||||
|
"example": [
|
||||||
|
"set event [MOM_ask_event_type]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "MOM_ask_group_info",
|
||||||
|
"kind": "function",
|
||||||
|
"description": "This command retrieves group information in a CAM setup from the operation navigator views for the specified operation or group name. Returns an integer value (-1, 0, or 1) and stores the result in the variables mom_result and mom_result1.",
|
||||||
|
"format": "MOM_ask_group_info <node_name> <view> <parent|children>",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "node_name",
|
||||||
|
"desc": "Operation or group name."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "view",
|
||||||
|
"desc": "View in the operation navigator (ONT). (program|prog, tool, geometry|geom, method|meth)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "parent|children",
|
||||||
|
"desc": "Type of node."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"-1: Query failed, or the node does not exist.",
|
||||||
|
"0: Current node is root node, or no child node.",
|
||||||
|
"1: Get current group information."
|
||||||
|
],
|
||||||
|
"example": [
|
||||||
|
"MOM_ask_group_info UGT0361_019 tool children",
|
||||||
|
"mom_result(0) = CHAMFER_S1H_CSINK",
|
||||||
|
"mom_result(1) = CHAMFER_S1H_CSINK1",
|
||||||
|
"mom_result1(CHAMFER_S1H_CSINK) = Drilling",
|
||||||
|
"mom_result1(CHAMFER_S1H_CSINK1) = Drilling",
|
||||||
|
"MOM_ask_group_info CHAMFER_S1H_CSINK tool parent",
|
||||||
|
"mom_result = UGT0361_019",
|
||||||
|
"mom_result1 = Countersink"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "MOM_ask_ude_info",
|
"label": "MOM_ask_ude_info",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
@@ -257,6 +331,25 @@
|
|||||||
"1 - The UDE information successfully retrieved."
|
"1 - The UDE information successfully retrieved."
|
||||||
],
|
],
|
||||||
"example": []
|
"example": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "MOM_suppress",
|
||||||
|
"kind": "function",
|
||||||
|
"description": "The next time that a block template that contains a reference to any of the input address names is evaluated, the word that contains the address is not be output regardless of its modality attribute.",
|
||||||
|
"format": "MOM_suppress <Always|Once|Off> <address_1 ... address_n>",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Always|Once|Off",
|
||||||
|
"desc": "Always - Sets the address to be to be non-modal (always output).\nOnce - The next time that a block template that contains a reference to any of the input address names is evaluated, the word that contains that address is not output regardless of its modality attribute. If both MOM_force Once and MOM_suppress Once are programmed, the last one will take effect. If MOM_suppress Always is programmed, the address is never output. All MOM_force Once and MOM_suppress Once commands are ignored.\nff - Sets the address to be to be modal (output only if value changes)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "address_1 ... address_n",
|
||||||
|
"desc": "Name of output address(es)."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"example": [
|
||||||
|
"MOM_suppress_address Always N X Y"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mom_variables": [
|
"mom_variables": [
|
||||||
|
|||||||
@@ -124,7 +124,9 @@ def formatting(params: lsp.DocumentFormattingParams) -> list[lsp.TextEdit] | Non
|
|||||||
doc = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
|
doc = LSP_SERVER.workspace.get_text_document(params.text_document.uri)
|
||||||
text = doc.source
|
text = doc.source
|
||||||
|
|
||||||
formatted = format_tcl(text)
|
formatted = text
|
||||||
|
if GLOBAL_SETTINGS.get("formatter", False):
|
||||||
|
formatted = format_tcl(text)
|
||||||
|
|
||||||
last_line = len(text.splitlines())
|
last_line = len(text.splitlines())
|
||||||
full_range = lsp.Range(
|
full_range = lsp.Range(
|
||||||
@@ -138,6 +140,13 @@ def formatting(params: lsp.DocumentFormattingParams) -> list[lsp.TextEdit] | Non
|
|||||||
# **********************************************************
|
# **********************************************************
|
||||||
# Required Language Server Initialization and Exit handlers.
|
# Required Language Server Initialization and Exit handlers.
|
||||||
# **********************************************************
|
# **********************************************************
|
||||||
|
@LSP_SERVER.feature(lsp.WORKSPACE_DID_CHANGE_CONFIGURATION)
|
||||||
|
def did_change_configuration(params: lsp.DidChangeConfigurationParams):
|
||||||
|
settings = params.settings
|
||||||
|
|
||||||
|
log_to_output(str(settings))
|
||||||
|
|
||||||
|
|
||||||
@LSP_SERVER.feature(lsp.INITIALIZE)
|
@LSP_SERVER.feature(lsp.INITIALIZE)
|
||||||
def initialize(params: lsp.InitializeParams) -> lsp.InitializeResult:
|
def initialize(params: lsp.InitializeParams) -> lsp.InitializeResult:
|
||||||
"""LSP handler for initialize request."""
|
"""LSP handler for initialize request."""
|
||||||
@@ -158,7 +167,7 @@ def initialize(params: lsp.InitializeParams) -> lsp.InitializeResult:
|
|||||||
)
|
)
|
||||||
return lsp.InitializeResult(
|
return lsp.InitializeResult(
|
||||||
capabilities=lsp.ServerCapabilities(
|
capabilities=lsp.ServerCapabilities(
|
||||||
document_formatting_provider=True,
|
document_formatting_provider=GLOBAL_SETTINGS.get("formatter", True),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -182,7 +191,7 @@ def _get_global_defaults():
|
|||||||
"args": GLOBAL_SETTINGS.get("args", []),
|
"args": GLOBAL_SETTINGS.get("args", []),
|
||||||
"importStrategy": GLOBAL_SETTINGS.get("importStrategy", "useBundled"),
|
"importStrategy": GLOBAL_SETTINGS.get("importStrategy", "useBundled"),
|
||||||
"showNotifications": GLOBAL_SETTINGS.get("showNotifications", "off"),
|
"showNotifications": GLOBAL_SETTINGS.get("showNotifications", "off"),
|
||||||
"formatter": GLOBAL_SETTINGS.get("formatter", False),
|
"formatter": GLOBAL_SETTINGS.get("formatter", True),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user