Skip to content

Typescript LSP does not resolve references between files. #96

Open
@SaitejaUtpala

Description

@SaitejaUtpala

consider following file

https://github.com/assistant-ui/assistant-ui/blob/main/packages/react-ai-sdk/src/ui/use-assistant/useVercelUseAssistantRuntime.tsx

from multilspy import SyncLanguageServer
from multilspy.multilspy_config import MultilspyConfig
from multilspy.multilspy_logger import MultilspyLogger

config = MultilspyConfig.from_dict({"code_language": "typescript"})
logger = MultilspyLogger()
lsp = SyncLanguageServer.create(config, logger, "/Users/root/assistant-ui/")



with lsp.start_server():
    result1 = lsp.request_definition(
        "packages/react-ai-sdk/src/ui/use-assistant/useVercelUseAssistantRuntime.tsx", # Filename of location where request is being made
        34, # line number of symbol for which request is being made
        34 # column number of symbol for which request is being made
    )

this was always pointing to import statement in the same file but never to definition file
assistant-ui/packages/react-ai-sdk/src/ui/utils/vercelAttachmentAdapter.ts that actually contains definition

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