Skip to content

Commit

Permalink
fix(vscode): show suggestions in postcss files (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Feb 23, 2023
1 parent 0e5434f commit 0e21aa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shared-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function getMatchedPositions(code: string, matched: string[], hasVariantG

// highlight for plain classes
let start = 0
code.split(/([\s"'`;<>]|:\(|\)"|\)\s)/g).forEach((i) => {
code.split(/([\s"'`;<>*]|:\(|\)"|\)\s)/g).forEach((i) => {
const end = start + i.length
if (isPug) {
result.push(...getPlainClassMatchedPositionsForPug(i, plain, start))
Expand Down Expand Up @@ -133,7 +133,7 @@ export function getMatchedPositions(code: string, matched: string[], hasVariantG
const [, pre, sep, body] = match
const index = match.index!
let start = index + pre.length + sep.length + 1
body.split(/([\s"'`;<>]|:\(|\)"|\)\s)/g).forEach((i) => {
body.split(/([\s"'`;<>*]|:\(|\)"|\)\s)/g).forEach((i) => {
const end = start + i.length
const full = pre + sep + i
if (plain.has(full)) {
Expand Down
1 change: 1 addition & 0 deletions packages/vscode/src/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const languageIds = [
'hbs',
'html',
'css',
'postcss',
'javascript',
'javascriptreact',
'markdown',
Expand Down

0 comments on commit 0e21aa7

Please sign in to comment.