Examples of PathUtil


Examples of com.google.collide.client.util.PathUtil

    String text = "function foo() {\n"
        + "  var bar1 = /regexp/;\n"
        + "  var bar2;\n"
        + "  " // Cursor here.
        + "}";
    helper.setup(new PathUtil("foo.js"), text, 3, 2, true);
    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals autocompletions =
        helper.autocompleter.jsAutocompleter.findAutocompletions(
            helper.editor.getSelection(), CTRL_SPACE);
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  public void testDeleteAtBeginningOfDocument() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    String text = "<cursorAtTheBeginingOfFirstLine>";
    helper.setup(new PathUtil("foo.js"), text, 0, 0, true);
    ExplicitAction action = helper.autocompleter.jsAutocompleter.getExplicitAction(
        helper.editor.getSelection(), DELETE_KEY, false);
    assertEquals(LanguageSpecificAutocompleter.ExplicitActionType.DEFAULT, action.getType());
  }
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  public void testClosePopupOnSpace() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    // TODO: vars in the global scope are not registered by CM.
    String text = "function a() { var abba, apple, arrow; a";
    helper.setup(new PathUtil("foo.js"), text, 0, text.length(), true);
    final MockAutocompleter autocompleter = helper.autocompleter;

    assertFalse("initially popup is not shown", helper.popup.isShowing());

    final JsonArray<Scheduler.ScheduledCommand> scheduled = JsonCollections.createArray();
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

      SignalEventEssence trigger, @Nullable DefaultAutocompleteResult expected) {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    Document document = Document.createFromString(text);
    int column = LineUtils.getLastCursorColumn(document.getFirstLine()) - tailOffset;
    helper.setup(new PathUtil("foo.js"), document, 0, column, true);

    ExplicitAction action = helper.autocompleter.jsAutocompleter.getExplicitAction(
        helper.editor.getSelection(), trigger, false);
    AutocompleteResult commonResult = action.getExplicitAutocompletion();
    if (expected == null) {
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

   * perform specific textual changes.
   */
  public void testDoNotPreventCtrlBs() {
    String text = "#!@abc   ";
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();
    helper.setup(new PathUtil("test.js"), text, 0, text.length(), true);

    final Editor editor = helper.editor;

    final JsonArray<Scheduler.ScheduledCommand> scheduled = JsonCollections.createArray();

View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  }

  @Override
  public void gwtSetUp() throws Exception {
    super.gwtSetUp();
    path = new PathUtil("/test.none");
    helper = new MockAutocompleterEnvironment();

    SkipListStringBag localPrefixIndexStorage = new SkipListStringBag();
    LimitedContextFilePrefixIndex contextFilePrefixIndex = new LimitedContextFilePrefixIndex(
        10, localPrefixIndexStorage);
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  private PathUtil path;

  @Override
  public void gwtSetUp() throws Exception {
    super.gwtSetUp();
    path = new PathUtil("/foo.js");
  }
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

    codeBlockMap.put(file2.getName(), file2);
    builder.setCodeGraph(CodeGraphImpl.make().setCodeBlockMap(codeBlockMap));

    JsonArray<AutocompleteProposal> proposals = checkProposals(
        builder, new String[] {"foobar", "foobaz"}, "foo", false);
    assertEquals(new PathUtil("/file1.js"),
        TestUtils.findProposalByName(proposals, "foobar").getPath());
    assertEquals(new PathUtil("/file2.js"),
        TestUtils.findProposalByName(proposals, "foobaz").getPath());

    checkProposals(builder, new String[] {"barbaz", "barfoo", "foobar", "foobaz"}, "", false);

    // Check this proposals do not receive top-level items.
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

    final Editor editor = Editor.create(new MockAppContext());
    editor.setDocument(document);

    editor.getInput().getActionExecutor().addDelegate(TextActions.INSTANCE);

    PathUtil path = new PathUtil("test.css");
    DocumentParser documentParser = createDocumentParser(path);
    Autoindenter autoindenter = Autoindenter.create(documentParser, editor);

    LineFinder lineFinder = editor.getDocument().getLineFinder();
    editor.getSelection().setSelection(
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

    files.put(file2.getId(), file2);
    CodeGraphImpl codeGraph = CodeGraphImpl.make();
    codeGraph.setCodeBlockMap(files);

    CodeGraphPrefixIndex prefixIndex = new CodeGraphPrefixIndex(
        codeGraph, SyntaxType.PY, new PathUtil("/file1.py"));
    assertEquals(JsonCollections.createStringSet("foo1"),
        TestUtils.createNameSet(prefixIndex.search("f")));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.