kaminaly / vscode-react-pug

Syntax highlighting for pug with react (babel-plugin-transform-react-pug)
MIT License
9 stars 3 forks source link

Make code shorter #5

Closed ezhlobo closed 5 years ago

ezhlobo commented 5 years ago

During my investigation of the "Babel JavaScript" problem, I realized that some code is not used and some is not obligatory.

I'd like to know your opinion about that.

kaminaly commented 5 years ago

I've finally checked and merged your PR. Thanks a lot. @ezhlobo

cray0000 commented 5 years ago

@kaminaly @ezhlobo

This PR breaks highlighting for indented template strings.

function Hello () {
  return pug`
    div Hello
  ` // NOTE indent here
}

// This is still highlighting as pug code because closing ` is only caught when it's not indented with spaces
const x = 'Hello'

Rolling back to 0.0.2 fixes this issue.

Here are the screenshots:

[0.0.4] With spaces indentation. BROKEN: image

[0.0.4] Removing spaces indentation fixes it, but the code is not grammatically correct w/o indentations: image

[0.0.2] Rolling back to 0.0.2. Works just fine with indentations: image

kaminaly commented 5 years ago

@cray0000 thanks for the report. I will fix it soon.

kaminaly commented 5 years ago

@cray0000 I've fixed, pushed and published it. c006af9

cray0000 commented 5 years ago

@kaminaly that was quick! Thanks a lot, works now!