Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
lzw-723 committed Mar 6, 2020
0 parents commit 8f88675
Show file tree
Hide file tree
Showing 15 changed files with 2,221 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"browser": false,
"commonjs": true,
"es6": true,
"node": true,
"mocha": true
},
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"rules": {
"no-const-assign": "warn",
"no-this-before-super": "warn",
"no-undef": "warn",
"no-unreachable": "warn",
"no-unused-vars": "warn",
"constructor-super": "warn",
"valid-typeof": "warn"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"]
}
]
}
8 changes: 8 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode/**
.vscode-test/**
test/**
.gitignore
vsc-extension-quickstart.md
**/jsconfig.json
**/*.map
**/.eslintrc.json
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Change Log

All notable changes to the "fxml-viewer" extension will be documented in this file.

## [Unreleased]

- Initial release
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# FXML Viewer

A vscode extension view FXML file in SceneBuilder

## Features

Unkown

## Requirements

You have to install ScenBuider

## Extension Settings

* `scencebuiler.home`: the path of SceneBuilder's exe file

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.

## Release Notes

### 1.0.0

Initial release of ...

-----------------------------------------------------------------------------------------------------------

## For more information

* [Code](https://github.com/lzw-723/FXML-Viewer)
* [LICENSE](http://www.wtfpl.net/)

**Enjoy!**
47 changes: 47 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const vscode = require('vscode');
const cp = require("child_process");


/**
* @param {vscode.ExtensionContext} context
*/
function activate(context) {

console.log('Congratulations,extension "fxml-viewer" is now active!');

let disposable = vscode.commands.registerCommand('extension.openFXML', (event) => {
if (getSceneBuilderHome()) {
let fxmlPath = event.path;
let sceneBuilderHome = getSceneBuilderHome();
viewFXML(fxmlPath, sceneBuilderHome);

}
else{
vscode.window.showErrorMessage('please set ScenceBuilder.Home');
}
});

context.subscriptions.push(disposable);
}
exports.activate = activate;

function getSceneBuilderHome() {
return vscode.workspace.getConfiguration().get('scenebuilder.home');
}

function viewFXML(filePath, exePath) {
cp.execFile(exePath, [filePath], {}, (error, stdout, stderr) => {
if (error) {
console.log('exec error: ' + error);
vscode.window.showErrorMessage("SceneBuilder couldn't opened!");
}
});
}


function deactivate() {}

module.exports = {
activate,
deactivate
}
1 change: 1 addition & 0 deletions img/view.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"checkJs": true, /* Typecheck .js files. */
"lib": [
"es6"
]
},
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit 8f88675

Please sign in to comment.