Skip to content

Commit

Permalink
Merge pull request #621 from jvalue/620-monaco-editor-langium-files
Browse files Browse the repository at this point in the history
`monaco-editor` exports information for the hub
  • Loading branch information
TungstnBallon authored Dec 20, 2024
2 parents c937349 + fc6fc1b commit e3e6de9
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 340 deletions.
11 changes: 1 addition & 10 deletions apps/vs-code-extension/assets/language-configuration.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "//",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": ["/*", "*/"]
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"brackets": [["{", "}"], ["[", "]"], ["(", ")"]],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
// symbols that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
Expand Down
3 changes: 0 additions & 3 deletions libs/language-server/langium-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"textMate": {
"out": "../../apps/vs-code-extension/assets/jayvee.tmLanguage.json"
},
"monarch": {
"out": "../../libs/monaco-editor/src/lib/jayvee.monarch.ts"
},
"prism": {
"out": "../../apps/docs/src/theme/prism-jayvee.js"
}
Expand Down
10 changes: 6 additions & 4 deletions libs/language-server/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@
"cache": true,
"inputs": [
"{projectRoot}/langium-config.json",
"{workspaceRoot}/tools/scripts/fix-monarch-grammar-escape.mjs",
"{workspaceRoot}/apps/vs-code-extension/assets/language-configuration.json",
"{workspaceRoot}/tools/scripts/monaco-editor/copy-textmate-grammar.mjs",
"{workspaceRoot}/tools/scripts/language-server/generate-stdlib.mjs",
"{projectRoot}/src/grammar/**/*"
],
"outputs": [
"{workspaceRoot}/apps/vs-code-extension/assets/jayvee.tmLanguage.json",
"{workspaceRoot}/libs/monaco-editor/src/lib/jayvee.monarch.ts",
"{workspaceRoot}/libs/monaco-editor/src/lib/jayvee.tmLanguage.json",
"{workspaceRoot}/libs/monaco-editor/src/lib/language-configuration.json",
"{workspaceRoot}/apps/docs/src/theme/prism-jayvee.js",
"{projectRoot}/src/lib/ast/generated"
],
"options": {
"commands": [
"langium generate -f libs/language-server/langium-config.json",
// Workaround until https://github.com/langium/langium/issues/740 is resolved:
"node tools/scripts/fix-monarch-grammar-escape.mjs",
"node tools/scripts/monaco-editor/copy-textmate-grammar.mjs",
"node tools/scripts/monaco-editor/copy-language-configuration.mjs",
"node tools/scripts/language-server/generate-stdlib.mjs"
],
"parallel": false
Expand Down
4 changes: 3 additions & 1 deletion libs/monaco-editor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
# SPDX-License-Identifier: AGPL-3.0-only

# file generated by Langium
src/lib/jayvee.monarch.ts
src/lib/jayvee.tmLanguage.json
# file copied from vs-code-extension
src/lib/language-configuration.json
4 changes: 1 addition & 3 deletions libs/monaco-editor/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/monaco-editor/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"build": {
"dependsOn": ["^build", "generate"],
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
Expand Down Expand Up @@ -42,8 +42,6 @@
"options": {
"commands": [
"node tools/scripts/relax-peer-dependency-versions.mjs monaco-editor",
"node tools/scripts/monaco-editor/delete-vscode-peer-dependency.mjs monaco-editor",
"node tools/scripts/monaco-editor/relax-react-version.mjs monaco-editor",
"node tools/scripts/add-package-json-version.mjs monaco-editor",
"node tools/scripts/publish.mjs monaco-editor false" // dry-run
],
Expand Down
14 changes: 14 additions & 0 deletions libs/monaco-editor/src/lib/monaco-editor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2024 Friedrich-Alexander-Universitat Erlangen-Nurnberg
//
// SPDX-License-Identifier: AGPL-3.0-only

import tmGrammar from './jayvee.tmLanguage.json';
import config from './language-configuration.json';

export function getTextMateGrammar(): unknown {
return tmGrammar;
}

export function getLanguageConfiguration(): unknown {
return config;
}
257 changes: 0 additions & 257 deletions libs/monaco-editor/src/lib/monaco-editor.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions tools/scripts/fix-monarch-grammar-escape.mjs

This file was deleted.

Loading

0 comments on commit e3e6de9

Please sign in to comment.