├── .github └── workflows │ └── test.yml ├── LICENSE ├── README.md ├── grammars └── vue.cson ├── package.json ├── snippets ├── slot.cson └── vue.cson └── spec └── grammars-spec.js /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - pull_request 4 | jobs: 5 | test: 6 | name: Test 7 | strategy: 8 | matrix: 9 | os: [ubuntu-20.04, macos-latest, windows-2019] 10 | fail-fast: false 11 | runs-on: ${{ matrix.os }} 12 | steps: 13 | - name: Checkout the Latest Package Code 14 | uses: actions/checkout@v3 15 | - name: Setup Pulsar Editor 16 | uses: pulsar-edit/action-pulsar-dependency@v3.3 17 | - name: Run the headless Pulsar Tests 18 | uses: coactions/setup-xvfb@v1.0.1 19 | with: 20 | run: pulsar --test spec 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Original work Copyright (c) 2013-2015 Evan You 4 | Modified work Copyright (c) 2015-2016 Viktor Hedefalk, Aidi Stan 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Warning! 2 | 3 | Maintenance Mode: While this package is no longer maintained by @hedefalk, this package is still receiving maintenance as needed. // @confused-Techie 4 | 5 | # Vue component support in Atom/Pulsar 6 | 7 | Adds syntax highlighting and snippets to Vue component files in Pulsar. 8 | 9 | Originally [converted](https://pulsar-edit.dev/docs/launch-manual/sections/core-hacking/#converting-from-textmate) from [vuejs/vue-syntax-highlight](https://github.com/vuejs/vue-syntax-highlight/tree/479672799b4162996e3c3c7e09583fb6d98e1e6c). 10 | 11 | ## Working with SCSS/Sass 12 | 13 | Since vue-loader redirects `language=x` to loader `style!css!x` and sass-loader is using **SCSS** as default, you need to remap them in *webpack.config.js*: 14 | 15 | ``` 16 | vue: { 17 | loaders: { 18 | sass: 'style!css!sass?indentedSyntax', 19 | scss: 'style!css!sass' 20 | } 21 | } 22 | ``` 23 | 24 | This is so that this package can support both old Sass and new SCSS. Refer to [hedefalk/atom-vue#5](https://github.com/hedefalk/atom-vue/issues/5) and [the official solution](https://github.com/vuejs-templates/webpack/blob/45c5ee5531a6f649c21aa2ec05472fb459247927/template/build/utils.js#L37-L38) for more info. 25 | -------------------------------------------------------------------------------- /grammars/vue.cson: -------------------------------------------------------------------------------- 1 | fileTypes: [ 2 | "vue" 3 | ] 4 | name: "Vue Component" 5 | patterns: [ 6 | { 7 | include: "#vue-template-expression" 8 | } 9 | { 10 | include: "#vue-template-expression-html" 11 | } 12 | { 13 | name: "meta.tag.any.html" 14 | begin: "(<)([a-zA-Z0-9:]++)(?=[^>]*>)" 15 | beginCaptures: 16 | "1": 17 | name: "punctuation.definition.tag.begin.html" 18 | "2": 19 | name: "entity.name.tag.html" 20 | end: "(>)(<)(/)(\\2)(>)" 21 | endCaptures: 22 | "1": 23 | name: "punctuation.definition.tag.end.html" 24 | "2": 25 | name: "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" 26 | "3": 27 | name: "punctuation.definition.tag.begin.html" 28 | "4": 29 | name: "entity.name.tag.html" 30 | "5": 31 | name: "punctuation.definition.tag.end.html" 32 | patterns: [ 33 | { 34 | include: "#tag-stuff" 35 | } 36 | ] 37 | } 38 | { 39 | name: "meta.tag.preprocessor.xml.html" 40 | begin: "(<\\?)(xml)" 41 | end: "(\\?>)" 42 | captures: 43 | "1": 44 | name: "punctuation.definition.tag.html" 45 | "2": 46 | name: "entity.name.tag.xml.html" 47 | patterns: [ 48 | { 49 | include: "#tag-generic-attribute" 50 | } 51 | { 52 | include: "#string-double-quoted" 53 | } 54 | { 55 | include: "#string-single-quoted" 56 | } 57 | ] 58 | } 59 | { 60 | name: "comment.block.html" 61 | begin: " 2172 | 2173 | 2174 | 2175 | 2176 | 2177 | 2178 | ` 2179 | ); 2180 | 2181 | expect(tokens[0]).toEqual({ 2182 | value: "<", 2183 | scopes: [ "text.html.vue", "meta.tag.other.html", "punctuation.definition.tag.begin.html" ] 2184 | }); 2185 | 2186 | expect(tokens[1]).toEqual({ 2187 | value: "template", 2188 | scopes: [ "text.html.vue", "meta.tag.other.html", "entity.name.tag.other.html" ] 2189 | }); 2190 | 2191 | expect(tokens[2]).toEqual({ 2192 | value: ">", 2193 | scopes: [ "text.html.vue", "meta.tag.other.html", "punctuation.definition.tag.end.html" ] 2194 | }); 2195 | 2196 | expect(tokens[3]).toEqual({ 2197 | value: "\n ", 2198 | scopes: [ "text.html.vue" ] 2199 | }); 2200 | 2201 | expect(tokens[4]).toEqual({ 2202 | value: "", 2213 | scopes: [ "text.html.vue", "comment.block.html", "punctuation.definition.comment.html" ] 2214 | }); 2215 | 2216 | expect(tokens[7]).toEqual({ 2217 | value: "\n ", 2218 | scopes: [ "text.html.vue" ] 2219 | }); 2220 | 2221 | expect(tokens[8]).toEqual({ 2222 | value: "", 2233 | scopes: [ "text.html.vue", "comment.block.html", "punctuation.definition.comment.html" ] 2234 | }); 2235 | 2236 | expect(tokens[11]).toEqual({ 2237 | value: "\n ", 2238 | scopes: [ "text.html.vue" ] 2239 | }); 2240 | 2241 | expect(tokens[12]).toEqual({ 2242 | value: "<", 2243 | scopes: [ "text.html.vue", "meta.tag.inline.any.html", "punctuation.definition.tag.begin.html" ] 2244 | }); 2245 | 2246 | expect(tokens[13]).toEqual({ 2247 | value: "input", 2248 | scopes: [ "text.html.vue", "meta.tag.inline.any.html", "entity.name.tag.inline.any.html" ] 2249 | }); 2250 | 2251 | expect(tokens[14]).toEqual({ 2252 | value: " />", 2253 | scopes: [ "text.html.vue", "meta.tag.inline.any.html", "punctuation.definition.tag.end.html" ] 2254 | }); 2255 | 2256 | expect(tokens[15]).toEqual({ 2257 | value: "\n ", 2258 | scopes: [ "text.html.vue" ] 2259 | }); 2260 | 2261 | expect(tokens[16]).toEqual({ 2262 | value: "", 2273 | scopes: [ "text.html.vue", "comment.block.html", "punctuation.definition.comment.html" ] 2274 | }); 2275 | 2276 | expect(tokens[19]).toEqual({ 2277 | value: "\n ", 2278 | scopes: [ "text.html.vue" ] 2279 | }); 2280 | 2281 | expect(tokens[20]).toEqual({ 2282 | value: "", 2293 | scopes: [ "text.html.vue", "comment.block.html", "punctuation.definition.comment.html" ] 2294 | }); 2295 | 2296 | expect(tokens[23]).toEqual({ 2297 | value: "\n ", 2298 | scopes: [ "text.html.vue" ] 2299 | }); 2300 | 2301 | expect(tokens[24]).toEqual({ 2302 | value: "<", 2303 | scopes: [ "text.html.vue", "meta.tag.other.html", "punctuation.definition.tag.begin.html" ] 2304 | }); 2305 | 2306 | expect(tokens[25]).toEqual({ 2307 | value: "CustomInput", 2308 | scopes: [ "text.html.vue", "meta.tag.other.html", "entity.name.tag.other.html" ] 2309 | }); 2310 | 2311 | expect(tokens[26]).toEqual({ 2312 | value: " ", 2313 | scopes: [ "text.html.vue", "meta.tag.other.html" ] 2314 | }); 2315 | 2316 | expect(tokens[27]).toEqual({ 2317 | value: "/>", 2318 | scopes: [ "text.html.vue", "meta.tag.other.html", "punctuation.definition.tag.end.html" ] 2319 | }); 2320 | 2321 | expect(tokens[28]).toEqual({ 2322 | value: "\n", 2323 | scopes: [ "text.html.vue" ] 2324 | }); 2325 | 2326 | expect(tokens[29]).toEqual({ 2327 | value: "", 2338 | scopes: [ "text.html.vue", "meta.tag.other.html", "punctuation.definition.tag.end.html" ] 2339 | }); 2340 | 2341 | expect(tokens[32]).toEqual({ 2342 | value: "\n", 2343 | scopes: [ "text.html.vue" ] 2344 | }); 2345 | }); 2346 | 2347 | }); 2348 | }); 2349 | --------------------------------------------------------------------------------