MCPcopy Index your code
hub / github.com/processing/processing / referenceCheck

Method referenceCheck

app/src/processing/app/ui/Editor.java:2292–2322  ·  view source on GitHub ↗

Check the current selection for reference. If no selection is active, expand the current selection. @return

(boolean selectIfFound)

Source from the content-addressed store, hash-verified

2290 * @return
2291 */
2292 protected String referenceCheck(boolean selectIfFound) {
2293 int start = textarea.getSelectionStart();
2294 int stop = textarea.getSelectionStop();
2295 if (stop < start) {
2296 int temp = stop;
2297 stop = start;
2298 start = temp;
2299 }
2300 char[] c = textarea.getText().toCharArray();
2301
2302// System.out.println("checking reference");
2303 if (start == stop) {
2304 while (start > 0 && functionable(c[start - 1])) {
2305 start--;
2306 }
2307 while (stop < c.length && functionable(c[stop])) {
2308 stop++;
2309 }
2310// System.out.println("start is stop");
2311 }
2312 String text = new String(c, start, stop - start).trim();
2313// System.out.println(" reference piece is '" + text + "'");
2314 if (checkParen(c, stop, c.length)) {
2315 text += "_";
2316 }
2317 String ref = mode.lookupReference(text);
2318 if (selectIfFound) {
2319 textarea.select(start, stop);
2320 }
2321 return ref;
2322 }
2323
2324
2325 protected void handleFindReference() {

Callers 2

handleFindReferenceMethod · 0.95
showMethod · 0.80

Calls 8

functionableMethod · 0.95
checkParenMethod · 0.95
lookupReferenceMethod · 0.80
selectMethod · 0.80
getSelectionStartMethod · 0.45
getSelectionStopMethod · 0.45
getTextMethod · 0.45
trimMethod · 0.45

Tested by

no test coverage detected