astro-vscode 2.0.13 → 2.0.14

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,10 @@ 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_/, (_, m1) => isDynamic ? `_${m1}_` : m1[0].toUpperCase() + m1.slice(1));
220561
220563
  }
220562
220564
  exports.patchTSX = patchTSX;
220563
220565
  }
@@ -220583,7 +220585,7 @@ var require_astro2tsx = __commonJS({
220583
220585
  }
220584
220586
  exports.astro2tsx = astro2tsx;
220585
220587
  function getVirtualFileTSX(input, tsx, fileName, ts, htmlDocument) {
220586
- tsx.code = (0, utils_js_1.patchTSX)(tsx.code);
220588
+ tsx.code = (0, utils_js_1.patchTSX)(tsx.code, fileName);
220587
220589
  const v3Mappings = (0, sourcemap_codec_1.decode)(tsx.map.mappings);
220588
220590
  const sourcedDoc = vscode_html_languageservice_1.TextDocument.create(fileName, "astro", 0, input);
220589
220591
  const genDoc = vscode_html_languageservice_1.TextDocument.create(fileName + ".tsx", "typescriptreact", 0, tsx.code);
@@ -243249,12 +243251,7 @@ async function activate(context) {
243249
243251
  documentSelector: [{ language: "astro" }],
243250
243252
  initializationOptions
243251
243253
  };
243252
- client = new lsp.LanguageClient(
243253
- "astro-language-server",
243254
- "Astro Language Server",
243255
- serverOptions,
243256
- clientOptions
243257
- );
243254
+ client = new lsp.LanguageClient("astro", "Astro Language Server", serverOptions, clientOptions);
243258
243255
  await client.start();
243259
243256
  (0, import_vscode.activateAutoInsertion)([client], (document2) => document2.languageId === "astro");
243260
243257
  (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.14",
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,10 @@ 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_/, (_, m1) => isDynamic ? `_${m1}_` : m1[0].toUpperCase() + m1.slice(1));
239860
239862
  }
239861
239863
  exports2.patchTSX = patchTSX;
239862
239864
  }
@@ -239882,7 +239884,7 @@ var require_astro2tsx = __commonJS({
239882
239884
  }
239883
239885
  exports2.astro2tsx = astro2tsx;
239884
239886
  function getVirtualFileTSX(input, tsx, fileName, ts, htmlDocument) {
239885
- tsx.code = (0, utils_js_1.patchTSX)(tsx.code);
239887
+ tsx.code = (0, utils_js_1.patchTSX)(tsx.code, fileName);
239886
239888
  const v3Mappings = (0, sourcemap_codec_1.decode)(tsx.map.mappings);
239887
239889
  const sourcedDoc = vscode_html_languageservice_1.TextDocument.create(fileName, "astro", 0, input);
239888
239890
  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.14",
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.14",
212
212
  "@types/glob": "^8.1.0",
213
213
  "@types/mocha": "^10.0.1",
214
214
  "@types/node": "^16.18.26",