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

This commit is contained in:
Shane Kilkelly 2017-07-06 14:39:08 +01:00
commit 330e3dccc3
2 changed files with 11 additions and 11 deletions

View file

@ -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

View file

@ -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