Skip to content

Commit

Permalink
Fix playground blank screen and formatter (#4549)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Sep 26, 2024
1 parent 378c4e0 commit c44e785
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
changeKind: internal
packages:
- "@typespec/playground"
---

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
test-results.xml
test-results/

# Translations
*.mo
Expand Down
9 changes: 4 additions & 5 deletions packages/playground-website/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ const config: PlaywrightTestConfig = {
trace: "retain-on-failure",
},
projects: [
// TODO: investigate
// {
// name: "chromium",
// use: { browserName: "chromium" },
// },
{
name: "chromium",
use: { browserName: "chromium" },
},
{
name: "firefox",
use: { browserName: "firefox" },
Expand Down
8 changes: 5 additions & 3 deletions packages/playground/src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ function getTypeSpecLanguageConfiguration(): monaco.languages.LanguageConfigurat
}

export async function registerMonacoLanguage(host: BrowserHost) {
if (monaco.languages.getLanguages().some((x) => x.id === "typespec")) {
return;
}
monaco.languages.register({ id: "typespec", extensions: [".tsp"] });
monaco.languages.setLanguageConfiguration("typespec", getTypeSpecLanguageConfiguration());

if ((window as any).registeredServices) {
return;
}

(window as any).registeredServices = true;
const serverHost: ServerHost = {
compilerHost: host,
getOpenDocumentByURL(url: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineConfig({
},

rollupOptions: {
external: externals,
external: (id) => externals.some((x) => id.startsWith(x)),
},
},
esbuild: {
Expand Down

0 comments on commit c44e785

Please sign in to comment.