1306 |
1306 |
1307 public List<Suggestion> commandCompletionSuggestions(String code, int cursor, int[] anchor) { |
1307 public List<Suggestion> commandCompletionSuggestions(String code, int cursor, int[] anchor) { |
1308 return commandCompletions.completionSuggestions(code, cursor, anchor); |
1308 return commandCompletions.completionSuggestions(code, cursor, anchor); |
1309 } |
1309 } |
1310 |
1310 |
1311 public String commandDocumentation(String code, int cursor) { |
1311 public String commandDocumentation(String code, int cursor, boolean shortDescription) { |
1312 code = code.substring(0, cursor); |
1312 code = code.substring(0, cursor); |
1313 int space = code.indexOf(' '); |
1313 int space = code.indexOf(' '); |
1314 |
1314 |
1315 if (space != (-1)) { |
1315 if (space != (-1)) { |
1316 String cmd = code.substring(0, space); |
1316 String cmd = code.substring(0, space); |
1317 Command command = commands.get(cmd); |
1317 Command command = commands.get(cmd); |
1318 if (command != null) { |
1318 if (command != null) { |
1319 return getResourceString(command.helpKey + ".summary"); |
1319 return getResourceString(command.helpKey + (shortDescription ? ".summary" : "")); |
1320 } |
1320 } |
1321 } |
1321 } |
1322 |
1322 |
1323 return null; |
1323 return null; |
1324 } |
1324 } |