Skip to content

Commit

Permalink
fix completion for subfolder .js name
Browse files Browse the repository at this point in the history
  • Loading branch information
yomybaby committed Dec 30, 2016
1 parent d2de353 commit c8ec5c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/controllerProvider.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ alloyCompletionRules = [
files = find.fileSync /\.js$/, libPath
for file in files
completions.push
text : path.parse(file).name
text : file.replace(libPath+path.sep,'').split('.')[0]
type: 'require',
replacementPrefix : util.getCustomPrefix(request)
return completions
Expand All @@ -45,12 +45,14 @@ alloyCompletionRules = [
controllerPath = path.join(alloyRootPath,'controllers');
if util.isExistAsDirectory(controllerPath)
files = find.fileSync /\.js$/, controllerPath
console.log files
for file in files
# if currentPath != file # exclude current controller
completions.push
text: path.parse(file).name
text: file.replace(controllerPath+path.sep,'').split('.')[0]
type: 'require',
replacementPrefix : util.getCustomPrefix(request)
console.log completions
return completions
}
{
Expand Down

0 comments on commit c8ec5c4

Please sign in to comment.