astro-vscode 2.0.13 → 2.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.
@@ -220517,7 +220517,7 @@ var require_utils6 = __commonJS({
220517
220517
  return getVirtualFile(EMPTY_FILE);
220518
220518
  }
220519
220519
  const className = classNameFromFilename(filePath);
220520
- const tsx = patchTSX(integrationEditorEntrypoint.toTSX(sourceCode, className));
220520
+ const tsx = patchTSX(integrationEditorEntrypoint.toTSX(sourceCode, className), fileName);
220521
220521
  return getVirtualFile(tsx);
220522
220522
  function getVirtualFile(content) {
220523
220523
  return {
@@ -220556,8 +220556,17 @@ var require_utils6 = __commonJS({
220556
220556
  return finalName;
220557
220557
  }
220558
220558
  exports.classNameFromFilename = classNameFromFilename;
220559
- function patchTSX(code) {
220560
- return code.replace("__AstroComponent_", "");
220559
+ function patchTSX(code, fileName) {
220560
+ const basename = path2.basename(fileName, path2.extname(fileName));
220561
+ const isDynamic = basename.startsWith("[") && basename.endsWith("]");
220562
+ return code.replace(/\b(\S*)__AstroComponent_/gm, (fullMatch, m1) => {
220563
+ if (!m1) {
220564
+ if (basename === "404")
220565
+ return "FourOhFour";
220566
+ return fullMatch;
220567
+ }
220568
+ return isDynamic ? `_${m1}_` : m1[0].toUpperCase() + m1.slice(1);
220569
+ });
220561
220570
  }
220562
220571
  exports.patchTSX = patchTSX;
220563
220572
  }
@@ -220583,7 +220592,7 @@ var require_astro2tsx = __commonJS({
220583
220592
  }
220584
220593
  exports.astro2tsx = astro2tsx;
220585
220594
  function getVirtualFileTSX(input, tsx, fileName, ts, htmlDocument) {
220586
- tsx.code = (0, utils_js_1.patchTSX)(tsx.code);
220595
+ tsx.code = (0, utils_js_1.patchTSX)(tsx.code, fileName);
220587
220596
  const v3Mappings = (0, sourcemap_codec_1.decode)(tsx.map.mappings);
220588
220597
  const sourcedDoc = vscode_html_languageservice_1.TextDocument.create(fileName, "astro", 0, input);
220589
220598
  const genDoc = vscode_html_languageservice_1.TextDocument.create(fileName + ".tsx", "typescriptreact", 0, tsx.code);
@@ -243249,12 +243258,7 @@ async function activate(context) {
243249
243258
  documentSelector: [{ language: "astro" }],
243250
243259
  initializationOptions
243251
243260
  };
243252
- client = new lsp.LanguageClient(
243253
- "astro-language-server",
243254
- "Astro Language Server",
243255
- serverOptions,
243256
- clientOptions
243257
- );
243261
+ client = new lsp.LanguageClient("astro", "Astro Language Server", serverOptions, clientOptions);
243258
243262
  await client.start();
243259
243263
  (0, import_vscode.activateAutoInsertion)([client], (document2) => document2.languageId === "astro");
243260
243264
  (0, import_vscode.activateFindFileReferences)("astro.findFileReferences", client);
@@ -65,7 +65,7 @@ var require_package = __commonJS({
65
65
  "../language-server/package.json"(exports2, module2) {
66
66
  module2.exports = {
67
67
  name: "@astrojs/language-server",
68
- version: "2.0.0",
68
+ version: "2.0.15",
69
69
  author: "withastro",
70
70
  license: "MIT",
71
71
  repository: {
@@ -93,19 +93,19 @@ var require_package = __commonJS({
93
93
  dependencies: {
94
94
  "@astrojs/compiler": "^1.5.0",
95
95
  "@jridgewell/sourcemap-codec": "^1.4.15",
96
- "@volar/kit": "^1.6.9",
97
- "@volar/language-core": "^1.6.9",
98
- "@volar/language-server": "^1.6.9",
99
- "@volar/language-service": "^1.6.9",
100
- "@volar/source-map": "^1.6.9",
96
+ "@volar/kit": "1.6.9",
97
+ "@volar/language-core": "1.6.9",
98
+ "@volar/language-server": "1.6.9",
99
+ "@volar/language-service": "1.6.9",
100
+ "@volar/source-map": "1.6.9",
101
101
  "fast-glob": "^3.2.12",
102
102
  "muggle-string": "^0.3.1",
103
- "volar-service-css": "^0.0.4",
104
- "volar-service-emmet": "^0.0.4",
105
- "volar-service-html": "^0.0.4",
106
- "volar-service-prettier": "^0.0.4",
107
- "volar-service-typescript": "^0.0.4",
108
- "volar-service-typescript-twoslash-queries": "^0.0.4",
103
+ "volar-service-css": "0.0.4",
104
+ "volar-service-emmet": "0.0.4",
105
+ "volar-service-html": "0.0.4",
106
+ "volar-service-prettier": "0.0.4",
107
+ "volar-service-typescript": "0.0.4",
108
+ "volar-service-typescript-twoslash-queries": "0.0.4",
109
109
  "vscode-html-languageservice": "^5.0.5",
110
110
  "vscode-uri": "^3.0.7"
111
111
  },
@@ -239816,7 +239816,7 @@ var require_utils = __commonJS({
239816
239816
  return getVirtualFile(EMPTY_FILE);
239817
239817
  }
239818
239818
  const className = classNameFromFilename(filePath);
239819
- const tsx = patchTSX(integrationEditorEntrypoint.toTSX(sourceCode, className));
239819
+ const tsx = patchTSX(integrationEditorEntrypoint.toTSX(sourceCode, className), fileName);
239820
239820
  return getVirtualFile(tsx);
239821
239821
  function getVirtualFile(content) {
239822
239822
  return {
@@ -239855,8 +239855,17 @@ var require_utils = __commonJS({
239855
239855
  return finalName;
239856
239856
  }
239857
239857
  exports2.classNameFromFilename = classNameFromFilename;
239858
- function patchTSX(code) {
239859
- return code.replace("__AstroComponent_", "");
239858
+ function patchTSX(code, fileName) {
239859
+ const basename = path.basename(fileName, path.extname(fileName));
239860
+ const isDynamic = basename.startsWith("[") && basename.endsWith("]");
239861
+ return code.replace(/\b(\S*)__AstroComponent_/gm, (fullMatch, m1) => {
239862
+ if (!m1) {
239863
+ if (basename === "404")
239864
+ return "FourOhFour";
239865
+ return fullMatch;
239866
+ }
239867
+ return isDynamic ? `_${m1}_` : m1[0].toUpperCase() + m1.slice(1);
239868
+ });
239860
239869
  }
239861
239870
  exports2.patchTSX = patchTSX;
239862
239871
  }
@@ -239882,7 +239891,7 @@ var require_astro2tsx = __commonJS({
239882
239891
  }
239883
239892
  exports2.astro2tsx = astro2tsx;
239884
239893
  function getVirtualFileTSX(input, tsx, fileName, ts, htmlDocument) {
239885
- tsx.code = (0, utils_js_1.patchTSX)(tsx.code);
239894
+ tsx.code = (0, utils_js_1.patchTSX)(tsx.code, fileName);
239886
239895
  const v3Mappings = (0, sourcemap_codec_1.decode)(tsx.map.mappings);
239887
239896
  const sourcedDoc = vscode_html_languageservice_1.TextDocument.create(fileName, "astro", 0, input);
239888
239897
  const genDoc = vscode_html_languageservice_1.TextDocument.create(fileName + ".tsx", "typescriptreact", 0, tsx.code);
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "color": "#17191E",
25
25
  "theme": "dark"
26
26
  },
27
- "version": "2.0.13",
27
+ "version": "2.0.15",
28
28
  "author": "withastro",
29
29
  "license": "MIT",
30
30
  "publisher": "astro-build",
@@ -208,7 +208,7 @@
208
208
  ]
209
209
  },
210
210
  "devDependencies": {
211
- "@astrojs/language-server": "^2.0.0",
211
+ "@astrojs/language-server": "^2.0.15",
212
212
  "@types/glob": "^8.1.0",
213
213
  "@types/mocha": "^10.0.1",
214
214
  "@types/node": "^16.18.26",