215 Commits

Author SHA1 Message Date
Dave Holoway
e84509a072 update changelog and readme 2020-07-03 01:37:13 +01:00
Dave Holoway
6a29651208 add terminate reason to debugger 2020-07-03 00:47:38 +01:00
Dave Holoway
f551a92236 include current time in startup event 2020-07-03 00:19:43 +01:00
Dave Holoway
33daf68649 add basic debugger analytics 2020-07-03 00:15:39 +01:00
Dave Holoway
cc3b995de3 apply statics filter to enum values 2020-07-02 22:42:07 +01:00
Dave Holoway
f2137eb35c add unqualified type members when inside a method 2020-07-02 22:39:13 +01:00
Dave Holoway
78c8c4ac6a add file to build script 2020-07-02 21:12:41 +01:00
Dave Holoway
f33cc13ebd add language server debug config 2020-07-02 19:44:43 +01:00
Dave Holoway
346c4a937b set empty cache file markers 2020-07-02 19:17:10 +01:00
Dave Holoway
2fd2c001ce fix dependency versions 2020-07-02 18:58:57 +01:00
Dave Holoway
a902d3daeb fix dependency versions 2020-07-02 18:27:09 +01:00
Dave Holoway
b5cc60a516 add basic analytics 2020-07-02 18:20:51 +01:00
Dave Holoway
4740f6533a add mixpanel package 2020-07-02 14:43:26 +01:00
Dave Holoway
92129e4cb0 update version of java-mti 2020-07-02 14:38:34 +01:00
Dave Holoway
f50aaa48aa add support for loading filtered androidx libraries for code completion 2020-07-02 13:34:47 +01:00
Dave Holoway
7aa04dfc56 update initial file loading to use URIs passed from the client
changes to the appSourceRoot now require an extension restart
2020-06-30 18:32:15 +01:00
Dave Holoway
b2eb0c973b revert @types/vscode 2020-06-30 18:19:19 +01:00
Dave Holoway
27db9f5e3b reference java-mti package from GitHub 2020-06-30 15:42:19 +01:00
Dave Holoway
279807a4c5 add basic build script 2020-06-30 14:51:07 +01:00
Dave Holoway
ea9a7f1a85 use a specialised map for handling case-insenstive file uris 2020-06-30 14:26:37 +01:00
Dave Holoway
10848b2910 ignore synthetic members in completion list 2020-06-30 14:02:35 +01:00
Dave Holoway
4cd0764a9d add type name to parameter completion labels 2020-06-30 13:49:53 +01:00
Dave Holoway
dc8098c471 improve support for completion of enum values 2020-06-30 13:48:52 +01:00
Dave Holoway
ad585a8a84 fix some type warnings 2020-06-30 12:40:41 +01:00
Dave Holoway
9fde7bcd9d code comments and minor improvements 2020-06-30 12:07:01 +01:00
Dave Holoway
3e1bd63330 hide some method modifiers which aren't useful to show 2020-06-30 00:44:23 +01:00
Dave Holoway
7d1d215b79 add support for parsing and validating anonymous types 2020-06-29 23:48:29 +01:00
Dave Holoway
1b2cd957ec validate more statements 2020-06-29 19:35:19 +01:00
Dave Holoway
2f5ed65461 remove unused ResolvedType class 2020-06-29 16:29:43 +01:00
Dave Holoway
00da3cd2f1 move addproblem into TokenList 2020-06-29 16:24:01 +01:00
Dave Holoway
31f3826971 remove redundant types and functions used by old parser 2020-06-29 16:15:24 +01:00
Dave Holoway
9498888ee6 remove old parser files 2020-06-29 15:54:12 +01:00
Dave Holoway
d74837158a remove validation modules that used old parser types 2020-06-29 15:50:21 +01:00
Dave Holoway
cd1c360ef0 remove unused field from ResolvedImport 2020-06-29 15:49:04 +01:00
Dave Holoway
61397dab95 clean up import resolving code 2020-06-29 15:45:46 +01:00
Dave Holoway
bdb5986c4b rename body-parser3 to body-parser 2020-06-29 15:38:43 +01:00
Dave Holoway
acd18e4105 remove debugging pause 2020-06-29 15:26:28 +01:00
Dave Holoway
3dbe1dea3e get main node install to install langserver dependencies 2020-06-29 15:26:05 +01:00
Dave Holoway
0205a317d9 relocate java-mti package into project 2020-06-29 14:46:27 +01:00
Dave Holoway
3e77b3f1c9 simplify handling of this and class member qualifiers 2020-06-29 14:14:49 +01:00
Dave Holoway
a278237486 add option to allow language server to be shutdown 2020-06-29 12:55:50 +01:00
Dave Holoway
6ca4ea353d make sure we only try and parse java files 2020-06-29 00:59:55 +01:00
Dave Holoway
4554b8890e handle java file change notifications 2020-06-29 00:49:10 +01:00
Dave Holoway
2716505a77 ignore unnamed type declarations 2020-06-28 23:30:16 +01:00
Dave Holoway
fed16b22f5 Rename language client extension to Android 2020-06-28 23:04:29 +01:00
Dave Holoway
3a55d3627f refactoring 2020-06-28 23:03:46 +01:00
Dave Holoway
2ee1c72b6a handle null token passed to ParseProblem 2020-06-28 21:24:50 +01:00
Dave Holoway
c8311ea2e4 description updates 2020-06-28 21:24:05 +01:00
Dave Holoway
bb1a326768 set configurable trace logging and update section names 2020-06-28 21:05:08 +01:00
Dave Holoway
18049ea08c allow configurable app root setting 2020-06-28 19:23:39 +01:00
Dave Holoway
113a7379ed android-29 library cache 2020-06-28 15:37:19 +01:00
Dave Holoway
baabf1e7a9 load single android library cache from local folder 2020-06-28 15:34:27 +01:00
Dave Holoway
71600cf366 cache decoded android library in globalStoragePath 2020-06-27 18:33:13 +01:00
Dave Holoway
a567ea7266 update @types/vscode 2020-06-27 18:28:48 +01:00
Dave Holoway
2c522e38b1 improve extraction of parameter docs 2020-06-27 00:01:19 +01:00
Dave Holoway
8f9bf25e4c resolve new object contructors 2020-06-26 23:05:59 +01:00
Dave Holoway
edb16c667b wait for reparsing before returning method signatures 2020-06-26 22:10:21 +01:00
Dave Holoway
c943408613 remove parsed type list logging 2020-06-26 21:36:39 +01:00
Dave Holoway
43dbcb4d47 implement shceduleReparse to reduce parsing load while typing 2020-06-26 21:35:57 +01:00
Dave Holoway
8aaf6a6f0e add single trace function with timestamps 2020-06-26 17:52:50 +01:00
Dave Holoway
563142661a add support for displaying method signatures 2020-06-26 17:02:24 +01:00
Dave Holoway
f9a2665364 load and parse files at startup 2020-06-26 11:34:57 +01:00
Dave Holoway
7038bf7090 allow multiple source files to be used in parsing 2020-06-26 10:32:32 +01:00
Dave Holoway
175ce1d644 add support for editing multiple files 2020-06-25 17:16:01 +01:00
Dave Holoway
849c49acb6 fix bad member resolution at end of block
fix missing method and type docs
2020-06-25 15:47:12 +01:00
Dave Holoway
cda0810df1 add source types to list
hide this and super for non-methods
2020-06-25 15:07:04 +01:00
Dave Holoway
e2765fd982 improve code completion list
add method parameters
order list items by scope
2020-06-25 14:43:48 +01:00
Dave Holoway
f67c03bb34 add owning method to statements
create common keyword statement class
2020-06-25 11:43:53 +01:00
Dave Holoway
b0a2475696 ensure Object is always last in the list of inherited types 2020-06-25 10:56:02 +01:00
Dave Holoway
69e77eae8a support member completion for array types
improve comment formatting
2020-06-25 10:24:54 +01:00
Dave Holoway
b45314cc95 add support for docs in source types 2020-06-24 23:28:35 +01:00
Dave Holoway
e7e73387aa add support for field and method docs 2020-06-24 21:26:09 +01:00
Dave Holoway
089d174e08 use exact type signatures for locating types for completion items 2020-06-24 19:55:18 +01:00
Dave Holoway
b70592a0f7 support for member expressions 2020-06-24 17:10:49 +01:00
Dave Holoway
db865825d0 support package, type and static field import completion 2020-06-23 18:57:07 +01:00
Dave Holoway
591907f523 initial test of context-dependant code completion 2020-06-23 17:03:40 +01:00
Dave Holoway
cd6bf29e9f perform more detailed search of implemented methods 2020-06-23 14:41:20 +01:00
Dave Holoway
ce345965e5 improve support for ternary operators in assignments and method invocations 2020-06-23 11:26:14 +01:00
Dave Holoway
3073dfcd25 fix assert statement checks 2020-06-22 19:56:25 +01:00
Dave Holoway
085f027856 fix return type check 2020-06-22 19:52:13 +01:00
Dave Holoway
56464ef537 add basic type checking of lambda expressions 2020-06-22 19:05:26 +01:00
Dave Holoway
4f0e55a909 add implicit enum methods values() and valueOf() 2020-06-22 15:47:26 +01:00
Dave Holoway
fbb275600a check castability using type assignments 2020-06-22 14:41:32 +01:00
Dave Holoway
4fc616daa1 ensure tokens are assigned for qualified expressions 2020-06-22 13:03:28 +01:00
Dave Holoway
df210b4659 add checks for unary operators 2020-06-22 11:09:50 +01:00
Dave Holoway
491086a750 remove return type for source constructors 2020-06-21 21:36:56 +01:00
Dave Holoway
43c701adc8 add support for this() and super() constructor calls 2020-06-21 21:29:03 +01:00
Dave Holoway
153a6e869b improve method call resolving 2020-06-21 18:52:41 +01:00
Dave Holoway
6badc9fdb6 implement method body and ststement validation 2020-06-21 13:47:56 +01:00
Dave Holoway
a034a90735 support package name as a resolved value 2020-06-19 11:08:02 +01:00
Dave Holoway
82e660eabc improve checking of number literals 2020-06-18 18:39:41 +01:00
Dave Holoway
9be298293f rename ResolvedType to ResolvedValue 2020-06-18 17:22:17 +01:00
Dave Holoway
7fd7809be3 improve validation of binary operators 2020-06-18 17:12:18 +01:00
Dave Holoway
f4743e456b validate array indexes 2020-06-18 15:57:30 +01:00
Dave Holoway
1255a15bba validate array literals 2020-06-18 15:45:34 +01:00
Dave Holoway
f05b34171c add new array validation 2020-06-18 14:54:12 +01:00
Dave Holoway
d869afe2fa improve reporting of unresolved identifiers 2020-06-18 13:16:39 +01:00
Dave Holoway
c1f2ccdc4a allow assigns for assignable type arguments 2020-06-18 12:45:04 +01:00
Dave Holoway
b143772b26 check for valid type in class member expressions 2020-06-18 12:35:21 +01:00
Dave Holoway
0f296379c6 add type cast checking 2020-06-18 12:24:16 +01:00
Dave Holoway
2da127edc0 implement resolveExpression 2020-06-18 11:46:42 +01:00
Dave Holoway
13cdd1e0bc support token extraction in expressions 2020-06-17 15:37:30 +01:00
Dave Holoway
3c505b05be remove some parse checks that should be in verify 2020-06-17 13:50:14 +01:00
Dave Holoway
458d8e553e rename source types module 2020-06-17 13:09:50 +01:00
Dave Holoway
4f62b5a06e remove Value class, add NewExpression and separate out Any classes 2020-06-17 13:00:04 +01:00
Dave Holoway
b9fd805a6d extract literals into separate files 2020-06-17 12:14:48 +01:00
Dave Holoway
29e6132cac fix type warnings 2020-06-17 11:30:20 +01:00
Dave Holoway
d85f49546a extract statement types into separate files 2020-06-17 11:26:48 +01:00
Dave Holoway
143a31b0c4 extract expression types into separate files 2020-06-17 11:07:57 +01:00
Dave Holoway
1c8eb75b4f fix resolving imported enclosed types 2020-06-17 00:09:49 +01:00
Dave Holoway
fe28924e0c parse try-with-resources 2020-06-16 23:47:16 +01:00
Dave Holoway
dc39ae53b1 add hex exponent support 2020-06-16 22:40:55 +01:00
Dave Holoway
9d4e8ab7d0 remove this qualifier from isCastExpression 2020-06-16 22:31:22 +01:00
Dave Holoway
ecf67d44c0 import types from same package 2020-06-16 22:25:58 +01:00
Dave Holoway
198317a5c2 add support for static member imports 2020-06-16 20:22:19 +01:00
Dave Holoway
bccc29251c allow null scope in findIdentifier 2020-06-16 18:55:14 +01:00
Dave Holoway
e88475dddd fix bad imports when resolving annotations 2020-06-16 18:51:00 +01:00
Dave Holoway
8df1a3464b fix resolving of class type variables 2020-06-16 18:50:35 +01:00
Dave Holoway
26e54bba37 update typemap declarations to use CEIType instead of JavaType 2020-06-16 18:21:14 +01:00
Dave Holoway
b61ef125fc don't report missing constructors if superclass has none 2020-06-16 18:01:32 +01:00
Dave Holoway
6af16cac43 allow empty enums 2020-06-16 17:51:31 +01:00
Dave Holoway
9017752d7b allow super as a member qualifier 2020-06-16 17:43:59 +01:00
Dave Holoway
58ff585a9d implement specialisation of SourceType 2020-06-16 17:41:01 +01:00
Dave Holoway
46838686ea ignore unresolved types in extends/implements 2020-06-16 16:01:21 +01:00
Dave Holoway
9ac6086bad add support for parsing parameterless lambdas 2020-06-16 15:42:48 +01:00
Dave Holoway
8b71037a58 include enclosing types in identifier search 2020-06-16 15:05:17 +01:00
Dave Holoway
eeb6d7c3d0 allow uppercase 0X in hex literals 2020-06-16 13:58:45 +01:00
Dave Holoway
f74f4b26c6 add support for parsing enum values 2020-06-16 13:57:08 +01:00
Dave Holoway
b050f3a82d start separating validation from parsing 2020-06-16 12:59:08 +01:00
Dave Holoway
1801a81c0f allow trailing comma for array literals 2020-06-15 17:30:17 +01:00
Dave Holoway
14582503da remove local modifier validation during parse
add parameter modifier checking to validation
2020-06-15 17:16:39 +01:00
Dave Holoway
4af183e4e1 report errors from unit parsing 2020-06-15 16:58:45 +01:00
Dave Holoway
a8653f26df fix checking of array literal compatability 2020-06-15 16:57:00 +01:00
Dave Holoway
2f3349c359 fix support for resolving type variables in method declarations 2020-06-15 16:07:23 +01:00
Dave Holoway
549473d765 generate source types before parsing 2020-06-15 14:34:29 +01:00
Dave Holoway
01ae51d91a replace regex parsing with linear parsing 2020-06-15 11:15:25 +01:00
Dave Holoway
18d56e0bc0 refactor to allow expressions to have a type scope 2020-06-13 16:47:59 +01:00
Dave Holoway
da8d37aafd update to use new set of SourceX classes 2020-06-13 15:16:35 +01:00
Dave Holoway
f4a18ebcdc initial changes to support local type declarations 2020-06-12 14:32:11 +01:00
Dave Holoway
c70b75783e replace Locals with scopeable MethodDeclarations to allow labels and types to be stored 2020-06-12 13:32:15 +01:00
Dave Holoway
ac9a7ed43a refactor in preparation for parsing local types 2020-06-11 18:06:44 +01:00
Dave Holoway
d0308781f7 add missng strictfp modifier 2020-06-11 15:54:20 +01:00
Dave Holoway
974ec93841 fix type checking of field and method declarations 2020-06-11 15:50:55 +01:00
Dave Holoway
c454753385 improve reporting of unresolved type errors 2020-06-11 15:00:26 +01:00
Dave Holoway
3ab97ef235 improve modifier checks for interface types 2020-06-11 14:40:34 +01:00
Dave Holoway
5b29b9998d add support for generic inferred-type arguments 2020-06-11 13:44:59 +01:00
Dave Holoway
90c537b82d refactor new term qualifiers 2020-06-10 23:41:41 +01:00
Dave Holoway
cd725638cd parse labels and break/continue targets 2020-06-10 18:43:43 +01:00
Dave Holoway
87a2d72ae3 improve assert statement support 2020-06-10 16:29:23 +01:00
Dave Holoway
c9ab48031e update isCallCompatible to handle variable arity calls 2020-06-10 16:09:43 +01:00
Dave Holoway
dd9d23c64a tidy array constructors and fix some warnings 2020-06-10 15:11:16 +01:00
Dave Holoway
b175b52065 make variable arity parameters an array type 2020-06-10 14:50:40 +01:00
Dave Holoway
6dffe61d62 don't require default interface methods to be implemented 2020-06-10 13:22:37 +01:00
Dave Holoway
309cc47107 specialise methods with type variables 2020-06-10 11:57:16 +01:00
Dave Holoway
41adfbe53e initial attempt to support type variable arguments in methods 2020-06-09 15:01:58 +01:00
Dave Holoway
74a21ecbf8 add type variables to SourceMethod 2020-06-09 12:51:43 +01:00
Dave Holoway
252b476147 post-name array qualifiers in method decls 2020-06-09 12:05:25 +01:00
Dave Holoway
74a0339962 add support for post-name array qualifiers in fields and parameters 2020-06-08 22:50:30 +01:00
Dave Holoway
426735aa25 update ResolvableType to use same type resolving as method body parsing 2020-06-08 21:02:34 +01:00
Dave Holoway
7c9acfd7ca pass scoped type instead of method to typeIdent 2020-06-08 16:18:49 +01:00
Dave Holoway
261abb9cc7 add support for array qualifiers in type identifiers 2020-06-08 16:02:30 +01:00
Dave Holoway
1b1202598c refactor to prepare for merging with type parsing 2020-06-08 15:52:03 +01:00
Dave Holoway
c09620c481 add SourceInitialiser support 2020-06-08 13:53:24 +01:00
Dave Holoway
3a85c6f819 treat default and synchronized as modifiers 2020-06-08 13:04:57 +01:00
Dave Holoway
6fd6376dea re-add throws as a keyword 2020-06-08 12:40:39 +01:00
Dave Holoway
04c0e97c81 reuse parsed tokens instead of tokenizing each method body 2020-06-08 12:30:31 +01:00
Dave Holoway
bbc6007338 make type parser and body parser use same tokenizer 2020-06-08 11:45:01 +01:00
Dave Holoway
930237359e allow unicode char literals 2020-06-08 00:44:20 +01:00
Dave Holoway
c16bb1b30a support assert statement 2020-06-08 00:31:33 +01:00
Dave Holoway
f14d70feb6 map primitive types to their boxed versions for class member 2020-06-08 00:07:35 +01:00
Dave Holoway
67c1fc9db6 allow unicode characters, $ and _ in identifiers 2020-06-07 23:50:51 +01:00
Dave Holoway
49b5480870 allow generic types to be assigned to inherited types with compatible type arguments 2020-06-07 22:52:37 +01:00
Dave Holoway
6bcdecee07 fix parse issue with nested generic types 2020-06-07 22:38:18 +01:00
Dave Holoway
a4be37d872 initial support for wildcard type arguments 2020-06-07 21:31:11 +01:00
Dave Holoway
6ef64b1d9c make default a modifer keyword for interface default method support 2020-06-07 16:22:38 +01:00
Dave Holoway
4750212484 improve invalid array expression message
add AnyType array element to prevent cascading errors
2020-06-07 15:59:12 +01:00
Dave Holoway
20831c2326 make sure any long specifier is stripped from a bigint value 2020-06-07 15:46:08 +01:00
Dave Holoway
fc9d58b9da add support for array qualifiers after a variable name 2020-06-07 15:40:28 +01:00
Dave Holoway
c56732c689 allow character literals to be assigned to number types 2020-06-07 15:22:12 +01:00
Dave Holoway
ebc5f73bcc use better regex for string literals 2020-06-07 15:17:54 +01:00
Dave Holoway
7d6af70ae1 allow null to be cast to any non-primitve 2020-06-07 15:12:43 +01:00
Dave Holoway
ce6ed14aaa update primitive type compatibility 2020-06-07 14:54:26 +01:00
Dave Holoway
b30228c10b add support for synchronized statement 2020-06-07 14:22:26 +01:00
Dave Holoway
00d4998301 allow all primitive-number-type casts 2020-06-07 14:01:57 +01:00
Dave Holoway
52db53e65a casting only applies to qualified term not a whole expression 2020-06-07 13:36:29 +01:00
Dave Holoway
37dddc48d9 update check for cast expression 2020-06-07 13:26:46 +01:00
Dave Holoway
18ff477d34 clear diagnostics when document is closed 2020-06-07 12:58:01 +01:00
Dave Holoway
de846fef12 add support for literal numbers to be assignable to multiple primtive types 2020-06-07 12:51:49 +01:00
Dave Holoway
4ba7fd1b3d split shift operators from bitwise operators 2020-06-06 15:14:05 +01:00
Dave Holoway
f294cb2af1 allow AnyValue to be a constant value 2020-06-06 14:32:47 +01:00
Dave Holoway
67f1b617ff use isTypeAssignable for checking branch test expressions 2020-06-06 14:07:33 +01:00
Dave Holoway
09c15ef401 allow interfaces to be cast to class instances 2020-06-06 13:57:23 +01:00
Dave Holoway
13068cbcea add more info when methods/ctrs cannot be matched 2020-06-06 13:33:06 +01:00
Dave Holoway
432cd24f3c tidy up isTypeAssignable
allow class equivilents for primitives
2020-06-06 12:30:09 +01:00
Dave Holoway
1238d7980a update method call parameter checking
use isTypeAssignable instead of getParameterCompatibleTypeSignatures
2020-06-06 12:07:01 +01:00
Dave Holoway
19810a2f75 add Any* classes to reduce cascading errors 2020-06-06 11:39:15 +01:00
Dave Holoway
61b787d5ff update SourceMethod to pass name in super constructor 2020-06-06 11:38:19 +01:00
Dave Holoway
c113e8bee0 add constructor parameters to list of resolvable types 2020-06-05 18:31:32 +01:00
Dave Holoway
ee8f6513bf add missing constructor validator 2020-06-05 17:56:46 +01:00
Dave Holoway
4ed8411180 add default constructor for class types with no explicit constructors 2020-06-05 17:19:58 +01:00
Dave Holoway
9c579662e6 Fix resolving of enclosed type identifiers 2020-06-05 16:45:07 +01:00
Dave Holoway
b1d4261f28 fix assignment operator types 2020-06-05 16:12:30 +01:00
Dave Holoway
b50e7bea46 fix interface constructors
check constructor type modifiers
2020-06-05 15:20:09 +01:00
Dave Holoway
9a4dd63dc7 add super as an object literal 2020-06-05 14:50:09 +01:00
Dave Holoway
c43ba6ccf1 add new method body parser to use direct linear parsing 2020-06-05 14:36:42 +01:00
Dave Holoway
4f70cb0128 fix || and && not being tokenized as operators
allow float literals starting with dot
2020-05-28 17:17:08 +01:00
Dave Holoway
81a608b6da add support for array-literal expressions 2020-05-27 13:01:31 +01:00
Dave Holoway
ff8cf5b91a updated validation to use new JavaTypes module instead of MTIs 2020-05-26 18:41:35 +01:00
Dave Holoway
a46474c3c2 fix parsing of binary operstors following a bracket expression 2020-05-23 13:22:01 +01:00
Dave Holoway
23dc6d3871 different attempt to parse using collapsable text
ranges
2020-05-23 13:20:51 +01:00
Dave Holoway
bdc5b1d4cd add basic support for parsing new expressions 2020-05-18 15:04:19 +01:00
Dave Holoway
25a6ace1e4 add support for prefix/postfix inc expressions 2020-05-18 13:11:38 +01:00
Dave Holoway
66cee87685 first iteration of method body parser 2020-05-18 13:10:45 +01:00
Dave Holoway
79bba76b9f first hacky version of source parsing and type checking 2020-05-16 16:59:58 +01:00
Dave Holoway
3156a2ddc2 initial working language server 2020-04-30 11:38:15 +01:00
33 changed files with 1083 additions and 4145 deletions

