Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ShenQingchuan
Copy link
Member

@ShenQingchuan ShenQingchuan commented Aug 8, 2025

What's changed

  • performance: Improve virtual code generation time
  • enhancement: create new method for language service to re-generate Vine file context.

Summary by CodeRabbit

  • New Features

    • Introduced a function to analyze Vine TypeScript files for language service support.
    • Added a comprehensive code generation module for enhanced Vue Vine language service features, including virtual file and embedded code generation.
  • Refactor

    • Simplified and modularized template compilation and AST handling for improved error reporting and maintainability.
    • Updated naming conventions for Vine-specific types and constants to ensure consistency.
    • Streamlined internal code generation logic by delegating responsibilities to specialized modules.
  • Bug Fixes

    • Adjusted test expectations to correctly report multiple compile errors for invalid template tags.
  • Chores

    • Removed an unused development dependency from the vite-plugin package.
  • Style

    • Improved naming and organization of internal identifiers and properties for clarity in language service modules.

Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for vue-vine ready!

Name Link
🔨 Latest commit 9c10c3e
🔍 Latest deploy log https://app.netlify.com/projects/vue-vine/deploys/6895af13d95211000843065a
😎 Deploy Preview https://deploy-preview-301--vue-vine.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Walkthrough

This update introduces a new analysis function for Vine TypeScript files, restructures template compilation and code generation for language service support, and modularizes codegen logic into dedicated modules. Several type and variable prefixes are renamed for consistency, and internal helpers are refactored or replaced to streamline AST handling, diagnostics, and virtual code generation. Test cases and dependency declarations are also updated accordingly.

Changes

Cohort / File(s) Change Summary
Vine Template Compilation & AST Handling
packages/compiler/src/babel-helpers/ast.ts, packages/compiler/src/template/compose.ts, packages/compiler/src/transform/steps.ts
Refactored AST traversal for Vine component detection; modularized template compilation options and error reporting; removed redundant parameters and streamlined binding metadata access.
Vine File Analysis & Entry Point
packages/compiler/src/index.ts
Added analyzeVineTypeScriptFile for language service analysis; updated exports and imports; minor cleanup in compile function.
Language Service Codegen Modularization
packages/language-service/src/codegen.ts, packages/language-service/src/virtual-code.ts, packages/language-service/src/vine-ctx.ts, packages/language-service/src/shared.ts
Introduced codegen module for virtual code and embedded file generation; refactored virtual code creation to use new codegen helpers; renamed analysis functions and updated type references; adjusted interface fields.
Type and Constant Prefix Renaming
packages/language-service/src/injectTypes.ts, packages/language-service/typescript-plugin/proxy-ts-lang-service.ts, packages/language-service/typescript-plugin/visitors.ts
Renamed internal types/constants from __VLS_ to __VLS_VINE_ or vice versa for Vine-specific entities; updated string literals for variable lookups and completion filtering.
Tests & Fixtures
packages/compiler/tests/validate.spec.ts, packages/e2e-test/src/fixtures/use-template-ref-virtual-code.vine.ts
Adjusted test assertions for multiple error messages; added lifecycle hook logging template refs in fixture.
Dependency Cleanup
packages/vite-plugin/package.json
Removed unused devDependency @types/hash-sum.

Sequence Diagram(s)

sequenceDiagram
    participant LS as Language Service
    participant Compiler as Vine Compiler
    participant Codegen as Codegen Module

    LS->>Compiler: analyzeVineTypeScriptFile(code, fileId, ctx)
    Compiler->>Compiler: Create VineFileCtx, bind hooks
    Compiler->>Compiler: Find Vine component functions
    Compiler->>Compiler: Validate and analyze Vine restrictions
    Compiler->>Compiler: For each VineCompFn, compile template AST
    Compiler->>Compiler: Store template AST and diagnostics
    Compiler->>Compiler: Call onEnd hook
    Compiler-->>LS: Return VineFileCtx

    LS->>Codegen: createVueVineVirtualCode(VineFileCtx)
    Codegen->>Codegen: Generate TS code segments, embedded files
    Codegen-->>LS: Virtual code & embedded files for IDE features
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

In the garden of Vine, new helpers bloom,
Codegen and analysis sweep away the gloom.
Templates refactored, diagnostics shine,
Types and prefixes now neatly align.
With modular roots and virtual delight,
This patch hops forward—code rabbits unite! 🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/improve-compiler-arch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

pkg-pr-new bot commented Aug 8, 2025

