提交 e39c3f9b 编写于 作者: M Martin Aeschlimann

[scss] IntelliSense Suggestions After Semicolon #250

上级 2801eac2
......@@ -105,7 +105,10 @@ export class CSSIntellisense {
}
public getCompletionsForDeclarationProperty(result:Modes.ISuggestion[]):Modes.ISuggestion[] {
return this.getPropertyProposals(result);
}
private getPropertyProposals(result:Modes.ISuggestion[]):Modes.ISuggestion[] {
var properties = languageFacts.getProperties();
for (var key in properties) {
......@@ -341,7 +344,7 @@ export class CSSIntellisense {
if (ruleSet && ruleSet.isNested()) {
var selector = ruleSet.getSelectors().findFirstChildBeforeOffset(this.offset);
if (selector && ruleSet.getSelectors().getChildren().indexOf(selector) === 0) {
this.getCompletionsForDeclarationProperty(result);
this.getPropertyProposals(result);
}
}
return result;
......
......@@ -148,9 +148,9 @@ export class SASSIntellisense extends cssIntellisense.CSSIntellisense {
return super.getColorProposals(entry, result);
}
public getCompletionsForDeclarations(declarations: nodes.Declarations, result: Modes.ISuggestion[]): Modes.ISuggestion[]{
public getCompletionsForDeclarationProperty(result: Modes.ISuggestion[]): Modes.ISuggestion[]{
this.getCompletionsForSelector(null, result);
return super.getCompletionsForDeclarations(declarations, result);
return super.getCompletionsForDeclarationProperty(result);
}
}
......
......@@ -112,6 +112,11 @@ suite('SASS - Worker', () => {
testSuggestionsFor('.foo { .', '{ .').then((completion) => {
assert.equal(completion.currentWord, '');
assertSuggestion(completion, '.foo');
}),
// issue #250
testSuggestionsFor('.foo { display: block;', 'block;').then((completion) => {
assert.equal(completion.currentWord, '');
assert.equal(0, completion.suggestions.length);
})
]).done(() => testDone(), (errors:any[]) => {
testDone(errors.reduce((e1, e2) => e1 || e2));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册