Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(monaco): update documentation to match the current API status #255

Conversation

elchininet
Copy link
Contributor

This pull request submits several changes to the @volar/monaco documentation to match the current status of the API. It is a follow up of this comment from @johnsoncodehk.

Motivation of the changes

  1. The module @volar/monaco/worker doesn't export a ServiceEnvironment type anymore. The createSimpleWorkerLanguageService and createTypeScriptWorkerLanguageService utility functions use the LanguageServiceEnvironment type from @volar/language-service as the type of the env parameter.

  2. The LanguageServiceEnvironment type admits a workspaceFolders property instead of a workspaceFolder one.

  3. The aforementioned workspaceFolders property should be an array of vscode-uri URI instead of a string.

  4. The import of typescript can be converted to a default import because it is exported as the default export and in its types it is exported as export = ts.

    image
  5. In the createWebWorker method of monaco-editor, the generic should be the WorkerLanguageService from @volar/monaco/worker instead of LanguageService from @volar/language-service.

  6. The registerProviders utility function also needs the getSyncUris function.

@johnsoncodehk
Copy link
Member

Thank you so much for sorting out all the changes!

@johnsoncodehk johnsoncodehk merged commit e5d68e9 into volarjs:master Dec 23, 2024
4 checks passed
Copy link

pkg-pr-new bot commented Dec 23, 2024

Open in Stackblitz

@volar/eslint

npm i https://pkg.pr.new/volarjs/volar.js/@volar/eslint@255

@volar/jsdelivr

npm i https://pkg.pr.new/volarjs/volar.js/@volar/jsdelivr@255

@volar/language-core

npm i https://pkg.pr.new/volarjs/volar.js/@volar/language-core@255

@volar/language-server

npm i https://pkg.pr.new/volarjs/volar.js/@volar/language-server@255

@volar/language-service

npm i https://pkg.pr.new/volarjs/volar.js/@volar/language-service@255

@volar/kit

npm i https://pkg.pr.new/volarjs/volar.js/@volar/kit@255

@volar/source-map

npm i https://pkg.pr.new/volarjs/volar.js/@volar/source-map@255

@volar/monaco

npm i https://pkg.pr.new/volarjs/volar.js/@volar/monaco@255

@volar/test-utils

npm i https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@255

@volar/typescript

npm i https://pkg.pr.new/volarjs/volar.js/@volar/typescript@255

@volar/vscode

npm i https://pkg.pr.new/volarjs/volar.js/@volar/vscode@255

commit: 6431cfc

@elchininet elchininet deleted the several_fixes_to_volar_monaco_documentation branch December 23, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants