@@ -128,24 +128,29 @@ var CssCompletions = function() {
128
128
if ( state === 'ruleset' || session . $mode . $id == "ace/mode/scss" ) {
129
129
//css attribute value
130
130
var line = session . getLine ( pos . row ) . substr ( 0 , pos . column ) ;
131
+ var inParens = / \( [ ^ ) ] * $ / . test ( line ) ;
132
+ if ( inParens ) {
133
+ line = line . substr ( line . lastIndexOf ( '(' ) + 1 ) ;
134
+ }
131
135
if ( / : [ ^ ; ] + $ / . test ( line ) ) {
132
136
/ ( [ \w \- ] + ) : [ ^ : ] * $ / . test ( line ) ;
133
137
134
138
return this . getPropertyValueCompletions ( state , session , pos , prefix ) ;
135
139
} else {
136
- return this . getPropertyCompletions ( state , session , pos , prefix ) ;
140
+ return this . getPropertyCompletions ( state , session , pos , prefix , inParens ) ;
137
141
}
138
142
}
139
143
140
144
return [ ] ;
141
145
} ;
142
146
143
- this . getPropertyCompletions = function ( state , session , pos , prefix ) {
147
+ this . getPropertyCompletions = function ( state , session , pos , prefix , skipSemicolon ) {
148
+ skipSemicolon = skipSemicolon || false ;
144
149
var properties = Object . keys ( propertyMap ) ;
145
150
return properties . map ( function ( property ) {
146
151
return {
147
152
caption : property ,
148
- snippet : property + ': $0;' ,
153
+ snippet : property + ': $0' + ( skipSemicolon ? '' : ';' ) ,
149
154
meta : "property" ,
150
155
score : 1000000
151
156
} ;
0 commit comments