Skip to content

Commit

Permalink
Clean up (#16)
Browse files Browse the repository at this point in the history
* Clean up

* maybe never lix

* copy gitignore
  • Loading branch information
RblSb authored Sep 13, 2023
1 parent 76319c4 commit 0333d43
Show file tree
Hide file tree
Showing 26 changed files with 117 additions and 886 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
bin/
/.vscode/.BROWSE.VC.DB
debug.log
bin
node_modules
dump
*.log
*.vsix
haxelib/haxelib.zip
4 changes: 2 additions & 2 deletions .haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.0.5",
"version": "a443fd3",
"resolveLibs": "scoped"
}
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"haxe.executable": "auto",
"[haxe]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ This is a VSCode extension that exists solely to aid the development of the [vsh

## Features

- **hxparser Syntax Tree Visualizer**

The `hxparser: Visualize` commands opens a new editor to the side that displays the [hxparser](https://github.com/vshaxe/hxparser) / [](https://github.com/vshaxe/haxe-hxparser) parse tree for the current Haxe source file. Selecting tokens in the source will scroll to the appropriate position in the tree, and selecting tokens in the tree will highlight the token in the source.

![](images/visualizer.gif)

When changing the file, the tree is updated with [haxe-languageserver](https://github.com/vshaxe/haxe-languageserver)'s internal parse tree (obtained through incremental parsing).

It's also possible to view the original JSON response from hxparser or to view the parse tree re-printed as Haxe code.

- **haxe-formatter test file highlighting**

[haxe-formatter](https://github.com/vshaxe/haxe-formatter) uses a custom `.hxtest` file extension for unit test definitions. These files are highlighted by the debug tools:
Expand All @@ -40,4 +30,4 @@ This is a VSCode extension that exists solely to aid the development of the [vsh
npx lix run vshaxe-build --target all
```

6. After modifying and rebuilding the extension itself, restart VSCode, reload the window or run a debug instance with F5 ([standard vscode workflow](https://code.visualstudio.com/docs/extensions/debugging-extensions)).
6. After modifying and rebuilding the extension itself, restart VSCode, reload the window or run a debug instance with F5 ([standard vscode workflow](https://code.visualstudio.com/docs/extensions/debugging-extensions)).
3 changes: 0 additions & 3 deletions haxe_libraries/haxe-hxparser.hxml

This file was deleted.

6 changes: 3 additions & 3 deletions haxe_libraries/haxeparser.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-D haxeparser=3.3.0
# @install: lix --silent download "gh://github.com/Simn/haxeparser#48160b190cacafb0003d0c8d085dca2c85e21e31" into haxeparser/3.3.0/github/48160b190cacafb0003d0c8d085dca2c85e21e31
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxeparser#7e98c9aef901b8e26541cf3f8a6e1da0385b237a" into haxeparser/4.3.0-rc.1/github/7e98c9aef901b8e26541cf3f8a6e1da0385b237a
-lib hxparse
-cp ${HAXE_LIBCACHE}/haxeparser/3.3.0/github/48160b190cacafb0003d0c8d085dca2c85e21e31/src
-cp ${HAXE_LIBCACHE}/haxeparser/4.3.0-rc.1/github/7e98c9aef901b8e26541cf3f8a6e1da0385b237a/src
-D haxeparser=4.3.0-rc.1
13 changes: 7 additions & 6 deletions haxe_libraries/hxnodejs.hxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-D hxnodejs=10.0.0
# @install: lix --silent download "haxelib:/hxnodejs#10.0.0" into hxnodejs/10.0.0/haxelib
-cp ${HAXE_LIBCACHE}/hxnodejs/10.0.0/haxelib/src
--macro allowPackage('sys')
# should behave like other target defines and not be defined in macro context
--macro define('nodejs')
-D hxnodejs=12.1.0
# @install: lix --silent download "haxelib:/hxnodejs#12.1.0" into hxnodejs/12.1.0/haxelib
-cp ${HAXE_LIBCACHE}/hxnodejs/12.1.0/haxelib/src
--macro allowPackage('sys')
# should behave like other target defines and not be defined in macro context
--macro define('nodejs')
--macro _internal.SuppressDeprecated.run()
6 changes: 3 additions & 3 deletions haxe_libraries/hxparse.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-D hxparse=4.0.0
# @install: lix --silent download "gh://github.com/Simn/hxparse#53b79171d36c1146ca349e48b7b69885be5e0024" into hxparse/4.0.0/github/53b79171d36c1146ca349e48b7b69885be5e0024
-cp ${HAXE_LIBCACHE}/hxparse/4.0.0/github/53b79171d36c1146ca349e48b7b69885be5e0024/src
# @install: lix --silent download "gh://github.com/simn/hxparse#32e376f80c4b0e999e9f3229947d4dac2138382b" into hxparse/4.0.1/github/32e376f80c4b0e999e9f3229947d4dac2138382b
-cp ${HAXE_LIBCACHE}/hxparse/4.0.1/github/32e376f80c4b0e999e9f3229947d4dac2138382b/src
-D hxparse=4.0.1
6 changes: 3 additions & 3 deletions haxe_libraries/tokentree.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-D tokentree=1.0.28
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/tokentree#0b48308e5cec2daf8e721dc69835be1360272d8a" into tokentree/1.0.28/github/0b48308e5cec2daf8e721dc69835be1360272d8a
-cp ${HAXE_LIBCACHE}/tokentree/1.0.28/github/0b48308e5cec2daf8e721dc69835be1360272d8a/src
# @install: lix --silent download "haxelib:/tokentree#1.2.10" into tokentree/1.2.10/haxelib
-cp ${HAXE_LIBCACHE}/tokentree/1.2.10/haxelib/src
-D tokentree=1.2.10
6 changes: 3 additions & 3 deletions haxe_libraries/vscode.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-D vscode=1.35.0
# @install: lix --silent download "haxelib:/vscode#1.35.0" into vscode/1.35.0/haxelib
-D vscode=1.60.0
# @install: lix --silent download "haxelib:/vscode#1.60.0" into vscode/1.60.0/haxelib
-lib hxnodejs
-cp ${HAXE_LIBCACHE}/vscode/1.35.0/haxelib/src
-cp ${HAXE_LIBCACHE}/vscode/1.60.0/haxelib/src
6 changes: 3 additions & 3 deletions haxe_libraries/vshaxe-build.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-D vshaxe-build=0.0.1
# @install: lix --silent download "gh://github.com/vshaxe/vshaxe-build#39ab9c6315ae76080e5399391c8fa561daec6d55" into vshaxe-build/0.0.1/github/39ab9c6315ae76080e5399391c8fa561daec6d55
# @run: haxelib run-dir vshaxe-build ${HAXE_LIBCACHE}/vshaxe-build/0.0.1/github/39ab9c6315ae76080e5399391c8fa561daec6d55
-cp ${HAXE_LIBCACHE}/vshaxe-build/0.0.1/github/39ab9c6315ae76080e5399391c8fa561daec6d55/
# @install: lix --silent download "gh://github.com/vshaxe/vshaxe-build#4ce362be7c300163470d618be2fb8fa98a616e49" into vshaxe-build/0.0.1/github/4ce362be7c300163470d618be2fb8fa98a616e49
# @run: haxelib run-dir vshaxe-build ${HAXE_LIBCACHE}/vshaxe-build/0.0.1/github/4ce362be7c300163470d618be2fb8fa98a616e49
-cp ${HAXE_LIBCACHE}/vshaxe-build/0.0.1/github/4ce362be7c300163470d618be2fb8fa98a616e49/
28 changes: 27 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 1 addition & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"vscode": "^1.23.0"
},
"devDependencies": {
"lix": "^15.5.3"
"lix": "^15.10.1"
},
"scripts": {
"postinstall": "npx lix download"
Expand All @@ -19,7 +19,6 @@
"url": "https://github.com/vshaxe/vshaxe-debug-tools"
},
"activationEvents": [
"onCommand:vshaxeDebugTools.visualizeParseTree",
"onCommand:vshaxeDebugTools.visualizeTokenTree",
"onCommand:vshaxeDebugTools.methodResultsView.open",
"onCommand:vshaxeDebugTools.methodResultsView.update",
Expand All @@ -38,27 +37,11 @@
"onView:haxe.methods",
"onView:haxe.cache",
"onWebviewPanel:vshaxeDebugTools.tokenTree",
"onWebviewPanel:vshaxeDebugTools.parseTree",
"workspaceContains:./*.hxml"
],
"main": "bin/extension",
"contributes": {
"configuration": {
"title": "Haxe Extension Debug Tools",
"properties": {
"hxparservis.path": {
"description": "Path to the hxparser executable. If not defined, an embedded js version is used.",
"type": "string",
"default": null
}
}
},
"commands": [
{
"command": "vshaxeDebugTools.visualizeParseTree",
"title": "Visualize Parse Tree",
"category": "Haxe Extension Debug Tools"
},
{
"command": "vshaxeDebugTools.visualizeTokenTree",
"title": "Visualize TokenTree",
Expand Down
2 changes: 0 additions & 2 deletions src/Main.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package;

import features.vis.hxParserVis.HxParserVisFeature;
import features.vis.tokenTreeVis.TokenTreeVisFeature;
import vscode.*;
import features.*;
Expand All @@ -11,7 +10,6 @@ class Main {
static function activate(context:ExtensionContext) {
Vscode.commands.executeCommand("setContext", "vshaxeDebugToolsActivated", true);

new HxParserVisFeature(context);
new TokenTreeVisFeature(context);
new CursorOffsetFeature(context);
new HxTestSeparatorFeature(context);
Expand Down
6 changes: 0 additions & 6 deletions src/features/vis/VisFeatureBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ class VisFeatureBase<T:ContentProviderBase<Dynamic>> {
update();
}));

context.subscriptions.push(commands.registerCommand('$viewType.updateParseTree', function(uri:String, parseTree:String) {
if (panel != null && provider.previousEditor != null && uri == provider.previousEditor.document.uri.toString()) {
panel.webview.html = haxe.Unserializer.run(parseTree);
}
}));

context.subscriptions.push(window.onDidChangeTextEditorSelection(function(e) {
if (panel != null && e.textEditor == window.activeTextEditor) {
panel.webview.postMessage(e.textEditor.document.offsetAt(e.textEditor.selection.anchor));
Expand Down
Loading

0 comments on commit 0333d43

Please sign in to comment.