Fix code completion for parameters
@@ -1895,7 +1895,14 @@ fileprivate func parseArgs(_ args: inout [String]) {
}
let completion = completions[index]
- let suggestion = suggestions[index]
+ var suggestion = suggestions[index]
+
+ var isParam = false
+
+ if suggestion.hasSuffix("=") {
+ suggestion.removeLast()
+ isParam = true
+ }
let selectedRange = textView.contentTextView.selectedRange
@@ -1919,6 +1926,10 @@ fileprivate func parseArgs(_ args: inout [String]) {
self.textView.contentTextView.insertText(")")
self.textView.contentTextView.selectedRange = range
}
+
+ if isParam {
+ self.textView.contentTextView.insertText("=")
+ }
}
currentSuggestionIndex = -1
