Skip to content

Commit 0c3f3d7

Browse files
committed
small snippet fix
1 parent 6917323 commit 0c3f3d7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ NOTE:
5050

5151
At first, compile all your classes using your favorite build tool, and start your app. While editing java source files, lint and compile changed classes automatically with [linter-javac](https://atom.io/packages/linter-javac), and the autocomplete-java package will refresh changed classes automatically on save. You can also reload changed classes automatically in JVM with [spring-loaded](https://github.com/spring-projects/spring-loaded) or some other JVM agent. This way you can develop your app while the app is running.
5252

53+
NOTE: Current version of linter-javac performs bad in case of slow hard drive and large amount of classes to be linted. If you experience freezing during file save, consider disabling linter-javac, at least for now.
54+
5355
NOTE: Error in one class may prevent compilation of multiple classes. Therefore once you fix an error, multiple classes might be recompiled at once. So sometimes you might have to run 'project refresh' manually after you fix an error (ctrl-alt-shift-R). See issue [#19](https://github.com/keskiju/autocomplete-java/issues/19).
5456

5557
## Contribute

lib/AtomAutocompleteProvider.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,17 @@ export class AtomAutocompleteProvider {
111111
_createMemberSnippet(member) {
112112
let snippet = null;
113113
if (!member.params) {
114-
snippet = member.name;
114+
snippet = (member.type === 'prototype')
115+
? member.name : member.name + '()';
115116
} else {
116-
const params = _.map(member.params, (param, index) => {
117-
return '${' + (index + 2) + ':' + javaUtil.getSimpleName(param) + '}';
117+
let index = 2;
118+
const params = _.map(member.params, (param) => {
119+
return '${' + (index++) + ':' + javaUtil.getSimpleName(param) + '}';
118120
});
119121
snippet = _.reduce(params, (result, param) => {
120122
return result + param + ', ';
121123
}, member.name + '(').replace(/, $/, ')');
124+
snippet = snippet + '${' + index + ':}';
122125
}
123126
return snippet;
124127
}

lib/JavaClassLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class JavaClassLoader {
192192
name: name,
193193
returnType: type !== 'constructor' ?
194194
prototype.match(/^([^\s]*)\s/)[1] : classDesc.className,
195-
params: type !== 'property' ? paramStr.split(',') : null,
195+
params: paramStr ? paramStr.split(',') : null,
196196
prototype: prototype,
197197
},
198198
};

0 commit comments

Comments
 (0)