提交 5f38d200 编写于 作者: M Martin Aeschlimann

[css] Evaluate the 2 browser rule for CSS auto-complete. Fixes #1233

上级 277510fe
......@@ -114,7 +114,7 @@ export class CSSIntellisense {
for (var key in properties) {
if (properties.hasOwnProperty(key)) {
var entry = properties[key];
if (entry.browsers.count > 1) { // only show if supported by more than one browser
if (entry.browsers.onCodeComplete) {
result.push({
label: entry.name,
documentationLabel: languageFacts.getEntryDescription(entry),
......@@ -433,7 +433,7 @@ export class CSSIntellisense {
public getCompletionsForSelector(ruleSet: nodes.RuleSet, result:Modes.ISuggestion[]): Modes.ISuggestion[] {
languageFacts.getPseudoClasses().forEach((entry) => {
if (entry.browsers.count > 1) { // only show if supported by all browsers
if (entry.browsers.onCodeComplete) {
result.push({
label: entry.name,
codeSnippet: entry.name,
......@@ -443,7 +443,7 @@ export class CSSIntellisense {
}
});
languageFacts.getPseudoElements().forEach((entry) => {
if (entry.browsers.count > 1) { // only show if supported by all browsers
if (entry.browsers.onCodeComplete) {
result.push({
label: entry.name,
codeSnippet: entry.name,
......
......@@ -434,6 +434,7 @@ export interface Browsers {
S?:string;
count:number;
all:boolean;
onCodeComplete:boolean
}
export interface Value {
......@@ -451,7 +452,7 @@ export interface IEntry {
}
function evalBrowserEntry(browsers: string) {
var browserEntry : Browsers = { all: false, count: 0};
var browserEntry : Browsers = { all: false, count: 0, onCodeComplete: false};
var count = 0;
if (browsers) {
browsers.split(',').forEach(
......@@ -475,6 +476,7 @@ function evalBrowserEntry(browsers: string) {
count = Number.MAX_VALUE;
}
browserEntry.count = count;
browserEntry.onCodeComplete = count > 0; // to be refined
return browserEntry;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册