Skip to content

Deprecate linkedCodeMap in v3 #316

Description

@johnsoncodehk

Problem

VirtualCode.linkedCodeMappings / Language.linkedCodeMaps (LinkedCodeMap.getLinkedOffsets) provide generated↔generated edges inside a virtual code. Several language-service features use these edges to recursively "follow the chain" from one synthesized position to another:

  • provideDefinition
  • provideReferences
  • provideRenameEdits
  • provideDocumentHighlights
  • @volar/typescript proxyLanguageService (TS plugin path)

Vue's @vue/language-core produces them in generateSetupExposed to link the __VLS_SetupExposed member name (foo) to its typeof foo reference, so definition / references / rename / highlights can traverse from the synthesized type member to the real <script setup> binding.

Why deprecate

The TypeScript content-mapper protocol (microsoft/typescript-go#4712) has no virtual↔virtual edge semantic. A mapper only emits flat SpanMapping tuples (virtual ↔ original). The "follow the linked chain" traversal cannot be expressed there, so ecosystems migrating to content mappers (e.g. Vue Language Tools v4) need a replacement.

This is an in-process concept that does not map to an external-process transform model.

Proposal

Deprecate linkedCodeMap / linkedCodeMappings in the next major (v3), and document a replacement path. One candidate replacement is to give synthesized alias positions explicit original mappings so they collapse into "one original → multiple virtual spans", which content mappers can represent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions