Skip to content

Commit

Permalink
Exposing fuzzySearchMinScore as setting (#25)
Browse files Browse the repository at this point in the history
* Exposing fuzzySearchMinScore as setting

* Renaming + fixing error + adding check
  • Loading branch information
gushuro authored and ramya-rao-a committed Mar 9, 2018
1 parent 31ddd68 commit 64d639e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/emmetHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ export function doComplete(document: TextDocument, position: Position, syntax: s
let tagToFindMoreSuggestionsFor = abbreviation;
let newTagMatches = abbreviation.match(/(>|\+)([\w:-]+)$/);
if (newTagMatches && newTagMatches.length === 3) {
tagToFindMoreSuggestionsFor = newTagMatches[2];
}
tagToFindMoreSuggestionsFor = newTagMatches[2];
}

let commonlyUsedTagSuggestions = makeSnippetSuggestion(commonlyUsedTags, tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
completionItems = completionItems.concat(commonlyUsedTagSuggestions);

Expand Down Expand Up @@ -767,9 +767,14 @@ function getFormatters(syntax: string, preferences: any) {
comment: commentFormatter
};
}

let fuzzySearchMinScore = typeof preferences['css.fuzzySearchMinScore'] === 'number' ? preferences['css.fuzzySearchMinScore'] : 0.3;
if (fuzzySearchMinScore > 1) {
fuzzySearchMinScore = 1
} else if (fuzzySearchMinScore < 0) {
fuzzySearchMinScore = 0
}
let stylesheetFormatter = {
'fuzzySearchMinScore': 0.3
'fuzzySearchMinScore': fuzzySearchMinScore
};
for (let key in preferences) {
switch (key) {
Expand Down

0 comments on commit 64d639e

Please # to comment.