diff --git a/AmxxEditor.py b/AmxxEditor.py index 8426b02..714b3b4 100644 --- a/AmxxEditor.py +++ b/AmxxEditor.py @@ -352,12 +352,15 @@ def inteltip_function(self, view, region, flags, location=None) : self.generate_doctset_recur(node, doctset, visited) found = doctset.get(search_func) location = location or word_region.end() + actual_parameter = -1 + # log('search_func', search_func) if not found: scope = view.scope_name(region.begin()) if "function.call.paren" in scope: counter = 100 + actual_parameter += 1 while counter > 0 and not found: counter -= 1 @@ -366,6 +369,10 @@ def inteltip_function(self, view, region, flags, location=None) : search_func = view.substr(word_region) scope = view.scope_name(word_region.begin()) + # log('search_func', search_func) + if search_func.strip() == ',': + actual_parameter += 1 + if "function.call" not in scope: break @@ -376,8 +383,9 @@ def inteltip_function(self, view, region, flags, location=None) : found = doctset.get(search_func) if found: - log(4, "param2: [%s]" % simple_escape(found.parameters)) + parameters = simple_escape(found.parameters) filename = os.path.basename(found.file_name) + log(4, "param2: [%s] '%s'", parameters, filename) if found.function_type : @@ -412,7 +420,19 @@ def inteltip_function(self, view, region, flags, location=None) : html += 'Return: ' + found.return_type + '' html += '
' - html += 'Params: (' + simple_escape(found.parameters) + ')' + html += 'Params: ' + html += '' + + # log('actual_parameter', actual_parameter, 'parameters', parameters) + if actual_parameter != -1 and parameters: + parameters = parameters.split(",") + if actual_parameter < len( parameters ): + parameters[actual_parameter] = '' + parameters[actual_parameter] + '' + html += ", ".join(parameters) + else: + html += parameters + + html += '' html += '
' html += '' ############################## END @@ -1054,7 +1074,7 @@ def __init__(self, function_name, parameters, file_name, function_type, return_t For `function_type` see FUNC_TYPES. """ self.function_name = function_name - self.parameters = parameters + self.parameters = parameters.strip() self.file_name = file_name self.function_type = function_type self.return_type = return_type