Skip to content

Commit

Permalink
Use Juvix line comment by default in Juvix Markdown and language-conf…
Browse files Browse the repository at this point in the history
…iguration changes (#134)
  • Loading branch information
jonaprieto authored Jul 23, 2024
1 parent 771080b commit 0bac5b1
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 95 deletions.
3 changes: 2 additions & 1 deletion language-configuration-juvix-md.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"comments": {
"blockComment": ["<!--", "-->"]
"lineComment": "--",
"blockComment": ["{-", "-}"]
},
"brackets": [
["{", "}"],
Expand Down
40 changes: 28 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "juvix-mode",
"version": "0.2.0",
"version": "0.2.1",
"license": "GPL-3.0",
"description": "Juvix Mode for VSCode",
"displayName": "Juvix",
Expand Down Expand Up @@ -67,14 +67,24 @@
"[Juvix]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.unicodeHighlight.invisibleCharacters": true,
"editor.trimAutoWhitespace": true
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.trimAutoWhitespace": true,
"diffEditor.ignoreTrimWhitespace": false
},
"[JuvixMarkdown]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.trimAutoWhitespace": true,
"diffEditor.ignoreTrimWhitespace": false
},
"editor.tokenColorCustomizations": {
"[*Light*]": {
"textMateRules": [
{
"scope": "comments",
"scope": "comment",
"settings": {
"foreground": "#a8a8a8",
"fontStyle": "italic"
Expand Down Expand Up @@ -159,7 +169,7 @@
"[*Dark*]": {
"textMateRules": [
{
"scope": "comments",
"scope": "comment",
"settings": {
"foreground": "#646464",
"fontStyle": "italic"
Expand Down Expand Up @@ -253,8 +263,7 @@
"foreground": "#ef3e9d"
},
"comment": {
"foreground": "#a8a8a8",
"fontStyle": "italic"
"foreground": "#a8a8a8"
},
"pragma": {
"foreground": "#717070"
Expand Down Expand Up @@ -295,8 +304,7 @@
"foreground": "#ef3e9d"
},
"comment": {
"foreground": "#a8a8a8",
"fontStyle": "italic"
"foreground": "#a8a8a8"
},
"pragma": {
"foreground": "#aaa9a9"
Expand Down Expand Up @@ -343,7 +351,6 @@
".juvix"
],
"aliases": [
"Juvix",
"juvix"
],
"configuration": "./language-configuration.json"
Expand All @@ -354,7 +361,8 @@
".juvix.md"
],
"aliases": [
"JuvixMarkdown"
"JuvixMarkdown",
"juvixmarkdown"
],
"configuration": "./language-configuration-juvix-md.json"
},
Expand Down Expand Up @@ -397,7 +405,15 @@
{
"language": "JuvixMarkdown",
"scopeName": "text.juvix.markdown",
"path": "./syntaxes/JuvixMarkdown.json"
"path": "./syntaxes/JuvixMarkdown.tmLanguage.json",
"embeddedLanguages": {
"source.juvix": "Juvix",
"meta.embedded.block.juvix": "Juvix"
},
"unbalancedBracketScopes": [
"markup.underline.link.markdown",
"punctuation.definition.list.begin.markdown"
]
},
{
"language": "JuvixCore",
Expand Down
2 changes: 0 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export class JuvixConfig {
return this.workspaceConfig.get('gebBinPath', '');
}


public getGebExec(): string {
return path.join(this.gebBinaryPath(), this.gebBinaryName());
}
Expand Down Expand Up @@ -247,7 +246,6 @@ export class JuvixConfig {
// Input mode configuration methods
public enableSemanticSyntax(): boolean {
return this.workspaceConfig.get('enableSemanticSyntax', true);

}

public inputModeEnabled(): boolean {
Expand Down
18 changes: 9 additions & 9 deletions syntaxes/Juvix.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Juvix",
"scopeName": "source.Juvix",
"fileTypes": ["Juvix"],
"scopeName": "source.juvix",
"fileTypes": ["juvix"],
"patterns": [
{
"include": "#comment"
Expand All @@ -27,37 +27,37 @@
"patterns": [
{
"match": "--.*$",
"name": "comments.line.double-dash.Juvix"
"name": "comment.line.double-dash.juvix"
},
{
"begin": "\\{--",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.Juvix"
"name": "punctuation.definition.comment.juvix"
}
},
"end": "--\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.Juvix"
"name": "punctuation.definition.comment.juvix"
}
},
"name": "comments.documentation.block.Juvix"
"name": "comment.documentation.block.juvix"
},
{
"begin": "\\{-",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.Juvix"
"name": "punctuation.definition.comment.juvix"
}
},
"end": "-\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.Juvix"
"name": "punctuation.definition.comment.juvix"
}
},
"name": "comments.block.Juvix"
"name": "comment.block.juvix"
}
]
},
Expand Down
71 changes: 0 additions & 71 deletions syntaxes/JuvixMarkdown.json

This file was deleted.

56 changes: 56 additions & 0 deletions syntaxes/JuvixMarkdown.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"information_for_contributors": [
"This file has been modified from https://github.com/microsoft/vscode/blob/main/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json."
],
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/7418dd20d76c72e82fadee2909e03239e9973b35",
"name": "Markdown",
"scopeName": "text.juvix.markdown",
"fileTypes": ["JuvixMarkdown"],
"patterns": [
{
"include": "#markdown"
}
],
"repository": {
"markdown": {
"patterns": [
{
"include": "fenced_code_block_juvix"
}
]
},
"fenced_code_block_juvix": {
"begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(juvix|\\{\\.juvix.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.juvix",
"patterns": [
{
"include": "source.juvix"
}
]
}
]
}
}
}

0 comments on commit 0bac5b1

Please sign in to comment.