volar-service-pug 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +25 -0
- package/out/baseParse.d.ts +1 -0
- package/out/baseParse.js +2 -5
- package/out/empty.d.ts +3 -2
- package/out/empty.js +6 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -24
- package/out/languageService.d.ts +1 -0
- package/out/pugDocument.d.ts +1 -0
- package/out/services/completion.d.ts +1 -0
- package/out/services/documentHighlight.d.ts +1 -0
- package/out/services/documentLinks.d.ts +1 -0
- package/out/services/foldingRanges.d.ts +1 -0
- package/out/services/hover.d.ts +1 -0
- package/out/services/quoteComplete.d.ts +1 -0
- package/out/services/scanner.d.ts +1 -0
- package/out/services/selectionRanges.d.ts +1 -0
- package/package.json +17 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-present Johnson Chu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# volar-service-pug
|
|
2
|
+
|
|
3
|
+
Volar plugin for [Pug](https://pugjs.org/).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install volar-service-pug
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
`volar.config.js`
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
module.exports = {
|
|
17
|
+
services: [
|
|
18
|
+
require('volar-service-pug').create(),
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
[MIT](LICENSE) © [Johnson Chu](https://github.com/johnsoncodehk)
|
package/out/baseParse.d.ts
CHANGED
package/out/baseParse.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.baseParse = void 0;
|
|
7
4
|
const muggle_string_1 = require("muggle-string");
|
|
8
5
|
const source_map_1 = require("@volar/source-map");
|
|
9
|
-
const
|
|
6
|
+
const pugLex = require("pug-lexer");
|
|
10
7
|
const vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument");
|
|
11
8
|
const pugParser = require('pug-parser');
|
|
12
9
|
function baseParse(pugCode) {
|
|
@@ -18,7 +15,7 @@ function baseParse(pugCode) {
|
|
|
18
15
|
let attrsBlocks;
|
|
19
16
|
let ast;
|
|
20
17
|
try {
|
|
21
|
-
const tokens = (
|
|
18
|
+
const tokens = pugLex(pugCode, { filename: fileName });
|
|
22
19
|
emptyLineEnds = collectEmptyLineEnds(tokens);
|
|
23
20
|
attrsBlocks = collectAttrsBlocks(tokens);
|
|
24
21
|
ast = pugParser(tokens, { filename: fileName, src: pugCode });
|
package/out/empty.d.ts
CHANGED
package/out/empty.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = void 0;
|
|
3
4
|
console.warn('volar-service-pug: this module is not yet supported for web.');
|
|
4
|
-
|
|
5
|
+
function create() {
|
|
6
|
+
return () => ({});
|
|
7
|
+
}
|
|
8
|
+
exports.create = create;
|
|
9
|
+
exports.default = create;
|
|
5
10
|
//# sourceMappingURL=empty.js.map
|
package/out/index.d.ts
CHANGED
package/out/index.js
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.create = void 0;
|
|
27
4
|
const volar_service_html_1 = require("volar-service-html");
|
|
28
5
|
const language_service_1 = require("@volar/language-service");
|
|
29
|
-
const pug =
|
|
6
|
+
const pug = require("./languageService");
|
|
30
7
|
function create() {
|
|
31
8
|
return (context, modules) => {
|
|
32
9
|
const htmlService = (0, volar_service_html_1.create)()(context, modules);
|
package/out/languageService.d.ts
CHANGED
|
@@ -30,3 +30,4 @@ export declare function getLanguageService(htmlLs: html.LanguageService): {
|
|
|
30
30
|
doQuoteComplete: (pugDoc: import("./pugDocument").PugDocument, pos: html.Position, options?: html.CompletionConfiguration | undefined) => string | null | undefined;
|
|
31
31
|
getFoldingRanges: (pugDoc: import("./pugDocument").PugDocument) => html.FoldingRange[];
|
|
32
32
|
};
|
|
33
|
+
//# sourceMappingURL=languageService.d.ts.map
|
package/out/pugDocument.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, pos: html.Position, documentContext: html.DocumentContext | undefined, options?: html.CompletionConfiguration | undefined) => Promise<html.CompletionList | undefined>;
|
|
4
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, pos: html.Position) => html.DocumentHighlight[] | undefined;
|
|
4
|
+
//# sourceMappingURL=documentHighlight.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, docContext: html.DocumentContext) => html.DocumentLink[];
|
|
4
|
+
//# sourceMappingURL=documentLinks.d.ts.map
|
package/out/services/hover.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, pos: html.Position, options?: html.HoverSettings | undefined) => html.Hover | undefined;
|
|
4
|
+
//# sourceMappingURL=hover.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, pos: html.Position, options?: html.CompletionConfiguration | undefined) => string | null | undefined;
|
|
4
|
+
//# sourceMappingURL=quoteComplete.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, initialOffset?: number) => html.Scanner | undefined;
|
|
4
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as html from 'vscode-html-languageservice';
|
|
2
2
|
import type { PugDocument } from '../pugDocument';
|
|
3
3
|
export declare function register(htmlLs: html.LanguageService): (pugDoc: PugDocument, posArr: html.Position[]) => html.SelectionRange[];
|
|
4
|
+
//# sourceMappingURL=selectionRanges.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volar-service-pug",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"description": "Integrate Pug into Volar",
|
|
5
|
+
"homepage": "https://github.com/volarjs/services/tree/master/packages/pug",
|
|
6
|
+
"bugs": "https://github.com/volarjs/services/issues",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"keywords": [
|
|
9
|
+
"volar-service"
|
|
10
|
+
],
|
|
4
11
|
"main": "out/index.js",
|
|
5
12
|
"license": "MIT",
|
|
6
13
|
"files": [
|
|
@@ -12,18 +19,23 @@
|
|
|
12
19
|
"url": "https://github.com/volarjs/services.git",
|
|
13
20
|
"directory": "packages/pug"
|
|
14
21
|
},
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "Johnson Chu",
|
|
24
|
+
"email": "johnsoncodehk@gmail.com",
|
|
25
|
+
"url": "https://github.com/johnsoncodehk"
|
|
26
|
+
},
|
|
15
27
|
"dependencies": {
|
|
16
28
|
"@volar/language-service": "~1.10.0",
|
|
17
29
|
"@volar/source-map": "~1.10.0",
|
|
18
30
|
"muggle-string": "^0.3.1",
|
|
19
31
|
"pug-lexer": "^5.0.1",
|
|
20
32
|
"pug-parser": "^6.0.0",
|
|
21
|
-
"volar-service-html": "0.0.
|
|
22
|
-
"vscode-html-languageservice": "^5.0
|
|
23
|
-
"vscode-languageserver-textdocument": "^1.0.
|
|
33
|
+
"volar-service-html": "0.0.15",
|
|
34
|
+
"vscode-html-languageservice": "^5.1.0",
|
|
35
|
+
"vscode-languageserver-textdocument": "^1.0.11"
|
|
24
36
|
},
|
|
25
37
|
"browser": {
|
|
26
38
|
"./out/index.js": "./out/empty.js"
|
|
27
39
|
},
|
|
28
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "3a59378715a959b433ca65700d2515d708469388"
|
|
29
41
|
}
|