View File

@@ -1,28 +1,23 @@
{
"plugins": ["jsdoc"],
"env": {
"browser": false,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 13,
"ecmaFeatures": {
"jsx": false
"env": {
"browser": false,
"commonjs": true,
"es6": true,
"node": true
},
"sourceType": "commonjs"
},
"rules": {
"no-const-assign": "warn",
"no-this-before-super": "warn",
"no-undef": "warn",
"no-unreachable": "warn",
"no-unused-vars": [
"warn",
{ "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }
],
"constructor-super": "warn",
"valid-typeof": "warn"
}
}
"parserOptions": {
"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"
}
}

2
.vscode/launch.json vendored
View File

@@ -8,6 +8,7 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"skipFiles": [
"<node_internals>/**"
]
@@ -39,6 +40,7 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ],
"stopOnEntry": false
}
],
"compounds": [

View File

@@ -1,18 +1,5 @@
# Change Log
### version 1.3.2
* Update analytics library
* Update lodash version - security advisory https://www.npmjs.com/advisories/1523
### version 1.3.0
* Support `ADB_SERVER_SOCKET`, `ANDROID_ADB_SERVER_ADDRESS` & `ANDROID_ADB_SERVER_PORT` env vars when connecting to ADB.
* Replace `adbPort` configuration option with a new `adbSocket` value to allow ADB server host to be overidden. (`adbPort` is now deprecated).
* Allow the JDWP local port to be fixed using a new `jdwpPort` configuration option.
### version 1.2.1
* Java Intellisense: automatically import dependencies of AndroidX libraries.
* Debugger: Warn about open instances of Android Studio
### version 1.2.0
* Java Intellisense beta.

View File

@@ -49,9 +49,9 @@ The following settings are used to configure the debugger:
// Fully qualified path to the built APK (Android Application Package).
"apkFile": "${workspaceRoot}/app/build/outputs/apk/app-debug.apk",
// `host:port` configuration for connecting to the ADB (Android Debug Bridge) server instance.
// Default: localhost:5037
"adbSocket": "localhost:5037",
// Port number to connect to the local ADB (Android Debug Bridge) instance.
// Default: 5037
"adbPort": 5037,
// Automatically launch 'adb start-server' if not already started.
// Default: true

View File

@@ -12,11 +12,8 @@ const { selectTargetDevice } = require('./src/utils/device');
/**
* @param {vscode.ExtensionContext} context
* @param {string} uid
* @param {number} session_id
* @param {*} vscode_props
*/
async function createLanguageClient(context, uid, session_id, vscode_props) {
async function createLanguageClient(context) {
// The server is implemented in node
let serverModule = context.asAbsolutePath(path.join('langserver', 'server.js'));
// The debug options for the server
@@ -48,6 +45,8 @@ async function createLanguageClient(context, uid, session_id, vscode_props) {
}
const sourceFiles = (await vscode.workspace.findFiles(`${globSearchRoot}**/*.java`, null, 1000, null)).map(uri => uri.toString());
const mpids = analytics.getIDs(context);
// Options to control the language client
/** @type {import('vscode-languageclient').LanguageClientOptions} */
let clientOptions = {
@@ -58,11 +57,11 @@ async function createLanguageClient(context, uid, session_id, vscode_props) {
initializationOptions: {
// extensionPath points to the root of the extension (the folder where this file is)
extensionPath: context.extensionPath,
uid,
session_id,
vscode_props,
mpuid: mpids.uid,
mpsid: mpids.sid,
initialSettings: config,
sourceFiles,
vscodeVersion: vscode.version,
workspaceFolders: (vscode.workspace.workspaceFolders || []).map(z => z.uri.toString()),
},
synchronize: {
@@ -115,18 +114,10 @@ function activate(context) {
/* Only the logcat stuff is configured here. The debugger is launched from src/debugMain.js */
AndroidContentProvider.register(context, vscode.workspace);
const { uid } = analytics.getIDs(context);
const session_id = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER);
const vscode_props = {
appName: vscode.env.appName,
language: vscode.env.language,
shell: vscode.env.shell,
uiKind: vscode.env.uiKind,
vscode_version: vscode.version,
}
analytics.init(undefined, uid, session_id, '', package_json, vscode_props, 'extension-start');
const mpids = analytics.getIDs(context);
analytics.init(undefined, mpids.uid, mpids.sid, package_json, { vscode_version: vscode.version });
createLanguageClient(context, uid, session_id, vscode_props).then(client => {
createLanguageClient(context).then(client => {
languageClient = client;
refreshLanguageServerEnabledState();
});
@@ -181,7 +172,6 @@ function activate(context) {
// this method is called when your extension is deactivated
function deactivate() {
analytics.event('extension-deactivate');
}
exports.activate = activate;

View File

@@ -1,53 +1,38 @@
const os = require('os');
const uuid = require('uuid').v4;
let client;
let mp;
/** @type {string} */
let uid;
/** @type {string} */
let did = uuid();
/** @type {number} */
let session_id;
let sid;
/** @type {Map<string,[number,number]>} */
const timeLabels = new Map();
let session_start = Date.now();
/** @type {string|Promise<string>} */
let ip = '';
let queued_events = null;
let package_info = null;
let vscode_info = null;
/**
* @param {string} [t]
* @param {string} u
* @param {number} s
* @param {string} ipaddr
* @param {{name:string,version:string}} package_json
* @param {*} vscode_props
* @param {string} caller
* @param {string} [u]
* @param {string} [s]
* @param {{name:string,version:string}} [package_json]
* @param {*} [props]
*/
function init(t = '94635b4642d80407accd3739fa35bed6', u, s, ipaddr, package_json, vscode_props, caller) {
if (client) {
function init(t = '0cca95950055c6553804a46ce7e3df18', u, s, package_json, props) {
if (mp) {
return;
}
try {
client = require('@amplitude/node').init(t);
mp = require('mixpanel').init(t);
}
catch {
return;
}
uid = u;
session_id = s || Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER);
ip = ipaddr || (getCurrentIP()
.catch(() => '')
.then(res => ip = res));
package_info = package_json;
vscode_info = vscode_props;
sid = s;
if (!caller) {
if (!props) {
return;
}
const os = require('os');
const now = new Date();
event(caller, {
event(`${package_json.name}-start`, {
extension: package_json.name,
ext_version: package_json.version,
arch: process.arch,
@@ -58,59 +43,30 @@ function init(t = '94635b4642d80407accd3739fa35bed6', u, s, ipaddr, package_json
release: os.release(),
localtime: now.toTimeString(),
tz: now.getTimezoneOffset(),
...vscode_props,
...props
});
}
function getCurrentIP() {
return new Promise((resolve, reject) => {
require('https').get(
Buffer.from('aHR0cHM6Ly91YTF4c3JhM2ZhLmV4ZWN1dGUtYXBpLmV1LXdlc3QtMi5hbWF6b25hd3MuY29tL3JlbA==','base64').toString(),
{ headers: { 'Content-Type': 'application/json' } },
res => resolve(res.headers['x-request-ip'])
)
.on('error', err => reject(err));
})
}
/**
*
* @param {string} eventName
* @param {*} [properties]
*/
function event(eventName, properties) {
if (!client || !eventName || (!uid && !did) || !ip) {
return;
}
if (queued_events) {
queued_events.push({eventName, properties});
return;
}
if (ip instanceof Promise) {
queued_events = [{eventName, properties}]
ip.catch(() => {}).then(() => {
const e = queued_events;
queued_events = null;
e.forEach(({eventName, properties}) => event(eventName, properties));
});
if (!mp) {
return;
}
try {
client.logEvent({
event_type: eventName,
user_id: uid,
device_id: uid ? undefined : did,
app_version: package_info.version,
ip,
language: vscode_info.language,
os_name: process.platform,
os_version: os.release(),
session_id,
event_properties: {
if (uid) {
mp.track(eventName, {
distinct_id: uid,
session_id: sid,
session_length: Math.trunc((Date.now() - session_start) / 60e3),
...properties,
}
});
});
} else {
mp.track(eventName, properties);
}
} catch {}
}
@@ -157,18 +113,29 @@ function timeEnd(label, time_unit = 'ms', additionalProps = {}) {
function getIDs(context) {
if (!context || !context.globalState) {
return {
uid: '',
uid: '', sid: ''
};
}
let uuidv4 = () => {
try {
uuidv4 = require('uuid').v4;
return uuidv4();
} catch {
return '';
}
}
let u = uid || (uid = context.globalState.get('mix-panel-id'));
if (typeof u !== 'string' || u.length > 36) {
u = uid = uuid();
u = uid = uuidv4();
context.globalState.update('mix-panel-id', u);
}
let s = sid || (sid = uuidv4());
return {
uid: u,
sid: s,
}
}
exports.init = init;
exports.event = event;
exports.time = time;

View File

@@ -1,17 +1,12 @@
const { CEIType, ArrayType, PrimitiveType } = require('java-mti');
const { JavaType, CEIType, ArrayType, PrimitiveType } = require('java-mti');
const { getTypeInheritanceList } = require('./java/expression-resolver');
const { CompletionItemKind } = require('vscode-languageserver');
const { CompletionItem, CompletionItemKind } = require('vscode-languageserver');
const { SourceType } = require('./java/source-types');
const { indexAt } = require('./document');
const { formatDoc } = require('./doc-formatter');
const { trace } = require('./logging');
const { event } = require('./analytics');
/**
* @typedef {import('vscode-languageserver').CompletionItem} CompletionItem
* @typedef {import('java-mti').JavaType} JavaType
*/
/**
* Case-insensitive sort routines
*/
@@ -121,7 +116,7 @@ function getTypedNameCompletion(typemap, type_signature, opts, typelist) {
&& !type_signature.slice(subtype_search.length).includes('$')
)
.map(type_signature => typemap.get(type_signature))
.forEach((t) => inner_types.set(t.simpleTypeName, { t }));
.forEach((t,idx) => inner_types.set(t.simpleTypeName, { t }));
}
return [
@@ -375,10 +370,7 @@ async function getCompletionItems(params, liveParsers, androidLibrary) {
completionRequestCount += 1;
if ((completionRequestCount === 1) || (completionRequestCount === 5) || ((completionRequestCount % 25) === 0)) {
event('completion-requests', {
comp_req_count: completionRequestCount, // total count for this session
comp_req_partial_count: (completionRequestCount % 25) || 25,
});
event('completion-requests', { comp_req_count: completionRequestCount });
}
let parsed = docinfo.parsed;

View File

@@ -1,12 +1,10 @@
const { CEIType } = require('java-mti');
const ParseProblem = require('./java/parsetypes/parse-problem');
const { parse } = require('./java/body-parser');
const { SourceUnit } = require('./java/source-types');
const { parseMethodBodies } = require('./java/validater');
const { time, timeEnd, trace } = require('./logging');
/**
* @typedef {import('java-mti').CEIType} CEIType
* @typedef {import('./java/source-types').SourceUnit} SourceUnit
*/
/**
* Marker to prevent early parsing of source files before we've completed our
* initial source file load (we cannot accurately parse individual files until we

View File

@@ -19,7 +19,7 @@ async function loadAndroidSystemLibrary(extensionPath, additional_libs) {
}
const cache_folder = path.join(extensionPath, 'langserver', '.library-cache');
trace(`loading android library from ${cache_folder} with androidx libs: ${JSON.stringify(additional_libs)}`)
const typemap = await loadJavaLibraryCacheFile(path.join(cache_folder, 'android-34.zip'));
const typemap = await loadJavaLibraryCacheFile(path.join(cache_folder, 'android-29.zip'));
if (Array.isArray(additional_libs) && additional_libs.length) {
await loadJavaLibraryCacheFile(path.join(cache_folder, 'androidx-20200701.zip'), additional_libs, typemap);
}

View File

@@ -1,30 +0,0 @@
/**
* 1. Download the latest platform and source
* ./android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install 'platforms;android-30'
* ./android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install 'sources;android-30'
*
* 2. Run this file, passing in the android API version
* node library-cache.js android-30
*
* 3. To create the final shipped data, move the JSON into a 'cache' folder and zip
* mkdir cache
* mv android-30.json cache
* zip -9 -r android-30.zip cache
*/
const path = require('path');
const { createAndroidLibraryCacheFile } = require('java-mti/android-library');
/**
* @param {`android-${number}`} api
*/
async function buildLibraryCache(api) {
// `createAndroidLibraryCacheFile()` just creates the JSON (not the zipped version)
const cache_filename = path.join(__dirname, '.library-cache', `${api}.json`);
await createAndroidLibraryCacheFile(cache_filename, { api });
}
const api = process.argv[2];
if (!api) throw new Error('android api parameter expected');
buildLibraryCache(api);

View File

@@ -41,10 +41,7 @@ async function getSignatureHelp(request, liveParsers) {
methodsigRequestCount += 1;
if ((methodsigRequestCount === 1) || (methodsigRequestCount === 5) || ((methodsigRequestCount % 25) === 0)) {
event('method-sig-requests', {
methsig_req_count: methodsigRequestCount,
methsig_req_partial_count: (methodsigRequestCount % 25) || 25,
});
event('method-sig-requests', { methsig_req_count: methodsigRequestCount });
}
// locate the token at the requested position

View File

@@ -1,430 +1,37 @@
{
"name": "langserver",
"version": "1.0.4",
"lockfileVersion": 2,
"version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "langserver",
"version": "1.0.4",
"license": "ISC",
"dependencies": {
"@amplitude/node": "^0.3.3",
"java-mti": "adelphes/java-mti#ec164ac",
"uuid": "8.2.0",
"vscode-languageserver": "6.1.1",
"vscode-languageserver-textdocument": "1.0.1",
"vscode-uri": "2.1.2"
},
"devDependencies": {
"@types/node": "^13.13.4"
}
},
"node_modules/@amplitude/node": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@amplitude/node/-/node-0.3.3.tgz",
"integrity": "sha512-Uzg4MRAuD053Ex67Iu2lm2GovnVte1uKI3q7CXlMCYZ9ylZmAkPbTnjg9OVyD4f+IiUfgK4p3bE7r9p7jqSDLA==",
"dependencies": {
"@amplitude/types": "^0.3.2",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@amplitude/types": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@amplitude/types/-/types-0.3.2.tgz",
"integrity": "sha512-7+m7nhJMFGbpsppOUsCH8f4FOFyAxgKFuXkKknU/LP2CMYVjWEIoLTKKgaJPc2c8wXaK5KPXVetb8VeiGbuaGg==",
"engines": {
"node": ">=6"
}
},
"node_modules/@types/node": {
"version": "13.13.52",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz",
"integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==",
"dev": true
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/big-integer": {
"version": "1.6.52",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz",
"integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==",
"engines": {
"node": ">=0.6"
}
},
"node_modules/binary": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
"integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==",
"dependencies": {
"buffers": "~0.1.1",
"chainsaw": "~0.1.0"
},
"engines": {
"node": "*"
}
},
"node_modules/bluebird": {
"version": "3.4.7",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/buffer-indexof-polyfill": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz",
"integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==",
"engines": {
"node": ">=0.10"
}
},
"node_modules/buffers": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
"integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==",
"engines": {
"node": ">=0.2.0"
}
},
"node_modules/chainsaw": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
"integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==",
"dependencies": {
"traverse": ">=0.3.0 <0.4"
},
"engines": {
"node": "*"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"node_modules/duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
"integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==",
"dependencies": {
"readable-stream": "^2.0.2"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/fstream": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
"dependencies": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
"mkdirp": ">=0.5 0",
"rimraf": "2"
},
"engines": {
"node": ">=0.6"
}
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
},
"node_modules/java-mti": {
"version": "2.0.0",
"resolved": "git+ssh://git@github.com/adelphes/java-mti.git#ec164ace68267813a1ca9df18651b51e3f3f067d",
"dependencies": {
"unzipper": "0.10.11"
}
},
"node_modules/listenercount": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
"integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ=="
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"node_modules/readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"node_modules/rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"dependencies": {
"glob": "^7.1.3"
},
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="
},
"node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dependencies": {
"safe-buffer": "~5.1.0"
}
},
"node_modules/traverse": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
"integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==",
"engines": {
"node": "*"
}
},
"node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/unzipper": {
"version": "0.10.11",
"resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.11.tgz",
"integrity": "sha512-+BrAq2oFqWod5IESRjL3S8baohbevGcVA+teAIOYWM3pDVdseogqbzhhvvmiyQrUNKFUnDMtELW3X8ykbyDCJw==",
"dependencies": {
"big-integer": "^1.6.17",
"binary": "~0.3.0",
"bluebird": "~3.4.1",
"buffer-indexof-polyfill": "~1.0.0",
"duplexer2": "~0.1.4",
"fstream": "^1.0.12",
"graceful-fs": "^4.2.2",
"listenercount": "~1.0.1",
"readable-stream": "~2.3.6",
"setimmediate": "~1.0.4"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
"node_modules/uuid": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.2.0.tgz",
"integrity": "sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/vscode-jsonrpc": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
"integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/vscode-languageserver": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-6.1.1.tgz",
"integrity": "sha512-DueEpkUAkD5XTR4MLYNr6bQIp/UFR0/IPApgXU3YfCBCB08u2sm9hRCs6DxYZELkk++STPjpcjksR2H8qI3cDQ==",
"dependencies": {
"vscode-languageserver-protocol": "^3.15.3"
},
"bin": {
"installServerIntoExtension": "bin/installServerIntoExtension"
}
},
"node_modules/vscode-languageserver-protocol": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
"integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
"dependencies": {
"vscode-jsonrpc": "8.2.0",
"vscode-languageserver-types": "3.17.5"
}
},
"node_modules/vscode-languageserver-textdocument": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.1.tgz",
"integrity": "sha512-UIcJDjX7IFkck7cSkNNyzIz5FyvpQfY7sdzVy+wkKN/BLaD4DQ0ppXQrKePomCxTS7RrolK1I0pey0bG9eh8dA=="
},
"node_modules/vscode-languageserver-types": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
"integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="
},
"node_modules/vscode-uri": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz",
"integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A=="
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}
},
"dependencies": {
"@amplitude/node": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@amplitude/node/-/node-0.3.3.tgz",
"integrity": "sha512-Uzg4MRAuD053Ex67Iu2lm2GovnVte1uKI3q7CXlMCYZ9ylZmAkPbTnjg9OVyD4f+IiUfgK4p3bE7r9p7jqSDLA==",
"requires": {
"@amplitude/types": "^0.3.2",
"tslib": "^1.9.3"
}
},
"@amplitude/types": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@amplitude/types/-/types-0.3.2.tgz",
"integrity": "sha512-7+m7nhJMFGbpsppOUsCH8f4FOFyAxgKFuXkKknU/LP2CMYVjWEIoLTKKgaJPc2c8wXaK5KPXVetb8VeiGbuaGg=="
},
"@types/node": {
"version": "13.13.52",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz",
"integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==",
"version": "13.13.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz",
"integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==",
"dev": true
},
"agent-base": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
"integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
"requires": {
"es6-promisify": "^5.0.0"
}
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"big-integer": {
"version": "1.6.52",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz",
"integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg=="
"version": "1.6.48",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
"integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w=="
},
"binary": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
"integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==",
"integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=",
"requires": {
"buffers": "~0.1.1",
"chainsaw": "~0.1.0"
@@ -433,7 +40,7 @@
"bluebird": {
"version": "3.4.7",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
"integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM="
},
"brace-expansion": {
"version": "1.1.11",
@@ -445,19 +52,19 @@
}
},
"buffer-indexof-polyfill": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz",
"integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz",
"integrity": "sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8="
},
"buffers": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
"integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ=="
"integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s="
},
"chainsaw": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
"integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==",
"integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=",
"requires": {
"traverse": ">=0.3.0 <0.4"
}
@@ -465,25 +72,46 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"requires": {
"ms": "^2.1.1"
}
},
"duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
"integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==",
"integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
"requires": {
"readable-stream": "^2.0.2"
}
},
"es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
"requires": {
"es6-promise": "^4.0.3"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fstream": {
"version": "1.0.12",
@@ -497,27 +125,36 @@
}
},
"glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw=="
},
"https-proxy-agent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.0.tgz",
"integrity": "sha512-y4jAxNEihqvBI5F3SaO2rtsjIOnnNA8sEbuiP+UhJZJHeM2NRm6c09ax2tgqme+SgUUvjao2fJXF4h3D6Cb2HQ==",
"requires": {
"agent-base": "^4.3.0",
"debug": "^3.1.0"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
@@ -531,45 +168,58 @@
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"java-mti": {
"version": "git+ssh://git@github.com/adelphes/java-mti.git#ec164ace68267813a1ca9df18651b51e3f3f067d",
"from": "java-mti@adelphes/java-mti#ec164ac",
"version": "github:adelphes/java-mti#d0e1e45bad4d2bba453dbcb5ad527db023f223e8",
"from": "github:adelphes/java-mti#d0e1e45",
"requires": {
"unzipper": "0.10.11"
"unzipper": "^0.10.11"
}
},
"listenercount": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",
"integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ=="
"integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc="
},
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"mixpanel": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/mixpanel/-/mixpanel-0.11.0.tgz",
"integrity": "sha512-TS7AkCmfC+vGshlCOjEcITFoFxlt5fdSEqmN+d+pTXAhE5v+jPQW2uUcn9W+Oq4NVXz+kdskU09dsm9vmNl0ig==",
"requires": {
"https-proxy-agent": "3.0.0"
}
},
"mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"requires": {
"minimist": "^1.2.6"
"minimist": "^1.2.5"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
@@ -577,7 +227,7 @@
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"process-nextick-args": {
"version": "2.0.1",
@@ -585,9 +235,9 @@
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -614,7 +264,7 @@
"setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"string_decoder": {
"version": "1.1.1",
@@ -627,12 +277,7 @@
"traverse": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
"integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ=="
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
"integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk="
},
"unzipper": {
"version": "0.10.11",
@@ -654,7 +299,7 @@
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"uuid": {
"version": "8.2.0",
@@ -662,9 +307,9 @@
"integrity": "sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q=="
},
"vscode-jsonrpc": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
"integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA=="
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz",
"integrity": "sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A=="
},
"vscode-languageserver": {
"version": "6.1.1",
@@ -675,12 +320,12 @@
}
},
"vscode-languageserver-protocol": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
"integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
"version": "3.15.3",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz",
"integrity": "sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw==",
"requires": {
"vscode-jsonrpc": "8.2.0",
"vscode-languageserver-types": "3.17.5"
"vscode-jsonrpc": "^5.0.1",
"vscode-languageserver-types": "3.15.1"
}
},
"vscode-languageserver-textdocument": {
@@ -689,9 +334,9 @@
"integrity": "sha512-UIcJDjX7IFkck7cSkNNyzIz5FyvpQfY7sdzVy+wkKN/BLaD4DQ0ppXQrKePomCxTS7RrolK1I0pey0bG9eh8dA=="
},
"vscode-languageserver-types": {
"version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
"integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="
"version": "3.15.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.1.tgz",
"integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ=="
},
"vscode-uri": {
"version": "2.1.2",
@@ -701,7 +346,7 @@
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "langserver",
"version": "1.0.4",
"version": "1.0.3",
"description": "Language server for Android development",
"main": "server.js",
"scripts": {
@@ -9,8 +9,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@amplitude/node": "^0.3.3",
"java-mti": "adelphes/java-mti#ec164ac",
"java-mti": "adelphes/java-mti#d0e1e45",
"mixpanel": "0.11.0",
"uuid": "8.2.0",
"vscode-languageserver": "6.1.1",
"vscode-languageserver-textdocument": "1.0.1",

View File

@@ -7,9 +7,11 @@ const {
} = require('vscode-languageserver');
const fs = require('fs');
const { TextDocument } = require('vscode-languageserver-textdocument');
const { URI } = require('vscode-uri');
const { loadAndroidSystemLibrary } = require('./java/java-libraries');
const { CEIType } = require('java-mti');
const { Settings } = require('./settings');
const { trace } = require('./logging');
@@ -17,14 +19,10 @@ const { clearDefaultCompletionEntries, getCompletionItems, resolveCompletionItem
const { getSignatureHelp } = require('./method-signatures');
const { FileURIMap, JavaDocInfo, indexAt, reparse } = require('./document');
const { v4: uuidv4 } = require('uuid');
const analytics = require('./analytics');
const package_json = require('./package.json');
/**
* @typedef {import('vscode-languageserver-textdocument').TextDocument} TextDocument
* @typedef {import('java-mti').CEIType} CEIType
*/
/**
* The global map of Android system types
* @typedef {Map<string, CEIType>} AndroidLibrary
@@ -137,7 +135,7 @@ connection.onInitialize((params) => {
}
Settings.set(startupOpts.initialSettings);
analytics.init(undefined, startupOpts.uid, startupOpts.session_id, '', package_json, startupOpts.vscode_props, 'langserver-start');
analytics.init(undefined, startupOpts.mpuid, uuidv4(), package_json, { vscode_version: startupOpts.vscodeVersion });
loadCodeCompletionLibrary(startupOpts.extensionPath, Settings.codeCompletionLibraries);

3843
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "android-dev-ext",
"displayName": "Android",
"description": "Android debugging support for VS Code",
"version": "1.4.0",
"version": "1.2.0",
"publisher": "adelphes",
"preview": true,
"license": "MIT",
@@ -238,7 +238,8 @@
"launch": {
"required": [
"appSrcRoot",
"apkFile"
"apkFile",
"adbPort"
],
"properties": {
"amStartArgs": {
@@ -264,17 +265,12 @@
},
"adbPort": {
"type": "integer",
"description": "Port number to connect to the local ADB (Android Debug Bridge) instance. Default: 5037\nDeprecated: Configure the 'adbSocket' property instead.",
"description": "Port number to connect to the local ADB (Android Debug Bridge) instance. Default: 5037",
"default": 5037
},
"adbSocket": {
"type": "string",
"description": "`host : port` configuration for connecting to the ADB (Android Debug Bridge) server instance. Default: \"localhost:5037\"",
"default": "localhost:5037"
},
"autoStartADB": {
"type": "boolean",
"description": "Automatically attempt to launch 'adb start-server' if not already started. Default: true",
"description": "Automatically launch 'adb start-server' if not already started. Default: true",
"default": true
},
"callStackDisplaySize": {
@@ -282,11 +278,6 @@
"description": "Number of entries to display in call stack views (for locations outside of the project source). 0 shows the entire call stack. Default: 1",
"default": 1
},
"jdwpPort": {
"type": "integer",
"description": "Manually specify the local port used for connecting to the on-device debugger client.\nThis can be useful if you are using port-forwarding to connect to a remote device.\nThe specified port must be available and different from the ADB socket port.\nSet to 0 for automatic (dynamic) assignment.\nDefault: 0",
"default": 0
},
"launchActivity": {
"type": "string",
"description": "Manually specify the activity to run when the app is started.",
@@ -334,6 +325,7 @@
"attach": {
"required": [
"appSrcRoot",
"adbPort",
"processId"
],
"properties": {
@@ -344,19 +336,9 @@
},
"adbPort": {
"type": "integer",
"description": "Port number to connect to the local ADB (Android Debug Bridge) instance. Default: 5037\nDeprecated: Configure the 'adbSocket' property instead.",
"description": "Port number to connect to the local ADB (Android Debug Bridge) instance. Default: 5037",
"default": 5037
},
"adbSocket": {
"type": "string",
"description": "`host : port` configuration for connecting to the ADB (Android Debug Bridge) server instance. Default: \"localhost:5037\"",
"default": "localhost:5037"
},
"jdwpPort": {
"type": "integer",
"description": "Manually specify the local port used for connecting to the on-device debugger client.\nThis can be useful if you are using port-forwarding to connect to a remote device.\nThe specified port must be available and different from the ADB socket port.\nSet to 0 for automatic (dynamic) assignment.\nDefault: 0",
"default": 0
},
"processId": {
"type": "string",
"description": "PID of process to attach to.\n\"${command:PickAndroidProcess}\" will display a list of debuggable PIDs to choose from during launch.",
@@ -428,23 +410,22 @@
"test": "node ./node_modules/vscode/bin/test"
},
"dependencies": {
"@vscode/debugadapter": "1.64.0",
"@vscode/debugprotocol": "^1.64.0",
"long": "^5.2.3",
"unzipper": "0.10.14",
"uuid": "9.0.1",
"long": "4.0.0",
"unzipper": "0.10.11",
"uuid": "8.2.0",
"vscode-debugadapter": "1.40.0",
"vscode-debugprotocol": "1.40.0",
"vscode-languageclient": "6.1.3",
"ws": "8.16.0",
"xmldom": "0.6.0",
"xpath": "0.0.34"
"ws": "7.3.0",
"xmldom": "0.1.31",
"xpath": "0.0.27"
},
"devDependencies": {
"@types/mocha": "^10.0.06",
"@types/node": "^20.10.6",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.5",
"@types/vscode": "^1.24.0",
"eslint": "^8.56.0",
"eslint-plugin-jsdoc": "^47.0.2",
"mocha": "^10.8.2",
"typescript": "^5.3.3"
"eslint": "^5.9.0",
"mocha": "^5.2.0",
"typescript": "^3.8.3"
}
}

View File

@@ -36,94 +36,17 @@ function parse_device_list(data, extended = false) {
return devicelist;
}
let adbSocketParams;
/**
* Return the host and port for connecting to the ADB server
*/
function getADBSocketParams() {
// this is memoized to prevent alterations once the debug session is up and running
if (adbSocketParams) {
return adbSocketParams;
}
return adbSocketParams = getIntialADBSocketParams();
}
/**
* Retrieve the socket parameters for connecting to an ADB server instance.
* In priority order (highest first):
* 1. adbSocket debug configuration value
* 2. non-default adbPort debug configuration value (using localhost)
* 3. ADB_SERVER_SOCKET environment variable
* 4. ANDROID_ADB_SERVER_ADDRESS / ANDROID_ADB_SERVER_PORT environment variables
* 5. [localhost]:5037
*/
function getIntialADBSocketParams() {
/**
* Retrieve a trimmed environment variable or return a blank string
* @param {string} name
*/
function envValue(name) {
return (process.env[name] || '').trim();
}
function decode_port_string(s) {
if (!/^\d+$/.test(s)) {
return;
}
const portnum = parseInt(s, 10);
if (portnum < 1 || portnum > 65535) {
return;
}
return portnum;
}
const default_host = '', default_port = 5037;
// the ADBSocket.HostPort value is automatically set with adbSocket/adbPort values from
// the debug configuration when the debugger session starts.
let socket_str = ADBSocket.HostPort.trim();
if (socket_str !== ADBSocket.DefaultHostPort) {
// non-default debug configuration values are configured (1. or 2.)
const [host, port] = socket_str.split(':');
return {
host,
port: decode_port_string(port) || default_port
}
}
// ADB_SERVER_SOCKET=tcp:<host>:<port>
const adb_server_socket_match = envValue('ADB_SERVER_SOCKET').match(/^\s*tcp(?::(.*))?(?::(\d+))\s*$/);
if (adb_server_socket_match) {
return {
host: adb_server_socket_match[1] || default_host,
port: decode_port_string(adb_server_socket_match[2]) || default_port,
}
}
return {
host: envValue('ANDROID_ADB_SERVER_ADDRESS') || default_host,
port: decode_port_string(envValue('ANDROID_ADB_SERVER_PORT')) || default_port,
}
}
class ADBClient {
/**
* @param {string} [deviceid]
* @param {number} [adbPort] the port number to connect to ADB
* @param {number} [adbHost] the hostname/ip address to connect to ADB
*/
constructor(deviceid, adbPort, adbHost) {
constructor(deviceid, adbPort = ADBSocket.ADBPort) {
this.deviceid = deviceid;
this.adbsocket = null;
this.jdwp_socket = null;
const default_adb_socket = getADBSocketParams();
this.adbHost = adbHost || default_adb_socket.host;
this.adbPort = adbPort || default_adb_socket.port;
this.adbPort = adbPort;
}
async test_adb_connection() {
@@ -247,10 +170,7 @@ class ADBClient {
// note that upon success, this method does not close the connection (it must be left open for
// future commands to be sent over the jdwp socket)
this.jdwp_socket = new JDWPSocket(o.onreply, o.ondisconnect);
// assume the 'local' port (routed to connect to the process on the device)
// is set up on the same host that the adb server is running on
const adb_server_socket = getADBSocketParams();
await this.jdwp_socket.connect(o.localport, adb_server_socket.host);
await this.jdwp_socket.connect(o.localport)
await this.jdwp_socket.start();
return true;
}
@@ -356,9 +276,12 @@ class ADBClient {
return true;
}
connect_to_adb() {
/**
* @param {string} [hostname]
*/
connect_to_adb(hostname = '127.0.0.1') {
this.adbsocket = new ADBSocket();
return this.adbsocket.connect(this.adbPort, this.adbHost);
return this.adbsocket.connect(this.adbPort, hostname);
}
disconnect_from_adb () {
@@ -367,4 +290,3 @@ class ADBClient {
};
exports.ADBClient = ADBClient;
exports.getADBSocketParams = getADBSocketParams;

View File

@@ -4,7 +4,7 @@ const { workspace, EventEmitter, Uri } = vscode;
class AndroidContentProvider {
constructor() {
/** @type {Map<vscode.Uri,*>} */
/** @type {Map<Uri,*>} */
this._docs = new Map(); // Map<uri, LogcatContent>
this._onDidChange = new EventEmitter();
}
@@ -27,11 +27,11 @@ class AndroidContentProvider {
* [document](TextDocument). Resources allocated should be released when
* the corresponding document has been [closed](#workspace.onDidCloseTextDocument).
*
* @param {vscode.Uri} uri An uri which scheme matches the scheme this provider was [registered](#workspace.registerTextDocumentContentProvider) for.
* @param {vscode.CancellationToken} _token A cancellation token.
* @param {Uri} uri An uri which scheme matches the scheme this provider was [registered](#workspace.registerTextDocumentContentProvider) for.
* @param {vscode.CancellationToken} token A cancellation token.
* @return {string|Thenable<string>} A string or a thenable that resolves to such.
*/
provideTextDocumentContent(uri, _token) {
provideTextDocumentContent(uri, token) {
const doc = this._docs.get(uri);
if (doc) {
return doc.content();
@@ -44,7 +44,7 @@ class AndroidContentProvider {
}
/**
* @param {vscode.Uri} uri
* @param {Uri} uri
*/
provideLogcatDocumentContent(uri) {
// LogcatContent depends upon AndroidContentProvider, so we must delay-load this

View File

@@ -1,17 +1,18 @@
const {
DebugSession,
InitializedEvent, TerminatedEvent, StoppedEvent, BreakpointEvent, ThreadEvent, OutputEvent,
Thread, StackFrame, Scope, Source, Breakpoint } = require('@vscode/debugadapter');
Thread, StackFrame, Scope, Source, Breakpoint } = require('vscode-debugadapter');
// node and external modules
const os = require('os');
const path = require('path');
const uuidv4 = require('uuid').v4;
// our stuff
const { ADBClient } = require('./adbclient');
const { APKFileInfo } = require('./apk-file-info');
const { Debugger } = require('./debugger');
const { AttachBuildInfo, BreakpointOptions, DebuggerException, JavaClassType, LaunchBuildInfo } = require('./debugger-types');
const { AttachBuildInfo, BreakpointOptions, DebuggerException, DebuggerValue, JavaBreakpointEvent, JavaClassType, JavaExceptionEvent, LaunchBuildInfo, SourceLocation } = require('./debugger-types');
const { evaluate } = require('./expression/evaluate');
const { PackageInfo } = require('./package-searcher');
const ADBSocket = require('./sockets/adbsocket');
@@ -19,16 +20,9 @@ const { AndroidThread } = require('./threads');
const { checkADBStarted, getAndroidSourcesFolder } = require('./utils/android');
const { D, initLogToClient, onMessagePrint } = require('./utils/print');
const { hasValidSourceFileExtension } = require('./utils/source-file');
const { VariableManager } = require('./variable-manager');
const analytics = require('../langserver/analytics');
/**
* @typedef {import('./debugger-types').DebuggerValue} DebuggerValue
* @typedef {import('./debugger-types').JavaBreakpointEvent} JavaBreakpointEvent
* @typedef {import('./debugger-types').JavaExceptionEvent} JavaExceptionEvent
* @typedef {import('./debugger-types').SourceLocation} SourceLocation
* @typedef {import('./variable-manager').VariableManager} VariableManager
*/
class AndroidDebugSession extends DebugSession {
/**
@@ -117,8 +111,9 @@ class AndroidDebugSession extends DebugSession {
this.terminate_reason = '';
this.session_id = uuidv4();
this.session_start = new Date();
analytics.init(undefined, undefined, undefined, '', require('../package.json'), {}, 'debugger-start');
analytics.init();
// this debugger uses one-based lines and columns
this.setDebuggerLinesStartAt1(true);
@@ -131,7 +126,7 @@ class AndroidDebugSession extends DebugSession {
/**
* The 'initialize' request is the first request called by the frontend
* to interrogate the features the debug adapter provides.
* @param {import('@vscode/debugprotocol').DebugProtocol.InitializeResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.InitializeResponse} response
*/
initializeRequest(response) {
response.body.exceptionBreakpointFilters = [
@@ -144,8 +139,8 @@ class AndroidDebugSession extends DebugSession {
response.body.supportsExceptionInfoRequest = true;
response.body.supportsHitConditionalBreakpoints = true;
this.sendResponse(response);
}
this.sendResponse(response);
}
/**
* @param {string} msg
@@ -172,7 +167,7 @@ class AndroidDebugSession extends DebugSession {
/**
* @param {string} msg
* @param {import('@vscode/debugprotocol').DebugProtocol.Response} response
* @param {import('vscode-debugprotocol').DebugProtocol.Response} response
* @param {boolean} silent
*/
failRequest(msg, response, silent = false) {
@@ -191,7 +186,7 @@ class AndroidDebugSession extends DebugSession {
/**
* @param {string} requestName
* @param {number} threadId
* @param {import('@vscode/debugprotocol').DebugProtocol.Response} response
* @param {import('vscode-debugprotocol').DebugProtocol.Response} response
*/
failRequestNoThread(requestName, threadId, response) {
this.failRequest(`${requestName} failed. Thread ${threadId} not found`, response);
@@ -200,7 +195,7 @@ class AndroidDebugSession extends DebugSession {
/**
* @param {string} requestName
* @param {number} threadId
* @param {import('@vscode/debugprotocol').DebugProtocol.Response} response
* @param {import('vscode-debugprotocol').DebugProtocol.Response} response
*/
failRequestThreadNotSuspended(requestName, threadId, response) {
this.failRequest(`${requestName} failed. Thread ${threadId} is not suspended`, response);
@@ -209,7 +204,7 @@ class AndroidDebugSession extends DebugSession {
/**
* @param {string} requestName
* @param {number} threadId
* @param {import('@vscode/debugprotocol').DebugProtocol.Response} response
* @param {import('vscode-debugprotocol').DebugProtocol.Response} response
*/
cancelRequestThreadNotSuspended(requestName, threadId, response) {
// now that vscode can resume threads before the locals,callstack,etc are retrieved, we only need to cancel the request
@@ -330,17 +325,14 @@ class AndroidDebugSession extends DebugSession {
/**
* @typedef AndroidAttachArguments
* @property {number} adbPort
* @property {string} adbSocket
* @property {string} appSrcRoot
* @property {boolean} autoStartADB
* @property {number} jdwpPort
* @property {number} processId
* @property {string} targetDevice
* @property {boolean} trace
*
* @param {import('@vscode/debugprotocol').DebugProtocol.AttachResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.AttachRequestArguments & AndroidAttachArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.AttachResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.AttachRequestArguments & AndroidAttachArguments} args
*/
async attachRequest(response, args) {
this.debug_mode = 'attach';
@@ -348,7 +340,7 @@ class AndroidDebugSession extends DebugSession {
this.trace = args.trace;
onMessagePrint(this.LOG.bind(this));
}
D(JSON.stringify({type: 'attach', args, env:process.env}, null, ' '));
D(`Attach: ${JSON.stringify(args)}`);
if (args.targetDevice === 'null') {
// "null" is returned from the device picker if there's an error or if the
@@ -376,18 +368,6 @@ class AndroidDebugSession extends DebugSession {
return;
}
// set the custom ADB host and port
if (typeof args.adbSocket === 'string' && args.adbSocket) {
ADBSocket.HostPort = args.adbSocket;
} else if (typeof args.adbPort === 'number' && args.adbPort >= 0 && args.adbPort <= 65535) {
ADBSocket.HostPort = `:${args.adbPort}`;
}
// set the fixed JDWP port number (if any)
if (typeof args.jdwpPort === 'number' && args.jdwpPort >= 0 && args.jdwpPort <= 65535) {
Debugger.portManager.fixedport = args.jdwpPort;
}
try {
// app_src_root must end in a path-separator for correct validation of sub-paths
this.app_src_root = ensure_path_end_slash(args.appSrcRoot);
@@ -450,28 +430,25 @@ class AndroidDebugSession extends DebugSession {
await this.dbgr.resume();
analytics.event('debug-started', {
dbg_start: this.session_start.toTimeString(),
dbg_session_id: this.session_id,
dbg_start: this.session_start.toLocaleTimeString(),
dbg_tz: this.session_start.getTimezoneOffset(),
dbg_kind: 'attach',
dbg_device_api: this.device_api_level,
dbg_emulator: /^emulator/.test(this._device.serial),
})
} catch(e) {
const msg = e.message||e.msg;
//this.performDisconnect();
// exceptions use message, adbclient uses msg
this.LOG('Attach failed: '+(msg||'No additional information is available'));
this.LOG('Attach failed: '+(e.message||e.msg||'No additional information is available'));
// more info for adb connect errors
if (/^ADB server is not running/.test(e.msg)) {
this.LOG('Make sure the Android SDK Platform Tools are installed and run:');
this.LOG(' adb start-server');
this.LOG('If you are running ADB using a non-default configuration, also make sure the adbSocket value in your launch.json is correct.');
}
if (/ADB|JDWP/.test(msg)) {
this.LOG('Ensure any instances of Android Studio are closed and ADB is running.');
this.LOG('If you are running ADB on a non-default port, also make sure the adbPort value in your launch.json is correct.');
}
// tell the client we're done
this.terminate_reason = `start-exception: ${msg}`;
this.terminate_reason = `start-exception: ${e.message||e.msg}`;
this.sendEvent(new TerminatedEvent(false));
}
}
@@ -479,13 +456,11 @@ class AndroidDebugSession extends DebugSession {
/**
* @typedef AndroidLaunchArguments
* @property {number} adbPort
* @property {string} adbSocket
* @property {string[]} amStartArgs
* @property {string} apkFile
* @property {string} appSrcRoot
* @property {boolean} autoStartADB
* @property {number} callStackDisplaySize
* @property {number} jdwpPort
* @property {string} launchActivity
* @property {string} manifestFile
* @property {string[]} pmInstallArgs
@@ -496,8 +471,8 @@ class AndroidDebugSession extends DebugSession {
* @property {boolean} trace
* The entry point to the debugger
* @param {import('@vscode/debugprotocol').DebugProtocol.LaunchResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.LaunchRequestArguments & AndroidLaunchArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.LaunchResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.LaunchRequestArguments & AndroidLaunchArguments} args
*/
async launchRequest(response, args) {
this.debug_mode = 'launch';
@@ -505,7 +480,7 @@ class AndroidDebugSession extends DebugSession {
this.trace = args.trace;
onMessagePrint(this.LOG.bind(this));
}
D(JSON.stringify({type: 'launch', args, env:process.env}, null, ' '));
D(`Launch: ${JSON.stringify(args)}`);
if (args.targetDevice === 'null') {
// "null" is returned from the device picker if there's an error or if the
@@ -533,16 +508,9 @@ class AndroidDebugSession extends DebugSession {
return;
}
// set the custom ADB host and port
if (typeof args.adbSocket === 'string' && args.adbSocket) {
ADBSocket.HostPort = args.adbSocket;
} else if (typeof args.adbPort === 'number' && args.adbPort >= 0 && args.adbPort <= 65535) {
ADBSocket.HostPort = `:${args.adbPort}`;
}
// set the fixed JDWP port number (if any)
if (typeof args.jdwpPort === 'number' && args.jdwpPort >= 0 && args.jdwpPort <= 65535) {
Debugger.portManager.fixedport = args.jdwpPort;
// set the custom ADB port - this should be changed to pass it to each ADBClient instance
if (typeof args.adbPort === 'number' && args.adbPort >= 0 && args.adbPort <= 65535) {
ADBSocket.ADBPort = args.adbPort;
}
try {
@@ -615,7 +583,8 @@ class AndroidDebugSession extends DebugSession {
await this.dbgr.resume();
analytics.event('debug-started', {
dbg_start: this.session_start.toTimeString(),
dbg_session_id: this.session_id,
dbg_start: this.session_start.toLocaleTimeString(),
dbg_tz: this.session_start.getTimezoneOffset(),
dbg_kind: 'debug',
dbg_device_api: this.device_api_level,
@@ -626,20 +595,16 @@ class AndroidDebugSession extends DebugSession {
this.LOG('Application started');
} catch(e) {
const msg = e.message || e.msg;
// exceptions use message, adbclient uses msg
this.LOG('Launch failed: '+(msg || 'No additional information is available'));
this.LOG('Launch failed: '+(e.message||e.msg||'No additional information is available'));
// more info for adb connect errors
if (/^ADB server is not running/.test(e.msg)) {
this.LOG('Make sure the Android SDK Platform Tools are installed and run:');
this.LOG(' adb start-server');
this.LOG('If you are running ADB on a non-default port, also make sure the adbPort value in your launch.json is correct.');
}
if (/ADB|JDWP/.test(msg)) {
this.LOG('Ensure any instances of Android Studio are closed.');
}
// tell the client we're done
this.terminate_reason = `start-exception: ${msg}`;
this.terminate_reason = `start-exception: ${e.message||e.msg}`;
this.sendEvent(new TerminatedEvent(false));
}
}
@@ -794,7 +759,7 @@ class AndroidDebugSession extends DebugSession {
/**
*
* @param {import('@vscode/debugprotocol').DebugProtocol.ConfigurationDoneResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.ConfigurationDoneResponse} response
*/
configurationDoneRequest(response) {
D('configurationDoneRequest');
@@ -814,14 +779,14 @@ class AndroidDebugSession extends DebugSession {
/**
*
* @param {import('@vscode/debugprotocol').DebugProtocol.DisconnectResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.DisconnectResponse} response
*/
async disconnectRequest(response) {
D('disconnectRequest');
this._isDisconnecting = true;
analytics.event('debug-end', {
dbg_session_id: this.session_id,
dbg_elapsed: Math.trunc((Date.now() - this.session_start.getTime())/1e3),
dbg_kind: this.debug_mode,
dbg_term_reason: this.terminate_reason,
});
if (this.debuggerAttached) {
@@ -864,8 +829,8 @@ class AndroidDebugSession extends DebugSession {
/**
* Called when the user requests a change to breakpoints in a source file
* Note: all breakpoints in a file are always sent in args, even if they are not changing
* @param {import('@vscode/debugprotocol').DebugProtocol.SetBreakpointsResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.SetBreakpointsArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.SetBreakpointsResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.SetBreakpointsArguments} args
*/
async setBreakPointsRequest(response, args) {
const source_filename = args.source && args.source.path;
@@ -935,7 +900,7 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.SourceBreakpoint[]} breakpoints
* @param {import('vscode-debugprotocol').DebugProtocol.SourceBreakpoint[]} breakpoints
* @param {string} relative_fpn
*/
async setupBreakpointsInFile(breakpoints, relative_fpn) {
@@ -973,8 +938,8 @@ class AndroidDebugSession extends DebugSession {
};
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.SetExceptionBreakpointsResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.SetExceptionBreakpointsArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.SetExceptionBreakpointsResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.SetExceptionBreakpointsArguments} args
*/
async setExceptionBreakPointsRequest(response, args) {
await this.dbgr.clearBreakOnExceptions();
@@ -991,7 +956,7 @@ class AndroidDebugSession extends DebugSession {
/**
*
* @param {import('@vscode/debugprotocol').DebugProtocol.ThreadsResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.ThreadsResponse} response
*/
async threadsRequest(response) {
if (!this._threads.length) {
@@ -1017,8 +982,8 @@ class AndroidDebugSession extends DebugSession {
/**
* Returns a stack trace for the given threadId
* @param {import('@vscode/debugprotocol').DebugProtocol.StackTraceResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.StackTraceArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.StackTraceResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.StackTraceArguments} args
*/
async stackTraceRequest(response, args) {
D(`stackTraceRequest thread:${args.threadId}`);
@@ -1103,8 +1068,8 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.ScopesResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.ScopesArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.ScopesResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.ScopesArguments} args
*/
async scopesRequest(response, args) {
D(`scopesRequest frame:${args.frameId}`);
@@ -1135,8 +1100,8 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.SourceResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.SourceArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.SourceResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.SourceArguments} args
*/
sourceRequest(response, args) {
D(`sourceRequest: ${args.sourceReference}`);
@@ -1159,8 +1124,8 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.VariablesResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.VariablesArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.VariablesResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.VariablesArguments} args
*/
async variablesRequest(response, args) {
D(`variablesRequest variablesReference:${args.variablesReference}`);
@@ -1247,8 +1212,8 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.ContinueResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.ContinueArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.ContinueResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.ContinueArguments} args
*/
continueRequest(response, args) {
D(`Continue thread:${args.threadId}`);
@@ -1273,8 +1238,8 @@ class AndroidDebugSession extends DebugSession {
/**
* Called by the user to start a step operation
* @param {DebuggerStepType} which
* @param {import('@vscode/debugprotocol').DebugProtocol.NextResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.NextArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.NextResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.NextArguments} args
*/
doStep(which, response, args) {
D(`step ${which}`);
@@ -1298,24 +1263,24 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.NextResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.StepInArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.NextResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.StepInArguments} args
*/
stepInRequest(response, args) {
this.doStep('in', response, args);
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.NextResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.NextArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.NextResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.NextArguments} args
*/
nextRequest(response, args) {
this.doStep('over', response, args);
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.NextResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.StepOutArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.NextResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.StepOutArguments} args
*/
stepOutRequest(response, args) {
this.doStep('out', response, args);
@@ -1336,8 +1301,8 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.ExceptionInfoResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.ExceptionInfoArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.ExceptionInfoResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.ExceptionInfoArguments} args
*/
async exceptionInfoRequest(response, args) {
D(`exceptionInfoRequest: ${args.threadId}`);
@@ -1409,8 +1374,8 @@ class AndroidDebugSession extends DebugSession {
}
/**
* @param {import('@vscode/debugprotocol').DebugProtocol.SetVariableResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.SetVariableArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.SetVariableResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.SetVariableArguments} args
*/
async setVariableRequest(response, args) {
@@ -1441,8 +1406,8 @@ class AndroidDebugSession extends DebugSession {
/**
* Called by VSCode to perform watch, console and hover evaluations
* @param {import('@vscode/debugprotocol').DebugProtocol.EvaluateResponse} response
* @param {import('@vscode/debugprotocol').DebugProtocol.EvaluateArguments} args
* @param {import('vscode-debugprotocol').DebugProtocol.EvaluateResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.EvaluateArguments} args
*/
async evaluateRequest(response, args) {
@@ -1511,7 +1476,7 @@ class AndroidDebugSession extends DebugSession {
class EvalQueueEntry {
/**
* @param {string} expression
* @param {import('@vscode/debugprotocol').DebugProtocol.EvaluateResponse} response
* @param {import('vscode-debugprotocol').DebugProtocol.EvaluateResponse} response
* @param {DebuggerValue[]} locals
* @param {VariableManager} var_manager
* @param {AndroidThread} thread

View File

@@ -1,10 +1,8 @@
const { ADBClient } = require('./adbclient');
const { PackageInfo } = require('./package-searcher');
//const { JavaType } = require('./util');
const { splitSourcePath } = require('./utils/source-file');
/**
* @typedef {import('./package-searcher').PackageInfo} PackageInfo
* @typedef {import('./adbclient').ADBClient} ADBClient
*/
class BuildInfo {
/**
* @param {Map<string,PackageInfo>} packages
@@ -715,8 +713,8 @@ class TypeNotAvailable extends DebuggerTypeInfo {
constructor(type) {
super(TypeNotAvailable.info, type);
this.fields = [];
this.methods = [];
super.fields = [];
super.methods = [];
}
}

View File

@@ -8,7 +8,9 @@ const { D } = require('./utils/print');
const { sleep } = require('./utils/thread');
const { decodeJavaStringLiteral } = require('./utils/char-decode');
const {
AttachBuildInfo,
BreakpointLocation,
BreakpointOptions,
DebuggerBreakpoint,
DebuggerFrameInfo,
DebuggerMethodInfo,
@@ -28,11 +30,6 @@ const {
TypeNotAvailable,
} = require('./debugger-types');
/**
* @typedef {import('./debugger-types').AttachBuildInfo} AttachBuildInfo
* @typedef {import('./debugger-types').BreakpointOptions} BreakpointOptions
*/
class Debugger extends EventEmitter {
constructor () {
@@ -55,14 +52,9 @@ class Debugger extends EventEmitter {
static portManager = {
portrange: { lowest: 31000, highest: 31099 },
fixedport: 0,
inuseports: new Set(),
debuggers: {},
reserveport: function () {
if (this.fixedport > 0 && this.fixedport < 65536) {
this.inuseports.add(this.fixedport);
return this.fixedport;
}
// choose a random port to use each time
for (let i = 0; i < 10000; i++) {
const portidx = this.portrange.lowest + ((Math.random() * 100) | 0);

View File

@@ -20,7 +20,7 @@ const { D } = require('../utils/print');
const { decodeJavaCharLiteral } = require('../utils/char-decode');
/**
* @param {Long} long
* @param {Long.Long} long
*/
function hex_long(long) {
return long.toUnsigned().toString(16).padStart(64/4, '0');
@@ -334,7 +334,7 @@ function evaluate_binary_long_expression(lhs, rhs, operator) {
return Long.fromString(`${local.value}`, false, radix);
}
/** @type {Long|boolean} */
/** @type {Long.Long|boolean} */
let a = longify(lhs), b = longify(rhs);
// dividend cannot be zero for / and %
@@ -362,7 +362,7 @@ function evaluate_binary_long_expression(lhs, rhs, operator) {
case '>=': a = a.gte(b); break;
default: throw invalid_operator(operator);
}
/** @type {boolean|Long|string} */
/** @type {boolean|Long.Long|string} */
let value = a, result_type = 'boolean';
if (typeof a !== 'boolean') {
value = hex_long(a);
@@ -875,7 +875,7 @@ function incompatible_cast(type, local) {
}
/**
* @param {Long} value
* @param {Long.Long} value
* @param {8|16|32} bits
*/
function signed_from_long(value, bits) {

View File

@@ -1,12 +1,11 @@
const { D, E } = require('./utils/print');
const {
DebuggerMethodInfo,
DebuggerTypeInfo,
JavaTaggedValue,
} = require('./debugger-types');
const { JavaType } = require('./debugger-types');
/**
* @typedef {import('./debugger-types').DebuggerMethodInfo} DebuggerMethodInfo
* @typedef {import('./debugger-types').DebuggerTypeInfo} DebuggerTypeInfo
* @typedef {import('./debugger-types').JavaTaggedValue} JavaTaggedValue
*/
/** the next command ID */
let gCommandId = 0;
@@ -100,26 +99,9 @@ class Reply {
return;
}
if (this.errorcode === 50945) {
// errorcode===50945 (0xC701) refers to a DDM chunk (set 199, cmd 1) for a
// previous command. It's unclear why these are being sent but it appears
// they're safe to ignore.
//
// see https://android.googlesource.com/platform/art/+/master/adbconnection/adbconnection.cc
this.decoded = {
empty: true,
errorcode: 0
}
return;
}
if (this.errorcode !== 0) {
// https://docs.oracle.com/javase/7/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_Error
if (this.command !== undefined) {
E(`JDWP command failed '${this.command.name}'. Error ${this.errorcode}`, this);
} else {
E(`Unknown JDWP command with id '${this.id}' failed. Error ${this.errorcode}`, this);
}
E(`JDWP command failed '${this.command.name}'. Error ${this.errorcode}`, this);
}
if (!this.errorcode && this.command && this.command.replydecodefn) {

View File

@@ -5,8 +5,7 @@
"checkJs": true,
"lib": [
"es2018"
],
"resolveJsonModule": true
]
},
"exclude": [
"node_modules"

View File

@@ -66,27 +66,24 @@ function parseManifest(xml) {
launcher: '',
}
const doc = new dom().parseFromString(xml);
const attributeValue = (/** @type {xpath.SelectedValue} */ selectedValue) => {
return xpath.isAttribute(selectedValue) ? selectedValue.value : '';
};
// extract the package name from the manifest
const pkg_xpath = '/manifest/@package';
result.package = attributeValue(xpath.select1(pkg_xpath, doc));
result.package = xpath.select1(pkg_xpath, doc).value;
const android_select = xpath.useNamespaces({"android": "http://schemas.android.com/apk/res/android"});
// extract a list of all the (named) activities declared in the manifest
const activity_xpath = '/manifest/application/activity/@android:name';
const activity_nodes = android_select(activity_xpath, doc);
if (Array.isArray(activity_nodes)) {
result.activities = activity_nodes.map(n => attributeValue(n));
if (activity_nodes) {
result.activities = activity_nodes.map(n => n.value);
}
// extract the default launcher activity
const launcher_xpath = '/manifest/application/activity[intent-filter/action[@android:name="android.intent.action.MAIN"] and intent-filter/category[@android:name="android.intent.category.LAUNCHER"]]/@android:name';
const launcher_nodes = android_select(launcher_xpath, doc);
// should we warn if there's more than one?
if (Array.isArray(launcher_nodes) && launcher_nodes.length >= 1) {
result.launcher = attributeValue(launcher_nodes[0]);
if (launcher_nodes && launcher_nodes.length >= 1) {
result.launcher = launcher_nodes[0].value
}
return result;

View File

@@ -7,17 +7,10 @@ const AndroidSocket = require('./androidsocket');
class ADBSocket extends AndroidSocket {
/**
* The host and port number to run ADB commands on, in 'host:port' format (host part is optional).
* The value can be overriden by the adbSocket (or the deprecated adbPort) value in each debug configuration.
*
* The default host value is left blank as this is the simplest way to
* specify "connect to the local machine" without explicitly specifying
* 'localhost' or '127.0.0.1' (which may be mapped to something else)
* The port number to run ADB on.
* The value can be overriden by the adbPort value in each configuration.
*/
static HostPort = `:5037`;
static get DefaultHostPort() {
return `:5037`
}
static ADBPort = 5037;
constructor() {
super('ADBSocket');
@@ -25,14 +18,13 @@ class ADBSocket extends AndroidSocket {
/**
* Reads and checks the reply from an ADB command
* @param {string} command
* @param {boolean} [throw_on_fail] true if the function should throw on non-OKAY status
*/
async read_adb_status(command, throw_on_fail = true) {
async read_adb_status(throw_on_fail = true) {
// read back the status
const status = await this.read_bytes(4, 'latin1')
if (status !== 'OKAY' && throw_on_fail) {
throw new Error(`ADB command '${command}' failed. Status: '${status}'`);
throw new Error(`ADB command failed. Status: '${status}'`);
}
return status;
}
@@ -65,7 +57,7 @@ class ADBSocket extends AndroidSocket {
*/
async cmd_and_status(command) {
await this.write_adb_command(command);
return this.read_adb_status(command);
return this.read_adb_status();
}
/**
@@ -112,7 +104,7 @@ class ADBSocket extends AndroidSocket {
await this.write_bytes(done_and_mtime);
// read the final status and any error message
const result = await this.read_adb_status('sync:', false);
const result = await this.read_adb_status(false);
const failmsg = await this.read_le_length_data('latin1');
// finish the transfer mode

View File

@@ -15,13 +15,12 @@ class AndroidSocket extends EventEmitter {
}
connect(port, hostname) {
const stackOnError = new Error().stack;
return new Promise((resolve, reject) => {
if (this.socket) {
return reject(new Error(`${this.which} Socket connect failed. Socket already connected. ${stackOnError}`));
return reject(new Error(`${this.which} Socket connect failed. Socket already connected.`));
}
const connection_error = err => {
return reject(new Error(`${this.which} Socket connect failed. ${err.message}. ${stackOnError}`));
return reject(new Error(`${this.which} Socket connect failed. ${err.message}.`));
}
const post_connection_error = err => {
this.socket_error = err;
@@ -46,8 +45,7 @@ class AndroidSocket extends EventEmitter {
resolve();
})
.on('error', err => error_handler(err));
// for some reason if hostname is left blank, it will sometimes return ECONNREFUSED
this.socket.connect(port, hostname || '127.0.0.1');
this.socket.connect(port, hostname);
});
}
@@ -70,21 +68,18 @@ class AndroidSocket extends EventEmitter {
*/
async read_bytes(length, format, timeout_ms) {
//D(`reading ${length} bytes`);
let actual_length = undefined;
if (typeof length === 'undefined') {
let actual_length = length;
if (typeof actual_length === 'undefined') {
if (this.readbuffer.byteLength > 0 || this.socket_ended) {
actual_length = this.readbuffer.byteLength;
}
}
if (length === 'length+data' && this.readbuffer.byteLength >= 4) {
length = actual_length = this.readbuffer.readUInt32BE(0);
}
if (typeof length === 'number') {
actual_length = length;
}
if (actual_length < 0) {
throw new Error(`${this.which} socket read failed. Attempt to read ${actual_length} bytes.`);
}
if (length === 'length+data' && this.readbuffer.byteLength >= 4) {
length = actual_length = this.readbuffer.readUInt32BE(0);
}
if (this.socket_ended) {
if (actual_length <= 0 || (this.readbuffer.byteLength < actual_length)) {
this.check_socket_active('read');
@@ -93,10 +88,12 @@ class AndroidSocket extends EventEmitter {
// do we have enough data in the buffer?
if (this.readbuffer.byteLength >= actual_length) {
//D(`got ${actual_length} bytes`);
const data = this.readbuffer.slice(0, actual_length);
let data = this.readbuffer.slice(0, actual_length);
this.readbuffer = this.readbuffer.slice(actual_length);
const result = format ? data.toString(format) : data;
return Promise.resolve(result);
if (format) {
data = data.toString(format);
}
return Promise.resolve(data);
}
// wait for the socket to update and then retry the read
await this.wait_for_socket_data(timeout_ms);

View File

@@ -1,13 +1,9 @@
const { DebuggerValue, JavaType, LiteralValue, VariableValue } = require('./debugger-types');
const { Debugger } = require('./debugger');
const { DebuggerFrameInfo, DebuggerValue, JavaType, LiteralValue, VariableValue } = require('./debugger-types');
const { assignVariable } = require('./expression/assign');
const { NumberBaseConverter } = require('./utils/nbc');
const { VariableManager } = require('./variable-manager');
/**
* @typedef {import('./debugger').Debugger} Debugger
* @typedef {import('./debugger-types').DebuggerFrameInfo} DebuggerFrameInfo
*/
/**
* @param {DebuggerValue[]} variables
* @param {boolean} thisFirst

11
src/state.js Normal file
View File

@@ -0,0 +1,11 @@
const vscode = require('vscode');
const fs = require('fs');
const path = require('path');
const os = require('os');
var adext = {};
try {
Object.assign(adext, JSON.parse(fs.readFileSync(path.join(path.dirname(__dirname),'package.json'),'utf8')));
} catch (ex) { }
exports.adext = adext;

View File

@@ -1,13 +1,8 @@
const { Debugger } = require('./debugger');
const { DebuggerException, DebuggerFrameInfo, SourceLocation } = require('./debugger-types');
const { DebuggerStackFrame } = require('./stack-frame');
const { VariableManager } = require('./variable-manager');
/**
* @typedef {import('./debugger').Debugger} Debugger
* @typedef {import('./debugger-types').DebuggerException} DebuggerException
* @typedef {import('./debugger-types').DebuggerFrameInfo} DebuggerFrameInfo
* @typedef {import('./debugger-types').SourceLocation} SourceLocation
*/
// vscode doesn't like thread id reuse (the Android runtime is OK with it)
let nextVSCodeThreadId = 0;

View File

@@ -1,7 +1,8 @@
const fs = require('fs');
const path = require('path');
const { ADBClient, getADBSocketParams } = require('../adbclient');
const { ADBClient } = require('../adbclient');
const ADBSocket = require('../sockets/adbsocket');
const { LOG } = require('../utils/print');
function getAndroidSDKFolder() {
@@ -40,21 +41,19 @@ function getADBPathName() {
return path.join(android_sdk, 'platform-tools', /^win/.test(process.platform)?'adb.exe':'adb');
}
function startADBServer() {
/**
* @param {number} port
*/
function startADBServer(port) {
if (typeof port !== 'number' || port <= 0 || port >= 65536) {
return false;
}
const adb_exe_path = getADBPathName();
if (!adb_exe_path) {
return false;
}
const adb_socket = getADBSocketParams();
// don't try and start ADB if the server is on a remote host
if (!/^(localhost|127\.\d+\.\d+\.\d+)?$/.test(adb_socket.host)) {
LOG(`Cannot launch adb server on remote host ${adb_socket.host}:${adb_socket.port}`);
return;
}
const adb_start_server_args = ['-P',`${adb_socket.port}`,'start-server'];
if (adb_socket.host) {
adb_start_server_args.unshift(`-H`, adb_socket.host);
}
const adb_start_server_args = ['-P',`${port}`,'start-server'];
try {
LOG([adb_exe_path, ...adb_start_server_args].join(' '));
const stdout = require('child_process').execFileSync(adb_exe_path, adb_start_server_args, {
@@ -74,7 +73,7 @@ async function checkADBStarted(auto_start) {
const err = await new ADBClient().test_adb_connection();
// if adb is not running, see if we can start it ourselves using ANDROID_HOME (and a sensible port number)
if (err && auto_start) {
return startADBServer();
return startADBServer(ADBSocket.ADBPort);
}
return !err;
}

View File

@@ -1,10 +1,6 @@
const { JavaType, VariableValue } = require('./debugger-types');
const { DebuggerValue, JavaType, VariableValue } = require('./debugger-types');
const { NumberBaseConverter } = require('./utils/nbc');
/**
* @typedef {import('./debugger-types').DebuggerValue} DebuggerValue
*/
/**
* Class to manage variable references used by VS code.
*