Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/provider.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module.exports =

if @userSuggestions?
for userVar in @userSuggestions.user_vars when userVar.text.toLowerCase().indexOf(lowerCasePrefix) is 0
completions.push(@buildCompletion(userVar))
completions.push(@buildCompletion(userVar, prefix))

for variable in @completions.variables when variable.text.toLowerCase().indexOf(lowerCasePrefix) is 0
completions.push(@buildCompletion(variable))
Expand Down Expand Up @@ -181,19 +181,20 @@ module.exports =

if @userSuggestions?
for userVar in @userSuggestions.user_vars when userVar.text.toLowerCase().indexOf(lowerCasePrefix) is 0
completions.push(@buildCompletion(userVar))
completions.push(@buildCompletion(userVar, prefix))

for variable in @completions.variables when variable.text.toLowerCase().indexOf(lowerCasePrefix) is 0
completions.push(@buildCompletion(variable))

completions


buildCompletion: (suggestion) ->
buildCompletion: (suggestion, prefix = null) ->
text: suggestion.text
type: suggestion.type
displayText: suggestion.displayText ?= null
snippet: suggestion.snippet ?= null
leftLabel: suggestion.leftLabel ?= null
description: suggestion.description ?= "PHP <#{suggestion.text}> #{suggestion.type}"
descriptionMoreURL: suggestion.descriptionMoreURL ?= null
replacementPrefix: prefix