Open in StackBlitz

@vue-vine/compiler

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/compiler@301

create-vue-vine

npm i https://pkg.pr.new/vue-vine/vue-vine/create-vue-vine@301

@vue-vine/eslint-config

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/eslint-config@301

@vue-vine/eslint-parser

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/eslint-parser@301

@vue-vine/eslint-plugin

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/eslint-plugin@301

@vue-vine/language-server

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/language-server@301

@vue-vine/language-service

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/language-service@301

@vue-vine/nuxt

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/nuxt@301

vue-vine-tsc

npm i https://pkg.pr.new/vue-vine/vue-vine/vue-vine-tsc@301

@vue-vine/vite-plugin

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/vite-plugin@301

vue-vine

npm i https://pkg.pr.new/vue-vine/vue-vine@301

commit: 9c10c3e

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🔭 Outside diff range comments (1)
packages/language-service/src/injectTypes.ts (1)

42-47: String-replace on magic line is fragile

generateGlobalTypes() blindly replaces the exact string
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
If upstream @vue/language-core ever tweaks whitespace or semicolons, the replacement silently fails.

Guard with a regex or fallback:

globalTypes = globalTypes.replace(
  /type\s+__VLS_Element\s*=\s*import\('vue\/jsx-runtime'\)\.JSX\.Element\s*;/,
  'type __VLS_Element = import(\'vue/jsx-runtime\').JSX.Element & { [VUE_VINE_COMPONENT]: true };',
)

This makes updates less brittle.

🧹 Nitpick comments (11)
packages/compiler/tests/validate.spec.ts (1)

276-283: Underlying compiler emits duplicate errors – consider de-duping instead of asserting twice

Updating the snapshot to expect two identical messages papers over a duplication bug in template validation. Prefer de-duplicating diagnostic emission so each unique issue is reported once, then keep the original single-error assertion.

packages/language-service/typescript-plugin/visitors.ts (3)

80-90: Centralise magic string __VLS_VINE_ComponentsReferenceMap.

The same identifier is handcrafted here and in virtual-code generation. A future rename will break the linkage again – move it to a shared constant (e.g. src/constants.ts) and import from both places.


120-130: Hard-coded __VLS_IntrinsicElements deserves a shared constant.

For the same maintainability reason as above, lift the string into a common constant to avoid accidental divergence.


160-170: Ditto for __VLS_directives.

Re-use a constant rather than three separate literals introduced in this PR.

packages/compiler/src/index.ts (1)

175-219: Heavy duplication between compileVineTypeScriptFile & analyzeVineTypeScriptFile.

The new analyse-only path repeats ~80 % of the earlier function. Extract the shared steps (bind ctx, validate, analyse, optional template-compile loop) into an internal helper to keep the surface DRY and easier to evolve.

packages/language-service/src/virtual-code.ts (1)

7-10: Rename import to avoid shadowing global toString.

import { toString } from 'muggle-string' shadows the intrinsic Object.prototype.toString, which can trip up stack-traces and debuggers.

-import { toString } from 'muggle-string'
+import { toString as muggleToString } from 'muggle-string'

and adjust later usages.

packages/compiler/src/template/compose.ts (1)

356-362: hasTemplateCompileErr is never written

The flag is declared but never set, so the subsequent check is dead code:

let hasTemplateCompileErr = false
...
if (hasTemplateCompileErr) { ... }

Drop the variable or wire it to the error callback to avoid misleading intent.

packages/language-service/src/codegen.ts (1)

368-376: In-place sort mutates shared array

macrosInfoForVolar.sort(...) re-orders the original array held by the compiler context.
If the same array is read elsewhere later the order change may cause subtle bugs.

Use a cloned array to keep this function side-effect-free:

-  vineCompFn.macrosInfoForVolar
-    // Sort by AST node start position
-    .sort(...)
+  [...vineCompFn.macrosInfoForVolar]
+    .sort(...)
packages/language-service/src/injectTypes.ts (3)

54-60: Avoid code-duplication: alias to the existing helpers instead of re-copying their bodies

__VLS_VINE_StrictIsAny and __VLS_VINE_OmitAny duplicate the full definition already present for __VLS_StrictIsAny / __VLS_OmitAny.
Keeping two divergent copies is maintenance-heavy and easy to let drift.

