CodinGame / monaco-vscode-api

VSCode public API plugged on the monaco editor
MIT License
208 stars 29 forks source link

Error vscode-jsonrpc/node and standaloneServices while building stage #367

Closed toastyboost closed 3 months ago

toastyboost commented 3 months ago

Hello CodinGame community!

I'm tryin to serve a Go to Symbol by Category... command item into command palette

My steps:

  1. import StandaloneServices from @codingame/monaco-editor/treemended/esm/vs/editor/standalone/browser/standaloneServices
  2. import IQuickInputServicefrom @codingame/monaco-editor/treemended/esm/vs/platform/quickinput/common/quickInput
  3. Use StandaloneServices.quickAccessSerivices.get(IQuickInputService).quickAccess.show('@:');

(a bit tricky way to import (but at end its similar to common import), project specifics)

In dev mode all working as should, but while deploy stage on Node machine this imports cause a SSR test pipline error that vscode-jsonrpc/node cannot resolve:

Also this all works with Language Server

Any thoughts? Maybe there is another way to trigger command palette?

CGNonofr commented 3 months ago

Hello,

Most services identifiers are re-exported, you can do:

import { IQuickInputService, getService } from 'vscode/services'
...
const quickInputService = await getService(IQuickInputService)
quickInputService.quickAccess.show('@:')

In dev mode all working as should, but while deploy stage on Node machine this imports cause a SSR test pipline error that vscode-jsonrpc/node cannot resolve:

Also this all works with Language Server

Any thoughts? Maybe there is another way to trigger command palette?

What make you think it's related to the way you open the palette? The issue seems to be your are using vscode-jsonrpc/node and: