Просмотр исходного кода

Merge branch 'sk-ac-rank-exact-match-highest' into sk-ac-improvements-integration

Shane Kilkelly 9 лет назад
Родитель
Сommit
330e3dccc3

+ 4 - 4
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

@@ -63,14 +63,14 @@ define [
 								caption: "\\#{commandName}{}",
 								snippet: "\\#{commandName}{}",
 								meta: "cross-reference",
-								score: 11000
+								score: 60
 							}
 							for label in labelsManager.getAllLabels()
 								result.push {
 									caption: "\\#{commandName}{#{label}#{if needsClosingBrace then '}' else ''}",
 									value: "\\#{commandName}{#{label}#{if needsClosingBrace then '}' else ''}",
 									meta: "cross-reference",
-									score: 10000
+									score: 50
 								}
 							callback null, result
 
@@ -97,7 +97,7 @@ define [
 								caption: "\\#{commandName}{}",
 								snippet: "\\#{commandName}{}",
 								meta: "reference",
-								score: 11000
+								score: 60
 							}
 							if references.keys and references.keys.length > 0
 								references.keys.forEach (key) ->
@@ -106,7 +106,7 @@ define [
 											caption: "\\#{commandName}{#{previousArgsCaption}#{key}#{if needsClosingBrace then '}' else ''}",
 											value: "\\#{commandName}{#{previousArgs}#{key}#{if needsClosingBrace then '}' else ''}",
 											meta: "reference",
-											score: 10000
+											score: 50
 										})
 								callback null, result
 							else

+ 7 - 7
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee

@@ -80,10 +80,10 @@ define [], () ->
 			doc = session.getValue()
 			parser = new Parser(doc)
 			commands = parser.parse()
-
 			completions = []
 			for command in commands
 				caption = "\\#{command[0]}"
+				score = if prefix == caption then 99 else 50
 				snippet = caption
 				i = 1
 				_.times command[1], () ->
@@ -94,12 +94,12 @@ define [], () ->
 					snippet += "{${#{i}}}"
 					caption += "{}"
 					i++
-				unless caption == prefix
-					completions.push {
-						caption: caption
-						snippet: snippet
-						meta: "cmd"
-					}
+				completions.push {
+					caption: caption
+					snippet: snippet
+					meta: "cmd"
+					score: score
+				}
 
 			callback null, completions