-type __VLS_VINE_StrictIsAny<T> = [unknown] extends [T]
-  ? ([T] extends [unknown] ? true : false)
-  : false;
-
-type __VLS_VINE_OmitAny<T> = {
-  [K in keyof T as __VLS_VINE_StrictIsAny<T[K]> extends true ? never : K]: T[K]
-}
+type __VLS_VINE_StrictIsAny<T> = __VLS_StrictIsAny<T>;
+type __VLS_VINE_OmitAny<T>   = __VLS_OmitAny<T>;

Same behaviour, one source of truth.


60-64: __VLS_VINE_CreateVineVLSCtx is type-only – make that explicit

Mark the helper with declare const (or put it in an interface) to avoid accidental value-side emission when the .d.ts is re-used outside the LS.

-const __VLS_VINE_CreateVineVLSCtx: <T>(ctx: T) => __VLS_VINE_MakeVLSCtx<import('vue').ShallowUnwrapRef<T>>;
+declare const __VLS_VINE_CreateVineVLSCtx: <T>(
+  ctx: T,
+) => __VLS_VINE_MakeVLSCtx<import('vue').ShallowUnwrapRef<T>>;

This keeps the helper purely ambient.


68-75: Nit: helper-type names now exceed 30 chars

__VLS_VINE_RecordToUnion / __VLS_VINE_UnionToIntersection push IDE tooltips off-screen.
Consider shortening the prefix (e.g. __VV_) – they are already unique.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9176e68 and 9c10c3e.

⛔ Files ignored due to path filters (3)
  • packages/language-service/tests/__snapshots__/global-types.spec.ts.snap is excluded by !**/*.snap
  • packages/language-service/tests/__snapshots__/virtual-code.spec.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • packages/compiler/src/babel-helpers/ast.ts (2 hunks)
  • packages/compiler/src/index.ts (3 hunks)
  • packages/compiler/src/template/compose.ts (8 hunks)
  • packages/compiler/src/transform/steps.ts (0 hunks)
  • packages/compiler/tests/validate.spec.ts (1 hunks)
  • packages/e2e-test/src/fixtures/use-template-ref-virtual-code.vine.ts (1 hunks)
  • packages/language-service/src/codegen.ts (1 hunks)
  • packages/language-service/src/injectTypes.ts (3 hunks)
  • packages/language-service/src/shared.ts (2 hunks)
  • packages/language-service/src/vine-ctx.ts (2 hunks)
  • packages/language-service/src/virtual-code.ts (10 hunks)
  • packages/language-service/typescript-plugin/proxy-ts-lang-service.ts (1 hunks)
  • packages/language-service/typescript-plugin/visitors.ts (3 hunks)
  • packages/vite-plugin/package.json (0 hunks)
💤 Files with no reviewable changes (2)
  • packages/vite-plugin/package.json
  • packages/compiler/src/transform/steps.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.vine.ts

📄 CodeRabbit Inference Engine (.cursor/rules/vue-vine-repo-rules.mdc)

**/*.vine.ts: Vine 仅会处理文件名后缀为 .vine.ts 的文件
.vine.ts 文件中,所有函数只要满足条件:“返回值是一个 tagged template string 且标签名必须是 vine 的字符串”,都将被视为一个组件函数

Files:

  • packages/e2e-test/src/fixtures/use-template-ref-virtual-code.vine.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: vue-vine/vue-vine#0
