Skip to content

Commit

Permalink
Run IDE with Project Manager endpoint instead of Language Server endp…
Browse files Browse the repository at this point in the history
…oints, when on local backend (#6810)

This is a fix for a couple of recent regressions:
- Fixes #6756: Projects couldn't be renamed anymore from within the project view.
- Fixes #6804: One could no longer switch between projects from within the project view.
- It also unblocks the issue with the spinner (that got reverted), but that probably needs some extra attention.

It might be the long-term goal to have different UX solutions to these cases, but this should fix those regressions in the short term at least.

Thanks to @somebody1234 for the in-depth conversation (and the actual code!).
  • Loading branch information
Procrat authored May 30, 2023
1 parent 4fdcea3 commit ab15923
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ function Dashboard(props: DashboardProps) {

const switchToDashboardTab = react.useCallback(() => {
setTab(Tab.dashboard)
doRefresh()
const ideElement = document.getElementById(IDE_ELEMENT_ID)
if (ideElement) {
ideElement.style.top = '-100vh'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import * as react from 'react'
import * as backendModule from '../backend'
import * as backendProvider from '../../providers/backend'

import GLOBAL_CONFIG from '../../../../../../../../gui/config.yaml' assert { type: 'yaml' }

// =================
// === Constants ===
// =================
Expand Down Expand Up @@ -67,15 +69,23 @@ function Ide(props: IdeProps) {
}
})()
const runNewProject = async () => {
const engineConfig =
backend.type === backendModule.BackendType.remote
? {
rpcUrl: jsonAddress,
dataUrl: binaryAddress,
}
: {
projectManagerUrl: GLOBAL_CONFIG.projectManagerEndpoint,
}
await appRunner.runApp({
loader: {
assetsUrl: `${assetsRoot}dynamic-assets`,
wasmUrl: `${assetsRoot}pkg-opt.wasm`,
jsUrl: `${assetsRoot}pkg${JS_EXTENSION[backend.type]}`,
},
engine: {
rpcUrl: jsonAddress,
dataUrl: binaryAddress,
...engineConfig,
preferredVersion: engineVersion,
},
startup: {
Expand Down

0 comments on commit ab15923

Please sign in to comment.