@zentryc5t/ts-plugin-for-bruno 1.0.2 → 1.0.4
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/README.md +8 -1
- package/out/index.js +14 -23
- package/out/index.js.map +1 -1
- package/package.json +4 -1
- package/src/index.ts +36 -41
package/README.md
CHANGED
|
@@ -6,4 +6,11 @@ This directory provides an `npm` package for a Typescript language service plugi
|
|
|
6
6
|
|
|
7
7
|
## Main Features
|
|
8
8
|
|
|
9
|
-
Only some of the intellisense features for `Bruno` files are provided by this npm package. For a fuller set of intellisense features, you can use the VS Code extension, that is built from the root folder of this git repository.
|
|
9
|
+
Only some of the intellisense features for `Bruno` files are provided by this npm package. For a fuller set of intellisense features, you can use the VS Code extension, that is built from the root folder of this git repository.
|
|
10
|
+
|
|
11
|
+
## Debugging
|
|
12
|
+
|
|
13
|
+
For using the local TS plugin within the VS Code extension, please follow these steps:
|
|
14
|
+
- Replace the `name` in the base [package.json](../../package.json) for the `typescriptServerPlugins` contibution field with the name `typescript-for-bruno`.
|
|
15
|
+
- In the base [tsconfig.json](../../tsconfig.json) replace the value for the `plugins` field with the commented out plugins value.
|
|
16
|
+
- Use the launch configuration `Run Extension With local TS plugin` for launching the extension
|
package/out/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const path_1 = require("path");
|
|
3
|
+
const ts = require("typescript/lib/tsserverlibrary");
|
|
3
4
|
function init(_modules) {
|
|
4
5
|
function create(info) {
|
|
5
6
|
// Set up decorator object
|
|
@@ -60,7 +61,7 @@ function filterDefaultDiagnostics(info, fileName, defaultDiagnostics) {
|
|
|
60
61
|
}
|
|
61
62
|
const indizes = [];
|
|
62
63
|
for (const blockName of Object.values(TextBlockName)) {
|
|
63
|
-
const indizesForBlock =
|
|
64
|
+
const indizesForBlock = getCodeBlockStartAndEndIndex(fileContent, blockName);
|
|
64
65
|
if (indizesForBlock) {
|
|
65
66
|
indizes.push({ blockName, ...indizesForBlock });
|
|
66
67
|
}
|
|
@@ -81,36 +82,26 @@ function filterDefaultDiagnostics(info, fileName, defaultDiagnostics) {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function getCodeBlockStartAndEndIndex(fullTextContent, blockName) {
|
|
85
86
|
const openingBracketChar = "{";
|
|
86
|
-
const closingBracketChar = "}";
|
|
87
87
|
const startPattern = new RegExp(`^\\s*${blockName}\\s*${openingBracketChar}\\s*$`, "m");
|
|
88
88
|
const startMatches = startPattern.exec(fullTextContent);
|
|
89
89
|
if (!startMatches || startMatches.length == 0) {
|
|
90
90
|
return undefined;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
93
|
-
const remainingDoc = fullTextContent.substring(
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
currentChar == openingBracketChar
|
|
102
|
-
? 1
|
|
103
|
-
: currentChar == closingBracketChar
|
|
104
|
-
? -1
|
|
105
|
-
: 0;
|
|
106
|
-
remainingDocCurrentIndex++;
|
|
107
|
-
}
|
|
108
|
-
if (openBracketsOnBlockLevel > 0) {
|
|
109
|
-
return undefined;
|
|
92
|
+
const blockStartIndex = startMatches.index;
|
|
93
|
+
const remainingDoc = fullTextContent.substring(blockStartIndex);
|
|
94
|
+
const sourceFile = ts.createSourceFile("test.js", remainingDoc, ts.ScriptTarget.ES2020);
|
|
95
|
+
const blockNodeInSubDocument = sourceFile
|
|
96
|
+
.getChildAt(0, sourceFile)
|
|
97
|
+
.getChildren(sourceFile)
|
|
98
|
+
.find(({ kind }) => kind == ts.SyntaxKind.Block);
|
|
99
|
+
if (!blockNodeInSubDocument) {
|
|
100
|
+
throw new Error(`Could not find code block within given subdocument: ${remainingDoc}`);
|
|
110
101
|
}
|
|
111
102
|
return {
|
|
112
|
-
startIndex:
|
|
113
|
-
endIndex:
|
|
103
|
+
startIndex: blockStartIndex + startMatches[0].indexOf(openingBracketChar) + 1,
|
|
104
|
+
endIndex: blockStartIndex + blockNodeInSubDocument.end,
|
|
114
105
|
};
|
|
115
106
|
}
|
|
116
107
|
function isBrunoFile(fileName) {
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,qDAAqD;AAErD,SAAS,IAAI,CAAC,QAEb;IACG,SAAS,MAAM,CAAC,IAAgC;QAC5C,0BAA0B;QAC1B,MAAM,KAAK,GAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEtD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CACvB,IAAI,CAAC,eAAe,CACS,EAAE,CAAC;YAChC,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAE,CAAC;YACnC,yEAAyE;YACzE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;YAC9B,yEAAyE;YACzE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC;QAED,KAAK,CAAC,uBAAuB,GAAG,CAAC,QAAQ,EAAE,EAAE;YACzC,OAAO,wBAAwB,CAC3B,IAAI,EACJ,QAAQ,EACR,IAAI,CAAC,eAAe,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAC1B,CAAC;QACrC,CAAC,CAAC;QAEF,KAAK,CAAC,sBAAsB,GAAG,CAAC,QAAQ,EAAE,EAAE;YACxC,OAAO,wBAAwB,CAC3B,IAAI,EACJ,QAAQ,EACR,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CACxD,CAAC;QACN,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AgB;IACjC,OAAO,IAAA,cAAO,EAAC,QAAQ,CAAC,IAAI,MAAM,CAAC;AACvC,CAAC;AAED,IAAK,aAIJ;AAJD,WAAK,aAAa;IACd,gCAAe,CAAA;IACf,wDAAuC,CAAA;IACvC,4DAA2C,CAAA;AAC/C,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAED,iBAAS,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zentryc5t/ts-plugin-for-bruno",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"main": "./out/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -10,5 +10,8 @@
|
|
|
10
10
|
"description": "",
|
|
11
11
|
"repository": {
|
|
12
12
|
"url": "https://github.com/daniel-b92/bruno-vs-code-extension/tree/main/src/tsPlugin"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"typescript": "^5.9.2"
|
|
13
16
|
}
|
|
14
17
|
}
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ function init(_modules: {
|
|
|
9
9
|
const proxy: ts.LanguageService = Object.create(null);
|
|
10
10
|
|
|
11
11
|
for (const k of Object.keys(
|
|
12
|
-
info.languageService
|
|
12
|
+
info.languageService,
|
|
13
13
|
) as (keyof ts.LanguageService)[]) {
|
|
14
14
|
const x = info.languageService[k]!;
|
|
15
15
|
// @ts-expect-error - JS runtime trickery which is tricky to type tersely
|
|
@@ -22,7 +22,7 @@ function init(_modules: {
|
|
|
22
22
|
return filterDefaultDiagnostics(
|
|
23
23
|
info,
|
|
24
24
|
fileName,
|
|
25
|
-
info.languageService.getSyntacticDiagnostics(fileName)
|
|
25
|
+
info.languageService.getSyntacticDiagnostics(fileName),
|
|
26
26
|
) as ts.DiagnosticWithLocation[];
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ function init(_modules: {
|
|
|
30
30
|
return filterDefaultDiagnostics(
|
|
31
31
|
info,
|
|
32
32
|
fileName,
|
|
33
|
-
info.languageService.getSemanticDiagnostics(fileName)
|
|
33
|
+
info.languageService.getSemanticDiagnostics(fileName),
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -44,7 +44,7 @@ function init(_modules: {
|
|
|
44
44
|
const allDiagnosticsForCodeBlocks = filterDefaultDiagnostics(
|
|
45
45
|
info,
|
|
46
46
|
fileName,
|
|
47
|
-
defaultDiagnostics
|
|
47
|
+
defaultDiagnostics,
|
|
48
48
|
) as ts.DiagnosticWithLocation[];
|
|
49
49
|
|
|
50
50
|
// The ts server always reports errors when importing a Javascript function in a .bru file.
|
|
@@ -52,7 +52,7 @@ function init(_modules: {
|
|
|
52
52
|
// Do not show diagnostics that only make sense for Typescript files.
|
|
53
53
|
// Bru file code blocks should be treated like Javascript functions instead.
|
|
54
54
|
// A list of diagnostics can be found here: https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json
|
|
55
|
-
({ code }) => (code < 7_043 || code > 7_050) && code != 80_004
|
|
55
|
+
({ code }) => (code < 7_043 || code > 7_050) && code != 80_004,
|
|
56
56
|
);
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -62,7 +62,7 @@ function init(_modules: {
|
|
|
62
62
|
? undefined
|
|
63
63
|
: info.languageService.getQuickInfoAtPosition(
|
|
64
64
|
fileName,
|
|
65
|
-
position
|
|
65
|
+
position,
|
|
66
66
|
);
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -77,7 +77,7 @@ function init(_modules: {
|
|
|
77
77
|
function filterDefaultDiagnostics(
|
|
78
78
|
info: ts.server.PluginCreateInfo,
|
|
79
79
|
fileName: string,
|
|
80
|
-
defaultDiagnostics: (ts.Diagnostic | ts.DiagnosticWithLocation)[]
|
|
80
|
+
defaultDiagnostics: (ts.Diagnostic | ts.DiagnosticWithLocation)[],
|
|
81
81
|
) {
|
|
82
82
|
if (!isBrunoFile(fileName)) {
|
|
83
83
|
return defaultDiagnostics;
|
|
@@ -103,9 +103,9 @@ function filterDefaultDiagnostics(
|
|
|
103
103
|
}[] = [];
|
|
104
104
|
|
|
105
105
|
for (const blockName of Object.values(TextBlockName)) {
|
|
106
|
-
const indizesForBlock =
|
|
106
|
+
const indizesForBlock = getCodeBlockStartAndEndIndex(
|
|
107
107
|
fileContent,
|
|
108
|
-
blockName
|
|
108
|
+
blockName,
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
if (indizesForBlock) {
|
|
@@ -120,16 +120,19 @@ function filterDefaultDiagnostics(
|
|
|
120
120
|
length != undefined &&
|
|
121
121
|
indizes.some(
|
|
122
122
|
({ startIndex: blockStart, endIndex: blockEnd }) =>
|
|
123
|
-
start >= blockStart && start <= blockEnd
|
|
123
|
+
start >= blockStart && start <= blockEnd,
|
|
124
124
|
) &&
|
|
125
125
|
// Do not show diagnostics for functions that are provided by Bruno at runtime
|
|
126
126
|
!["bru", "req", "res", "test", "expect"].includes(
|
|
127
|
-
(fileContent as string).substring(
|
|
127
|
+
(fileContent as string).substring(
|
|
128
|
+
start,
|
|
129
|
+
start + length,
|
|
130
|
+
),
|
|
128
131
|
) &&
|
|
129
132
|
// Avoid showing incorrect error when using `require`
|
|
130
133
|
// (the error seems to only occur for short periods of time when typescript type definitions have not been reloaded for a while)
|
|
131
134
|
(fileContent as string).substring(start, start + length) !=
|
|
132
|
-
"require"
|
|
135
|
+
"require",
|
|
133
136
|
);
|
|
134
137
|
} else {
|
|
135
138
|
return [];
|
|
@@ -137,16 +140,15 @@ function filterDefaultDiagnostics(
|
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
142
|
|
|
140
|
-
function
|
|
143
|
+
function getCodeBlockStartAndEndIndex(
|
|
141
144
|
fullTextContent: string,
|
|
142
|
-
blockName: TextBlockName
|
|
145
|
+
blockName: TextBlockName,
|
|
143
146
|
) {
|
|
144
147
|
const openingBracketChar = "{";
|
|
145
|
-
const closingBracketChar = "}";
|
|
146
148
|
|
|
147
149
|
const startPattern = new RegExp(
|
|
148
150
|
`^\\s*${blockName}\\s*${openingBracketChar}\\s*$`,
|
|
149
|
-
"m"
|
|
151
|
+
"m",
|
|
150
152
|
);
|
|
151
153
|
const startMatches = startPattern.exec(fullTextContent);
|
|
152
154
|
|
|
@@ -154,37 +156,30 @@ function getTextBlockStartAndEndIndex(
|
|
|
154
156
|
return undefined;
|
|
155
157
|
}
|
|
156
158
|
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
+
const blockStartIndex = startMatches.index;
|
|
160
|
+
const remainingDoc = fullTextContent.substring(blockStartIndex);
|
|
159
161
|
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
while (
|
|
166
|
-
openBracketsOnBlockLevel > 0 &&
|
|
167
|
-
remainingDocCurrentIndex < remainingDocLength
|
|
168
|
-
) {
|
|
169
|
-
const currentChar = remainingDoc.charAt(remainingDocCurrentIndex);
|
|
162
|
+
const sourceFile = ts.createSourceFile(
|
|
163
|
+
"test.js",
|
|
164
|
+
remainingDoc,
|
|
165
|
+
ts.ScriptTarget.ES2020,
|
|
166
|
+
);
|
|
170
167
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
? -1
|
|
176
|
-
: 0;
|
|
168
|
+
const blockNodeInSubDocument = (sourceFile as ts.Node)
|
|
169
|
+
.getChildAt(0, sourceFile)
|
|
170
|
+
.getChildren(sourceFile)
|
|
171
|
+
.find(({ kind }) => kind == ts.SyntaxKind.Block);
|
|
177
172
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return undefined;
|
|
173
|
+
if (!blockNodeInSubDocument) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
`Could not find code block within given subdocument: ${remainingDoc}`,
|
|
176
|
+
);
|
|
183
177
|
}
|
|
184
178
|
|
|
185
179
|
return {
|
|
186
|
-
startIndex:
|
|
187
|
-
|
|
180
|
+
startIndex:
|
|
181
|
+
blockStartIndex + startMatches[0].indexOf(openingBracketChar) + 1,
|
|
182
|
+
endIndex: blockStartIndex + blockNodeInSubDocument.end,
|
|
188
183
|
};
|
|
189
184
|
}
|
|
190
185
|
|