File: .cursor/rules/vue-vine-repo-rules.mdc:0-0
Timestamp: 2025-07-20T18:38:22.094Z
Learning: Applies to **/*.vine.ts : 在 `.vine.ts` 文件中,所有函数只要满足条件:“返回值是一个 tagged template string 且标签名必须是 `vine` 的字符串”,都将被视为一个组件函数
Learnt from: CR
PR: vue-vine/vue-vine#0
File: .cursor/rules/vue-vine-repo-rules.mdc:0-0
Timestamp: 2025-07-20T18:38:22.094Z
Learning: Applies to **/*.vine.ts : Vine 仅会处理文件名后缀为 `.vine.ts` 的文件
Learnt from: ShenQingchuan
PR: vue-vine/vue-vine#283
File: packages/vscode-ext/package.json:105-110
Timestamp: 2025-06-17T14:54:18.385Z
Learning: The Vue Vine VSCode extension uses tsdown as a bundler that statically analyzes and includes all imported dependencies in the final bundle, regardless of whether they are listed in dependencies or devDependencies in packages/vscode-ext/package.json. Runtime dependencies can safely be placed in devDependencies since they will be bundled into the extension output.
Learnt from: ShenQingchuan
PR: vue-vine/vue-vine#265
File: packages/compiler/src/template/transform-negative-bool.ts:13-14
Timestamp: 2025-05-26T13:09:15.829Z
Learning: In Vue Vine codebase, prefer using hardcoded numeric values with the `satisfies` operator (e.g., `(6 satisfies NodeTypes.ATTRIBUTE)`) instead of direct enum references. This reduces production bundle size by avoiding enum object embedding while maintaining TypeScript type checking functionality.
📚 Learning: 2025-07-20T18:38:22.094Z
Learnt from: CR
PR: vue-vine/vue-vine#0
File: .cursor/rules/vue-vine-repo-rules.mdc:0-0
Timestamp: 2025-07-20T18:38:22.094Z
Learning: Applies to **/*.vine.ts : 在 `.vine.ts` 文件中,所有函数只要满足条件:“返回值是一个 tagged template string 且标签名必须是 `vine` 的字符串”,都将被视为一个组件函数

Applied to files:

  • packages/e2e-test/src/fixtures/use-template-ref-virtual-code.vine.ts
  • packages/language-service/typescript-plugin/proxy-ts-lang-service.ts
  • packages/language-service/src/vine-ctx.ts
  • packages/language-service/typescript-plugin/visitors.ts
  • packages/compiler/src/index.ts
  • packages/language-service/src/shared.ts
  • packages/compiler/tests/validate.spec.ts
  • packages/language-service/src/virtual-code.ts
  • packages/compiler/src/babel-helpers/ast.ts
  • packages/compiler/src/template/compose.ts
  • packages/language-service/src/injectTypes.ts
  • packages/language-service/src/codegen.ts
📚 Learning: 2025-07-20T18:38:22.094Z
Learnt from: CR
PR: vue-vine/vue-vine#0
File: .cursor/rules/vue-vine-repo-rules.mdc:0-0
Timestamp: 2025-07-20T18:38:22.094Z
Learning: Applies to **/*.vine.ts : Vine 仅会处理文件名后缀为 `.vine.ts` 的文件

Applied to files:

  • packages/language-service/typescript-plugin/proxy-ts-lang-service.ts
  • packages/language-service/src/vine-ctx.ts
  • packages/language-service/typescript-plugin/visitors.ts
  • packages/compiler/src/index.ts
  • packages/language-service/src/shared.ts
  • packages/compiler/tests/validate.spec.ts
  • packages/language-service/src/virtual-code.ts
  • packages/compiler/src/babel-helpers/ast.ts
  • packages/compiler/src/template/compose.ts
  • packages/language-service/src/injectTypes.ts
📚 Learning: 2025-06-17T14:54:18.385Z
Learnt from: ShenQingchuan
PR: vue-vine/vue-vine#283
File: packages/vscode-ext/package.json:105-110
Timestamp: 2025-06-17T14:54:18.385Z
Learning: The Vue Vine VSCode extension uses tsdown as a bundler that statically analyzes and includes all imported dependencies in the final bundle, regardless of whether they are listed in dependencies or devDependencies in packages/vscode-ext/package.json. Runtime dependencies can safely be placed in devDependencies since they will be bundled into the extension output.

Applied to files:

  • packages/language-service/src/vine-ctx.ts
  • packages/language-service/typescript-plugin/visitors.ts
  • packages/compiler/src/index.ts
  • packages/language-service/src/shared.ts
  • packages/language-service/src/virtual-code.ts
  • packages/compiler/src/babel-helpers/ast.ts
  • packages/compiler/src/template/compose.ts
  • packages/language-service/src/injectTypes.ts
  • packages/language-service/src/codegen.ts
📚 Learning: 2025-05-26T13:09:15.829Z
Learnt from: ShenQingchuan
PR: vue-vine/vue-vine#265
File: packages/compiler/src/template/transform-negative-bool.ts:13-14
Timestamp: 2025-05-26T13:09:15.829Z
Learning: In Vue Vine codebase, prefer using hardcoded numeric values with the `satisfies` operator (e.g., `(6 satisfies NodeTypes.ATTRIBUTE)`) instead of direct enum references. This reduces production bundle size by avoiding enum object embedding while maintaining TypeScript type checking functionality.

Applied to files:

  • packages/language-service/src/vine-ctx.ts
  • packages/language-service/typescript-plugin/visitors.ts
  • packages/compiler/src/index.ts
  • packages/language-service/src/shared.ts
  • packages/compiler/tests/validate.spec.ts
  • packages/language-service/src/virtual-code.ts
  • packages/compiler/src/babel-helpers/ast.ts
  • packages/compiler/src/template/compose.ts
  • packages/language-service/src/injectTypes.ts
  • packages/language-service/src/codegen.ts
