mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-28 12:27:58 +00:00
Version 1 (#83)
* replace jq-promises with native Promises * updates to use native promises and async await * Fix variable errors, remove extra parameters and correct export declaratons * refactor launch request to use async/await * fix running debugger on custom ADB port * remove unused files * move socket_ended check to ensure we don't loop reading 0 bytes * refactor logcat code and ensure disconnect status is passed on to webview * Fix warnings * Clean up util and remove unused functions * convert Debugger into a class * update jsconfig target to es2018 and enable checkJS * more updates to use async/await and more readable refactoring. - added type definitions and debugger classes - improved expression evaluation - refactored expressions into parsing, evaluation and variable assignment - fixed invoking methods with parameters - added support for static method invokes - improved exception display reliability - refactored launch into smaller functions - refactored utils into smaller modules - removed redundant code - converted JDWP functions to classes * set version 1.0.0 and update dependencies * add changelog notes
This commit is contained in:
28
extension.js
28
extension.js
@@ -3,15 +3,6 @@
|
||||
const vscode = require('vscode');
|
||||
const { AndroidContentProvider } = require('./src/contentprovider');
|
||||
const { openLogcatWindow } = require('./src/logcat');
|
||||
const state = require('./src/state');
|
||||
|
||||
function getADBPort() {
|
||||
var defaultPort = 5037;
|
||||
var adbPort = AndroidContentProvider.getLaunchConfigSetting('adbPort', defaultPort);
|
||||
if (typeof adbPort === 'number' && adbPort === (adbPort|0))
|
||||
return adbPort;
|
||||
return defaultPort;
|
||||
}
|
||||
|
||||
// this method is called when your extension is activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
@@ -20,29 +11,20 @@ function activate(context) {
|
||||
/* Only the logcat stuff is configured here. The debugger is launched from src/debugMain.js */
|
||||
AndroidContentProvider.register(context, vscode.workspace);
|
||||
|
||||
// logcat connections require the (fake) websocket proxy to be up
|
||||
// - take the ADB port from launch.json
|
||||
const wsproxyserver = require('./src/wsproxy').proxy.Server(6037, getADBPort());
|
||||
|
||||
// The commandId parameter must match the command field in package.json
|
||||
var disposables = [
|
||||
const disposables = [
|
||||
// add the view logcat handler
|
||||
vscode.commands.registerCommand('android-dev-ext.view_logcat', () => {
|
||||
openLogcatWindow(vscode);
|
||||
}),
|
||||
// watch for changes in the launch config
|
||||
vscode.workspace.onDidChangeConfiguration(e => {
|
||||
wsproxyserver.setADBPort(getADBPort());
|
||||
})
|
||||
];
|
||||
|
||||
var spliceparams = [context.subscriptions.length,0].concat(disposables);
|
||||
Array.prototype.splice.apply(context.subscriptions,spliceparams);
|
||||
context.subscriptions.splice(context.subscriptions.length, 0, ...disposables);
|
||||
}
|
||||
|
||||
exports.activate = activate;
|
||||
|
||||
// this method is called when your extension is deactivated
|
||||
function deactivate() {
|
||||
}
|
||||
exports.deactivate = deactivate;
|
||||
|
||||
exports.activate = activate;
|
||||
exports.deactivate = deactivate;
|
||||
|
||||
Reference in New Issue
Block a user