naomi icon indicating copy to clipboard operation
naomi copied to clipboard

Vue Single File Components

Open 2Pacalypse- opened this issue 8 years ago • 4 comments

Are there any plans on adding support for Vue's single-file components?

Here's the documentation on them: https://vuejs.org/v2/guide/single-file-components.html

2Pacalypse- avatar Apr 01 '18 12:04 2Pacalypse-

I'll add the vue syntax in a couple of weeks, the official one is being rewritten but it is using features that only works in sublime's dev build. Already got a basic prototype on my machine.

borela avatar Apr 02 '18 22:04 borela

Hello, @borela. What do you think about syntax highlighting for vue-templates in .js (not .vue) files?

In sublimetext3: img_03_10_01_4efb6dd1882

In vscode (Vue Inline Template plugin + Vetur plugin): img_03_10_01_b441477e931

I'm not sure how to better detect that it's a vue-template. May be some special comment? Or just check template: \s*<opentag .* /closetag>\s*? I dunno. I think it'll be great!

faiwer avatar Oct 03 '18 17:10 faiwer

@faiwer I am thinking about detecting by the project's type and file location, that way I could also disable Jest's globals from normal files.

For my personal projects it will be easy as I developed a toolbox that has a explicit project type, detecting Jest's tests shouldn't be hard too, do you think it's possible to detect Vue by some config?

borela avatar Oct 04 '18 00:10 borela

I think that developer can explicitly set all required fields in sumblime project config. Something like:

naomi: {
  vue: { used: true, re: /src.*\.js$/ },
  jest: { used: true, re /.../ },
},

faiwer avatar Oct 04 '18 05:10 faiwer