Package com.google.collide.client.util

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


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

    String prefix = "<html iD='' ";
    helper.setup(new PathUtil("foo.html"), prefix + "I", 0, prefix.length() + 1, true);
    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals proposals = helper.autocompleter.htmlAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    assertNull(TestUtils.selectProposalByName(proposals, "id"));
View Full Code Here


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

    String prefix = "<html iD='' \n";
    helper.setup(new PathUtil("foo.html"), prefix + "I", 1, 1, true);
    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals proposals = helper.autocompleter.htmlAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    assertNull(TestUtils.selectProposalByName(proposals, "id"));
View Full Code Here

  }

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

    helper.setup(new PathUtil("foo.html"), "<HT", 0, 3, true);
    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals proposals = helper.autocompleter.htmlAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
View Full Code Here

  private void checkExplicit(@Nullable String expected, String prefix) {
    SignalEventEssence trigger = new SignalEventEssence('{');

    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();
    helper.setup(new PathUtil("foo.css"), prefix, 0, prefix.length(), true);
    ExplicitAction action = helper.autocompleter.cssAutocompleter.getExplicitAction(
        helper.editor.getSelection(), trigger, false);
    AutocompleteResult commonResult = action.getExplicitAutocompletion();
    if (expected == null) {
      assertNull("result", commonResult);
View Full Code Here

    checkOutlineParser(text, tags);
  }

  private void checkOutlineParser(String text, JsonStringSet expectedNodes) {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();
    helper.setup(new PathUtil("foo.css"), text, 0, 0, true);

    ListenerManager<DocumentParser.Listener> registrar = ListenerManager.create();

    final JsonArray<OutlineNode> output = JsonCollections.createArray();
View Full Code Here

  public void testWorkflow() {
    final MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    // TODO: vars in the global scope are not registered by CM.
    String text = "td { cur";
    helper.setup(new PathUtil("foo.css"), text, 0, text.length(), true);
    final MockAutocompleterEnvironment.MockAutocompleter autocompleter = helper.autocompleter;

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

    Runnable ctrlSpaceClicker = new Runnable() {
View Full Code Here

        "cur\n",
        "color: black;\n",
        "fake: ;\n",
        "}\n"
    });
    helper.setup(new PathUtil("test.css"), text, 1, 3, false);
    SelectionModel selection = helper.editor.getSelection();

    AutocompleteProposals completions = cssAutocompleter.findAutocompletions(selection, CTRL_SPACE);
    assertEquals(1, completions.size());
    AutocompleteResult commonResult = cssAutocompleter.computeAutocompletionResult(
View Full Code Here

  public void testAttributeValueFullAutocompletion() {
    String text = Joiner.on("").join(new String[]{
        ".something {\n",
        "azimuth: \n",
    });
    helper.setup(new PathUtil("/some.css"), text, 1, 9, false);
    AutocompleteProposals completions = cssAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    assertEquals(14, completions.size());
    ProposalWithContext leftSideProposal = TestUtils.selectProposalByName(completions, "left-side");
    assertNotNull(leftSideProposal);
View Full Code Here

        + "class Bar:\n"
        // Also test that different indention scheme works well.
        + " \"Bar is a unit of pressure, roughly equal to the atmospheric pressure on Earth\"\n"
        + " def far(self):\n"
        + "  The kingdom of FAR FAR Away, Donkey? That's where we're going! FAR! FAR!... away.\n";
    helper.setup(new PathUtil("foo.py"), text, 0, 0, true);

    final PyIndexUpdater analyzer = new PyIndexUpdater();

    helper.parser.getListenerRegistrar().add(new DocumentParser.Listener() {
      private boolean asyncParsing;
View Full Code Here

    checkAutoindenter(text, 2, 0, 2, 0, trigger, expected, false);
  }

  private static void checkAutoindenter(String text, int line1, int column1, int line2, int column2,
      final SignalEvent trigger, String expected, boolean allowScheduling) {
    PathUtil path = new PathUtil("test.js");
    DocumentParser documentParser = createDocumentParser(path);
    Document document = Document.createFromString(text);
    Editor editor = Editor.create(new MockAppContext());
    editor.setDocument(document);
    checkAutoindenter(line1, column1, line2, column2, trigger, expected, allowScheduling,
View Full Code Here

TOP

Related Classes of com.google.collide.client.util.PathUtil

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.