Implement WAMR-IDE with vscode extension (#943)
Implement WAMR-IDE with vscode extension to enable developing WebAssembly applications with coding, building, running and debugging support. Support both Linux and Windows, and only support putting all the tools in a docker image, e.g. wasi-sdk, wamrc, iwasm and so on. Co-authored-by: Wang Ning <justdoitwn@163.com>
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
|
||||
const vscode = acquireVsCodeApi();
|
||||
|
||||
document.getElementById('btn_submit').onclick = () => {
|
||||
submitFunc();
|
||||
};
|
||||
|
||||
function submitFunc() {
|
||||
let outputFileName = document.getElementById('output_file_name').value;
|
||||
let initmemSize = document.getElementById('initial_mem_size').value;
|
||||
let maxmemSize = document.getElementById('max_mem_size').value;
|
||||
let stackSize = document.getElementById('stack_size').value;
|
||||
let exportedSymbols = document.getElementById('exported_symbols').value;
|
||||
|
||||
vscode.postMessage({
|
||||
command: 'config_build_target',
|
||||
outputFileName: outputFileName,
|
||||
initmemSize: initmemSize,
|
||||
maxmemSize: maxmemSize,
|
||||
stackSize: stackSize,
|
||||
exportedSymbols: exportedSymbols,
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
const vscode = acquireVsCodeApi();
|
||||
|
||||
document.getElementById('btn_submit').onclick = () => {
|
||||
submitFunc();
|
||||
};
|
||||
|
||||
function submitFunc() {
|
||||
let projectName = document.getElementById('ipt_projName').value;
|
||||
let template = document.getElementById('select_dropdown').value;
|
||||
|
||||
vscode.postMessage({
|
||||
command: 'create_new_project',
|
||||
projectName: projectName,
|
||||
template: template,
|
||||
});
|
||||
|
||||
/* get msg from ext */
|
||||
window.addEventListener('message', event => {
|
||||
const message = event.data;
|
||||
switch (message.command) {
|
||||
/* send command to open the project */
|
||||
case 'proj_creation_finish':
|
||||
vscode.postMessage({
|
||||
command: 'open_project',
|
||||
projectName: message.prjName,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user