From dfd90d2c9c35a70cb873413f17f45502f24d1412 Mon Sep 17 00:00:00 2001 From: Cleve Stuart Date: Mon, 5 Feb 2024 06:58:19 -0800 Subject: [PATCH 1/5] Clarify developer setup --- DEVELOPERS.md | 18 +++++++++++++++--- package.json | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 35c4cca..55ef8ab 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -1,7 +1,19 @@ -## Developing the Extension +# Developing the Extension -Open vscode in this directory, and hit F5 to run a new version of -vscode, which will have this plugin running. +## Setup +Before launching you'll need to fetch the analzyer locally and compile this app: + +``` +yarn developer-setup +``` + + +## Launching +Now to launch: + +Open vscode in this directory, and select "Run -> Start Debugging" from the menu, +there is an `F5` shortcut for this on some systems with some keybindings. This will +launch a parallel instance of VS code with the local extension running. Now in this new instance of vscode, press cmd+l/ctrl+l to open the FQL Playground. This should have syntax highlighting, and a language server should give live diff --git a/package.json b/package.json index d0fcf3b..ed16bbb 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "scripts": { "vscode:prepublish": "yarn run compile", "compile": "tsc -p ./", + "developer-setup": "yarn install && yarn compile && yarn download-analyzer", "download-analyzer": "bash ./scripts/download-analyzer.sh", "watch": "tsc -watch -p ./", "pretest": "yarn run compile && yarn run lint && yarn run download-analyzer", @@ -65,7 +66,7 @@ "fauna.dbSecret": { "type": "string", "default": "", - "description": "The secret to use to connnect to your fauna database.", + "description": "The secret used to connect to your fauna database.", "scope": "window" }, "fauna.endpoint": { From c4238e7a06b63a4d1d69cdfaf15c95a10efec8ed Mon Sep 17 00:00:00 2001 From: Cleve Stuart Date: Mon, 5 Feb 2024 10:10:34 -0800 Subject: [PATCH 2/5] WIP run LSP in embedded blocks --- .gitignore | 4 ++++ package.json | 19 ++++++++++++++++++- syntax/fql.embedded.js.tmGrammar.json | 26 ++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 syntax/fql.embedded.js.tmGrammar.json diff --git a/.gitignore b/.gitignore index 853852d..26d15c1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ node_modules # Logs yarn-debug.log* yarn-error.log* + +# Emacs +*~ +*# \ No newline at end of file diff --git a/package.json b/package.json index ed16bbb..b9c8e38 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "Other" ], "activationEvents": [ - "onLanguage:fql" + "onLanguage:fql", + "onLanguage:typescript" ], "main": "./out/extension.js", "dependencies": { @@ -131,6 +132,22 @@ "language": "fsl", "scopeName": "source.fsl", "path": "./syntax/fsl.tmGrammar.json" + }, + { + "injectTo": [ + "source.js", + "source.jsx", + "source.ts", + "source.tsx", + "text.html.basic", + "text.html.derivative", + "text.html.markdown" + ], + "scopeName": "meta.embedded.block.fql", + "path": "./syntax/fql.embedded.js.tmGrammar.json", + "embeddedLanguages": { + "meta.embedded.block.fql": "source.fql" + } } ], "keybindings": [ diff --git a/syntax/fql.embedded.js.tmGrammar.json b/syntax/fql.embedded.js.tmGrammar.json new file mode 100644 index 0000000..b660a94 --- /dev/null +++ b/syntax/fql.embedded.js.tmGrammar.json @@ -0,0 +1,26 @@ +{ + "scopeName": "meta.embedded.block.fql", + "begin": "(fql)(`)", + "end": "`", + "name": "meta.embedded.block.fql", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.fql" + }, + "1": { + "name": "punctuation.definition.string.begin.fql.backtick" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.fql" + } + }, + "patterns": [ + { + "include": "source.fql" + } + ] +} + + From cf8a09725c413ba0948643d3b9a0a0ddda6ec10d Mon Sep 17 00:00:00 2001 From: Neil Macneale V Date: Mon, 5 Feb 2024 17:06:49 -0800 Subject: [PATCH 3/5] Fix syntax highlighting for fql blocks --- syntax/fql.embedded.js.tmGrammar.json | 48 ++++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/syntax/fql.embedded.js.tmGrammar.json b/syntax/fql.embedded.js.tmGrammar.json index b660a94..bc63a20 100644 --- a/syntax/fql.embedded.js.tmGrammar.json +++ b/syntax/fql.embedded.js.tmGrammar.json @@ -1,26 +1,34 @@ { "scopeName": "meta.embedded.block.fql", - "begin": "(fql)(`)", - "end": "`", - "name": "meta.embedded.block.fql", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.fql" - }, - "1": { - "name": "punctuation.definition.string.begin.fql.backtick" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.fql" - } - }, + "injectionSelector": "L:source", "patterns": [ { - "include": "source.fql" + "include": "#fql-block" + } + ], + "repository": { + "fql-block": { + "begin": "(fql)(`)", + "name": "meta.embedded.block.fql", + "end": "`", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.fql" + }, + "1": { + "name": "punctuation.definition.string.begin.fql.backtick" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.fql" + } + }, + "patterns": [ + { + "include": "source.fql" + } + ] } - ] + } } - - From e4ce8a3c5ddcb9e0b7b6879da7c33416cc754f8e Mon Sep 17 00:00:00 2001 From: Neil Macneale V Date: Fri, 3 May 2024 10:21:43 -0700 Subject: [PATCH 4/5] Allow whitespace between fql and backtick --- syntax/fql.embedded.js.tmGrammar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/fql.embedded.js.tmGrammar.json b/syntax/fql.embedded.js.tmGrammar.json index bc63a20..07e8ed4 100644 --- a/syntax/fql.embedded.js.tmGrammar.json +++ b/syntax/fql.embedded.js.tmGrammar.json @@ -8,7 +8,7 @@ ], "repository": { "fql-block": { - "begin": "(fql)(`)", + "begin": "(fql)\\W*(`)", "name": "meta.embedded.block.fql", "end": "`", "beginCaptures": { From 5c9bf5248a07d3cfcc35cf33ade653315ba006b7 Mon Sep 17 00:00:00 2001 From: Cleve Stuart Date: Wed, 8 May 2024 15:15:08 -0700 Subject: [PATCH 5/5] Bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b9c8e38..3648aca 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/fauna/fauna-vscode" }, "publisher": "Fauna", - "version": "0.1.1", + "version": "0.2.0", "engines": { "vscode": "^1.72.0" }, @@ -187,4 +187,4 @@ } ] } -} \ No newline at end of file +}