dsherret / dsherret/ts-morph

Supports Volar (for Vue SFC)

Open
#1,310 1 comment 15 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**

I want to use `ts-morph` in `.vue` files, so it requires integration with [Volar](https://github.com/johnsoncodehk/volar).

**Describe the solution you'd like**

Provide a hook callback function to hook [`languageServiceHost`](https://github.com/dsherret/ts-morph/blob/a9ba0ec7dfd844e7229f913c89e27a5ba3f395e5/packages/common/src/compiler/createHosts.ts#L53-L98).

Because Volar will return an object that extended from the original host.
https://github.com/johnsoncodehk/volar/blob/b15467cc29dd10887232d2eeed118210e2fec3e0/packages/vue-language-core/src/lsContext.ts#L108-L113

**Describe alternatives you've considered**

Contributor guide

Open the contributing guide

Research direction

Read CONTRIBUTING.md and inspect the languageServiceHost creation in packages/common/src/compiler/createHosts.ts. Compare that host with Volar's lsContext.ts integration point, then define and verify a hook that accepts Volar's extended host for Vue SFC support.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.