wyreframe 0.2.1 → 0.2.2
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/package.json
CHANGED
|
@@ -178,15 +178,12 @@ function adjustCodeLineOffset(code, offset) {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
function adjustLineOffset(error, offset) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
context: error.context
|
|
188
|
-
};
|
|
189
|
-
}
|
|
181
|
+
let totalOffset = offset + 1 | 0;
|
|
182
|
+
return {
|
|
183
|
+
code: adjustCodeLineOffset(error.code, totalOffset),
|
|
184
|
+
severity: error.severity,
|
|
185
|
+
context: error.context
|
|
186
|
+
};
|
|
190
187
|
}
|
|
191
188
|
|
|
192
189
|
export {
|
|
@@ -217,18 +217,21 @@ let adjustCodeLineOffset = (code: errorCode, offset: int): errorCode => {
|
|
|
217
217
|
* Adjust the line offset in an error's position.
|
|
218
218
|
* Creates a new error with the position adjusted by the given offset.
|
|
219
219
|
*
|
|
220
|
+
* This function always adds +1 to convert from 0-indexed grid rows
|
|
221
|
+
* to 1-indexed file line numbers, plus any offset for stripped directive lines.
|
|
222
|
+
*
|
|
220
223
|
* @param error - The error to adjust
|
|
221
|
-
* @param offset - The number of lines
|
|
222
|
-
* @returns A new error with
|
|
224
|
+
* @param offset - The number of directive lines stripped before grid processing
|
|
225
|
+
* @returns A new error with 1-indexed line position
|
|
223
226
|
*/
|
|
224
227
|
let adjustLineOffset = (error: t, offset: int): t => {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
// Always add 1 to convert from 0-indexed to 1-indexed line numbers
|
|
229
|
+
// offset accounts for stripped directive lines (e.g., @scene: login)
|
|
230
|
+
// +1 converts from 0-indexed grid rows to 1-indexed file lines
|
|
231
|
+
let totalOffset = offset + 1
|
|
232
|
+
{
|
|
233
|
+
code: adjustCodeLineOffset(error.code, totalOffset),
|
|
234
|
+
severity: error.severity,
|
|
235
|
+
context: error.context,
|
|
233
236
|
}
|
|
234
237
|
}
|