Some help to implement a TypeScript language service using the new API #151
Unanswered
elchininet
asked this question in
Q&A
Replies: 1 comment 18 replies
-
|
You’re almost there! You have registered the TypeScript service plugin, which adds support for TypeScript features. However, you haven’t registered any language plugins, so Volar doesn’t understand how to handle Vue files. So in import { createVueLanguagePlugin } from '@vue/language-core';
// …
worker.initialize((ctx) => {
// …
return createTypeScriptWorkerService({
// …
languagePlugins: [createVueLanguagePlugin(/* … */)]
})
})I don’t know the exact options |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I opened this issue some months ago. I have been trying to implement a TypeScript language service with custom type defintions following the instructions of the new API, but I have not succeed on that.
First of all I would like to double-check these small issues and know if the fix that I applied is correct on each case:
1.
createTypeScriptServiceinservicePluginsAs the
createTypeScriptServicereturns an array ofServicePluginit seems that it should be spreaded.2.
registerProvidersmethodI also added the
getSyncUristhere following the types.If these fixes are OK, I would like to have your help to detect what I am missing. I have created a minimum reproducible repo.
In the old branch it is implemented using
@volar/monaco@1.7.9and the language service works but without the ability of adding my own custom type definitions.In the master branch I'm using
@volar/monaco@2.1.2and I cannot make the language service to work, it seems that something needs to be done, but I am not able to indentify what.On each branch just run
yarnandyarn startto open the dev server.Could you indicate what I am missing?
Regards and thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions