@void2610/tyranoscript-lsp 0.4.0 → 0.5.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/README.md CHANGED
@@ -8,6 +8,17 @@
8
8
  - パラメータの補完(使用済みパラメータを自動除外)
9
9
  - 必須パラメータのスニペット自動挿入
10
10
  - ホバーによるタグ・パラメータのドキュメント表示
11
+ - ワークスペース内のアセット・ラベル・マクロのインデックス自動構築
12
+ - `storage=""` にアセットファイル名を補完
13
+ - `target=""` にラベル名(`*xxx`)を補完
14
+ - ユーザー定義マクロの補完・ホバードキュメント
15
+ - 定義へジャンプ(Go to Definition)
16
+ - `target="*xxx"` → ラベル定義行へジャンプ
17
+ - `storage="xxx.ks"` → 対象ファイル先頭へジャンプ
18
+ - `[mymacro]` / `@mymacro` → マクロ定義行へジャンプ
19
+ - 参照検索(Find References)
20
+ - ラベル定義行 / 参照箇所から全使用箇所を一覧表示
21
+ - マクロ定義行 / 使用箇所から全使用箇所を一覧表示
11
22
 
12
23
  ## 開発
13
24
 
package/dist/server.js CHANGED
@@ -12651,18 +12651,24 @@ connection.onCompletion(
12651
12651
  function getDefinitionContext(lineText, character) {
12652
12652
  const valueCtx = getParamValueContext(lineText, character);
12653
12653
  if (valueCtx) {
12654
- if (valueCtx.paramName === "target" && valueCtx.currentValue.startsWith("*")) {
12655
- return { kind: "label", name: valueCtx.currentValue.substring(1) };
12654
+ const afterCursor = lineText.substring(character);
12655
+ const closingQuoteIdx = afterCursor.indexOf('"');
12656
+ const fullValue = closingQuoteIdx >= 0 ? valueCtx.currentValue + afterCursor.substring(0, closingQuoteIdx) : valueCtx.currentValue;
12657
+ if (valueCtx.paramName === "target" && fullValue.startsWith("*")) {
12658
+ return { kind: "label", name: fullValue.substring(1) };
12656
12659
  }
12657
- if (valueCtx.paramName === "storage" && valueCtx.currentValue.length > 0) {
12658
- return { kind: "file", name: valueCtx.currentValue };
12660
+ if (valueCtx.paramName === "storage" && fullValue.length > 0) {
12661
+ return { kind: "file", name: fullValue };
12659
12662
  }
12660
12663
  return null;
12661
12664
  }
12662
12665
  const tagCtx = getTagContext(lineText, character);
12663
12666
  if (tagCtx && !tagCtx.isInParams) {
12664
- if (!TAG_DATABASE.has(tagCtx.tagName)) {
12665
- return { kind: "macro", name: tagCtx.tagName };
12667
+ const afterCursor = lineText.substring(character);
12668
+ const remainingWord = afterCursor.match(/^(\w*)/)?.[1] ?? "";
12669
+ const fullTagName = tagCtx.tagName + remainingWord;
12670
+ if (!TAG_DATABASE.has(fullTagName)) {
12671
+ return { kind: "macro", name: fullTagName };
12666
12672
  }
12667
12673
  }
12668
12674
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void2610/tyranoscript-lsp",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "TyranoScript Language Server for Zed",
5
5
  "main": "dist/server.js",
6
6
  "files": [