You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing TypeScript Language Service Plugin with createAsyncLanguageServicePlugin. I want to extend info.languageService to add language features. For example, I want to always return the keyword "Hello" from getCompletionsAtPosition.
However, when I do that, tsserver doesn't seem to load the extended functionality.
Apparently, extending info.languageService asynchronously reproduces the problem. If I extend it synchronously as follows, the problem does not reproduce.
The text was updated successfully, but these errors were encountered:
mizdra
changed the title
Cannot extend info.languageService with createAsyncLanguageServicePlugin
Cannot extend info.languageService asynchronously with createAsyncLanguageServicePluginDec 26, 2024
Summary
I am developing TypeScript Language Service Plugin with
createAsyncLanguageServicePlugin
. I want to extendinfo.languageService
to add language features. For example, I want to always return the keyword"Hello"
fromgetCompletionsAtPosition
.However, when I do that, tsserver doesn't seem to load the extended functionality.
Reproduction
repository: https://github.com/mizdra/repro-volar-setup-with-async-language-service
npm i
in the terminal.example/index.ts
in the editor.example/index.ts
and check the completion itemssrc/index.cjs
:src/language-service.cjs
:Expected behavior
The completion items contain
"Hello"
.Actual behavior
The completion items do not contain
"Hello"
.Additional context
Apparently, extending
info.languageService
asynchronously reproduces the problem. If I extend it synchronously as follows, the problem does not reproduce.However, if I insert asynchronous operations as follows, the problem reproduces.
Environment
The text was updated successfully, but these errors were encountered: