@marko/language-server 2.0.2 → 2.1.0

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/dist/index.mjs CHANGED
@@ -1190,6 +1190,13 @@ import {
1190
1190
  TextEdit as TextEdit3
1191
1191
  } from "vscode-languageserver";
1192
1192
  import { URI as URI3 } from "vscode-uri";
1193
+
1194
+ // src/service/marko/util/is-html.ts
1195
+ function isHTML(tag) {
1196
+ return tag ? !(tag.types || tag.template || tag.renderer) && tag.html : false;
1197
+ }
1198
+
1199
+ // src/service/marko/util/get-tag-name-completion.ts
1193
1200
  var deprecated = [CompletionItemTag.Deprecated];
1194
1201
  function getTagNameCompletion({
1195
1202
  tag,
@@ -1205,9 +1212,10 @@ function getTagNameCompletion({
1205
1212
  );
1206
1213
  const nodeModuleName = nodeModuleMatch && nodeModuleMatch[1];
1207
1214
  const isCoreTag = /^@?marko[/-]/.test(tag.taglibId || tag.filePath) || nodeModuleName === "marko";
1215
+ const html = isHTML(tag);
1208
1216
  const documentation = {
1209
1217
  kind: MarkupKind2.Markdown,
1210
- value: tag.html ? `Built in [<${tag.name}>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/${tag.name}) HTML tag.` : isCoreTag ? `Core Marko <${tag.name}> tag.` : nodeModuleName ? `Custom Marko tag discovered from the ["${nodeModuleName}"](${fileURIForTag}) npm package.` : `Custom Marko tag discovered from:
1218
+ value: html ? `Built in [<${tag.name}>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/${tag.name}) HTML tag.` : isCoreTag ? `Core Marko <${tag.name}> tag.` : nodeModuleName ? `Custom Marko tag discovered from the ["${nodeModuleName}"](${fileURIForTag}) npm package.` : `Custom Marko tag discovered from:
1211
1219
 
1212
1220
  [${importer ? path4.relative(importer, fileForTag) : fileForTag}](${fileURIForTag})`
1213
1221
  };
@@ -1237,7 +1245,7 @@ ${autocomplete.description}`;
1237
1245
  documentation,
1238
1246
  tags: tag.deprecated ? deprecated : void 0,
1239
1247
  insertTextFormat: autocomplete ? InsertTextFormat2.Snippet : void 0,
1240
- kind: tag.html ? CompletionItemKind3.Property : CompletionItemKind3.Class,
1248
+ kind: html ? CompletionItemKind3.Property : CompletionItemKind3.Class,
1241
1249
  textEdit: range && TextEdit3.replace(range, autocomplete?.snippet || label)
1242
1250
  };
1243
1251
  }
@@ -1646,7 +1654,7 @@ function extractDocumentSymbols({
1646
1654
  case NodeType8.AttrTag:
1647
1655
  symbols.push({
1648
1656
  name: (node.type === NodeType8.AttrTag ? node.nameText?.slice(node.nameText.indexOf("@")) : node.nameText) || "<${...}>",
1649
- kind: node.nameText && lookup.getTag(node.nameText)?.html && SymbolKind.Property || SymbolKind.Class,
1657
+ kind: node.nameText && isHTML(lookup.getTag(node.nameText)) && SymbolKind.Property || SymbolKind.Class,
1650
1658
  location: {
1651
1659
  uri,
1652
1660
  range: parsed.locationAt(node)
@@ -1776,7 +1784,7 @@ var doHover = async (doc, params) => {
1776
1784
  };
1777
1785
 
1778
1786
  // src/service/marko/validate.ts
1779
- import { DiagnosticType } from "@marko/babel-utils";
1787
+ import { DiagnosticType } from "@marko/compiler/babel-utils";
1780
1788
  import { Project as Project4 } from "@marko/language-tools";
1781
1789
  import path6 from "path";
1782
1790
  import { DiagnosticSeverity } from "vscode-languageserver";
@@ -2341,6 +2349,7 @@ var optionalModifierReg = /\boptional\b/;
2341
2349
  var deprecatedModifierReg = /\bdeprecated\b/;
2342
2350
  var colorModifierReg = /\bcolor\b/;
2343
2351
  var localInternalsPrefix = "__marko_internal_";
2352
+ var getCanonicalFileName = ts.sys.useCaseSensitiveFileNames ? (fileName) => fileName : (fileName) => fileName.toLocaleLowerCase();
2344
2353
  var requiredTSCompilerOptions = {
2345
2354
  module: ts.ModuleKind.ESNext,
2346
2355
  moduleResolution: ts.ModuleResolutionKind.Bundler,
@@ -3095,9 +3104,6 @@ function getTSTriggerChar(char) {
3095
3104
  if (char && tsTriggerChars.has(char))
3096
3105
  return char;
3097
3106
  }
3098
- function getCanonicalFileName(fileName) {
3099
- return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
3100
- }
3101
3107
 
3102
3108
  // src/service/style/index.ts
3103
3109
  import { extractStyle } from "@marko/language-tools";