@astrojs/language-server 0.8.9 → 0.8.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @astrojs/language-server
2
2
 
3
+ ## 0.8.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 5b16fb4: Fix errors showing on wrong line due to an error in TSX generation
8
+
3
9
  ## 0.8.9
4
10
 
5
11
  ### Patch Changes
@@ -18,7 +18,7 @@ function escapeTemplateLiteralContent(content) {
18
18
  return content.replace(/`/g, '\\`');
19
19
  }
20
20
  function default_1(content) {
21
- var _a, _b, _c;
21
+ var _a, _b;
22
22
  let result = {
23
23
  code: '',
24
24
  };
@@ -36,8 +36,9 @@ function default_1(content) {
36
36
  .replace(/---/g, '///');
37
37
  }
38
38
  // Content replacement
39
+ const htmlBegin = astroDocument.frontmatter.endOffset ? astroDocument.frontmatter.endOffset + 3 : 0;
39
40
  let htmlRaw = content
40
- .substring((_c = astroDocument.content.firstNonWhitespaceOffset) !== null && _c !== void 0 ? _c : 0)
41
+ .substring(htmlBegin)
41
42
  // Turn comments into JS comments
42
43
  .replace(/<\s*!--([^-->]*)(.*?)-->/gs, (whole) => {
43
44
  return `{/*${whole}*/}`;
@@ -77,7 +78,6 @@ function default_1(content) {
77
78
  });
78
79
  result.code =
79
80
  frontMatterRaw +
80
- '\n' +
81
81
  htmlRaw +
82
82
  os_1.EOL +
83
83
  // Add TypeScript definitions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/language-server",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "author": "withastro",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",