Package com.google.collide.client.code.autocomplete.codegraph.py

Examples of com.google.collide.client.code.autocomplete.codegraph.py.PyCodeScope


    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(20);

    //# Comment
    Line line = helper.editor.getDocument().getFirstLine();
    PyCodeScope scope = line.getTag(PyIndexUpdater.TAG_SCOPE);
    assertNull(scope);

    //class Foo:
    line = line.getNextLine();
    scope = line.getTag(PyIndexUpdater.TAG_SCOPE);
    assertNotNull(scope);
    assertEquals(PyCodeScope.Type.CLASS, scope.getType());
    assertEquals("Foo", PyCodeScope.buildPrefix(scope).join("#"));
    PyCodeScope prevScope = scope;

    //  "Foo is very clever and open-minded"
    line = line.getNextLine();
    scope = line.getTag(PyIndexUpdater.TAG_SCOPE);
    assertTrue(scope == prevScope);
View Full Code Here


    if (!isThisContext) {
      result.add(context.getPreviousContext());
    }

    //PY specific.
    PyCodeScope pyScope = line.getTag(PyIndexUpdater.TAG_SCOPE);
    if (pyScope != null) {
      JsonArray<String> path = PyCodeScope.buildPrefix(pyScope);
      if (isThisContext && pyScope.getType() == PyCodeScope.Type.DEF && path.size() > 1) {
        addThisPrefixes(result, path);
      } else {
        addLexicalPrefixes(result, path, context.getPreviousContext());
      }
      return result;
View Full Code Here

TOP

Related Classes of com.google.collide.client.code.autocomplete.codegraph.py.PyCodeScope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.