mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-22 17:39:19 +00:00
Merge pull request #28 from adelphes/kotlin-support
add basic support for kotlin source files
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
"breakpoints": [
|
||||
{
|
||||
"language": "java"
|
||||
},
|
||||
{
|
||||
"language": "kotlin"
|
||||
}
|
||||
],
|
||||
"debuggers": [
|
||||
|
||||
@@ -479,7 +479,7 @@ class AndroidDebugSession extends DebugSession {
|
||||
package: pkgname,
|
||||
package_path: fpn,
|
||||
srcroot: path.join(app_root,src_folder),
|
||||
public_classes: subfiles.filter(sf => /^[a-zA-Z_$][a-zA-Z0-9_$]*\.java$/.test(sf)).map(sf => sf.match(/^(.*)\.java$/)[1])
|
||||
public_classes: subfiles.filter(sf => /^[a-zA-Z_$][a-zA-Z0-9_$]*\.(?:java|kt)$/.test(sf)).map(sf => sf.match(/^(.*)\.(?:java|kt)$/)[1])
|
||||
}
|
||||
}
|
||||
// add the subfiles to the list to process
|
||||
@@ -594,7 +594,7 @@ class AndroidDebugSession extends DebugSession {
|
||||
// create a fake pkginfo to use to construct the bp
|
||||
pkginfo = { srcroot:this._android_sources_path }
|
||||
}
|
||||
if (!pkginfo || !/\.java$/i.test(srcfpn)) {
|
||||
if (!pkginfo || !/\.(java|kt)$/i.test(srcfpn)) {
|
||||
// source file is not a java file or is outside of the known source packages
|
||||
// just send back a list of unverified breakpoints
|
||||
response.body = {
|
||||
|
||||
@@ -525,7 +525,7 @@ Debugger.prototype = {
|
||||
},
|
||||
|
||||
_splitsrcfpn: function (srcfpn) {
|
||||
var m = srcfpn.match(/^\/([^/]+(?:\/[^/]+)*)?\/([^./]+)\.java$/);
|
||||
var m = srcfpn.match(/^\/([^/]+(?:\/[^/]+)*)?\/([^./]+)\.(java|kt)$/);
|
||||
return {
|
||||
pkg: m[1].replace(/\/+/g, '.'),
|
||||
type: m[2],
|
||||
|
||||
Reference in New Issue
Block a user