🧬 Code Graph Analysis (4)
packages/language-service/src/vine-ctx.ts (1)
packages/compiler/src/index.ts (1)
  • analyzeVineTypeScriptFile (183-219)
packages/compiler/src/index.ts (3)
packages/compiler/src/types.ts (2)
  • VineCompileCtx (290-294)
  • VineFileCtx (152-187)
packages/compiler/src/babel-helpers/ast.ts (1)
  • findVineCompFnDecls (99-107)
packages/compiler/src/template/compose.ts (2)
  • createTemplateCompileOptions (237-273)
  • compileVineTemplate (275-339)
packages/language-service/src/shared.ts (1)
packages/language-service/src/vine-ctx.ts (1)
  • analyzeVineForVirtualCode (7-56)
packages/language-service/src/codegen.ts (3)
packages/language-service/src/shared.ts (7)
  • BabelFunctionNodeTypes (11-11)
  • BabelToken (13-19)
  • VineCodeInformation (8-8)
  • VineCompFn (10-10)
  • parseCssClassNames (101-118)
  • wrapWith (120-139)
  • turnBackToCRLF (37-39)
packages/compiler/src/index.ts (5)
  • VineFileCtx (44-44)
  • VinePropsDefinitionBy (35-35)
  • VinePropMeta (47-47)
  • _breakableTraverse (52-52)
  • exitTraverse (53-53)
packages/language-service/src/injectTypes.ts (1)
  • createLinkedCodeTag (90-95)
🪛 ast-grep (0.38.6)
packages/language-service/src/virtual-code.ts

[warning] 13-13: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(${escapeStrForRegExp(LINKED_CODE_TAG_PREFIX)}_LEFT__#(?<itemLength>\\d+)${escapeStrForRegExp(LINKED_CODE_TAG_SUFFIX)}, 'g')
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 Biome (2.1.2)
packages/language-service/src/virtual-code.ts

[error] 9-9: Do not shadow the global "toString" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test (lts/*, macos-latest)
  • GitHub Check: test (lts/*, windows-latest)
  • GitHub Check: test (lts/*, ubuntu-latest)
🔇 Additional comments (7)
packages/e2e-test/src/fixtures/use-template-ref-virtual-code.vine.ts (1)

7-10: Import onMounted or confirm global availability

onMounted is referenced but not imported. Unless the Vine runtime auto-globals lifecycle APIs for .vine.ts files, this will raise a TypeScript “cannot find name” error and break editor IntelliSense.

-import { useTemplateRef } from 'vue'
+import { useTemplateRef, onMounted } from 'vue'

Please verify that automatic injection really covers this case; otherwise add the explicit import.

packages/language-service/src/vine-ctx.ts (1)

3-4: Rename integration looks good

Import switched to analyzeVineTypeScriptFile; matches the new compiler API and compiles cleanly.

packages/language-service/src/shared.ts (2)

28-30: No references to compileTime remain
A repository‐wide search for .compileTime returned no matches—there are no lingering accesses to the removed getter.


6-10: Downstream usage verified
Search for the old compileVineForVirtualCode alias returned no matches, confirming all consumers now use VineCompFn (via analyzeVineForVirtualCode). No further changes needed.

packages/language-service/src/virtual-code.ts (1)

14-15: Variable-driven RegExp – verify ReDoS safety.

Although segments are escaped, confirm that LINKED_CODE_TAG_PREFIX|SUFFIX are constant and cannot originate from untrusted input to rule out ReDoS vectors.

packages/language-service/src/codegen.ts (1)

28-65: getIndexOfFnDeclLeftParen misses some edge cases

For arrow functions without parentheses (e.g. x => {}) the helper returns node.start, which is before the parameter list, causing later insertions to land in the wrong spot.

Consider falling back to node.params[0].start when ( is absent.

packages/language-service/src/injectTypes.ts (1)

144-167: No stale helper references remain

A search across the codebase for __VLS_CreateVineVLSCtx and __VLS_OmitAny returned no matches, confirming that all old helper names have been removed and replaced with the new ones.

@ShenQingchuan ShenQingchuan merged commit 9ea7138 into main Aug 8, 2025
11 checks passed
@ShenQingchuan ShenQingchuan deleted the fix/improve-compiler-arch branch August 8, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant