Skip to content

Commit

Permalink
contribute configurations in generated package definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Azpillaga Aldalur committed Oct 11, 2023
1 parent e97d76c commit 0991952
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/rpg
Submodule rpg updated from 81ae48 to 18c200
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ class LanguageServerPlugin : Plugin<Project?> {
extension.fileExtensions = mutableListOf(".$language")
extension.editor = "code"
extension.serverJarPath = Paths.get(project.projectDir.toString(), "build", "libs", "$language.jar")
extension.examplesPath = Paths.get(project.projectDir.toString(), "examples")
extension.examplesPath = Paths.get(project.rootDir.toString(), "examples")

extension.textmateGrammarPath = Paths.get(project.projectDir.toString(), "src", "main", "resources", "grammar.tmLanguage")
extension.textmateGrammarScope = "main"
extension.logoPath = Paths.get(project.projectDir.toString(), "src", "main", "resources", "logo.png")
extension.fileIconPath = Paths.get(project.projectDir.toString(), "src", "main", "resources", "fileIcon.png")
extension.languageClientPath = Paths.get(project.projectDir.toString(), "src", "main", "resources", "client.js")
Expand Down Expand Up @@ -130,6 +132,7 @@ class LanguageServerPlugin : Plugin<Project?> {
} else {
var grammars = ""
if (Files.exists(extension.textmateGrammarPath)) {
println(extension.textmateGrammarPath.toString())
grammars = """
,
"grammars":
Expand Down Expand Up @@ -162,7 +165,32 @@ class LanguageServerPlugin : Plugin<Project?> {
"languages":
[
{"id": "$language", "extensions": ["${extension.fileExtensions.joinToString("\", \"")}"]$fileIcon}
]$grammars
],
"configuration": {
"title": "${language.capitalized()}",
"properties": {
"$language.showParsingErrors": {
"type": "boolean",
"default": true,
"description": "Show parsing errors produced by ANTLR."
},
"$language.includeErrorNodeFoundIssues": {
"type": "boolean",
"default": false,
"description": "Show the ANTLR issues that start with 'Error node found', usually duplicates."
},
"$language.showASTWarnings": {
"type": "boolean",
"default": false,
"description": "Show warnings for ast inconsistencies."
},
"$language.showLeafPositions": {
"type": "boolean",
"default": false,
"description": "Show all leaves' positions."
}
}
}$grammars
},
"engines": {"vscode": "^1.52.0"},
"activationEvents": ["onLanguage:$language"],
Expand Down

0 comments on commit 0991952

Please sign in to comment.