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

Examples of com.google.collide.client.code.autocomplete.SignalEventEssence


  public void testExplicit() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();
    setupHelper(helper, "<html><body><");
    AutocompleteResult commonResult = helper.autocompleter.htmlAutocompleter
        .getExplicitAction(helper.editor.getSelection(), new SignalEventEssence('/'), false)
        .getExplicitAutocompletion();
    assertTrue("result type", commonResult instanceof DefaultAutocompleteResult);
    DefaultAutocompleteResult result = (DefaultAutocompleteResult) commonResult;
    assertEquals("/body>", result.getAutocompletionText());
  }
View Full Code Here


    JsonArray<Token> tokens = helper.parser.parseLineSync(line);
    assertEquals("html", tokens.get(0).getMode());
    assertEquals("css", tokens.get(tokens.size() - 1).getMode());
    helper.autocompleter.htmlAutocompleter.updateModeAnchors(line, tokens);

    SignalEventEssence trigger = new SignalEventEssence('{');
    AutocompleteResult result = helper.autocompleter.htmlAutocompleter
        .getExplicitAction(helper.editor.getSelection(), trigger, false)
        .getExplicitAutocompletion();
    assertTrue("result type", result instanceof DefaultAutocompleteResult);
    DefaultAutocompleteResult defaultResult = (DefaultAutocompleteResult) result;
View Full Code Here

    TaggableLine previousLine = TaggableLineUtil.getPreviousLine(line);
    helper.autocompleter.htmlAutocompleter.updateModeAnchors(line, tokens);
    new ParsingTask(helper.autocompleter.localPrefixIndexStorage).onParseLine(
        previousLine, line, tokens);

    SignalEventEssence trigger = new SignalEventEssence('[');
    AutocompleteResult result = helper.autocompleter.htmlAutocompleter
        .getExplicitAction(helper.editor.getSelection(), trigger, false)
        .getExplicitAutocompletion();
    assertTrue("result type", result instanceof DefaultAutocompleteResult);
    DefaultAutocompleteResult defaultResult = (DefaultAutocompleteResult) result;
    assertEquals("[]", defaultResult.getAutocompletionText());

    trigger = new SignalEventEssence('(');
    result = helper.autocompleter.htmlAutocompleter
        .getExplicitAction(helper.editor.getSelection(), trigger, false)
        .getExplicitAutocompletion();
    assertTrue("result type", result instanceof DefaultAutocompleteResult);
    defaultResult = (DefaultAutocompleteResult) result;
View Full Code Here

    final MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <body>\n  <script>\n\n  </script>\n </body>\n</html>", 3, 0, true);
    ExplicitActionType action = helper.autocompleter.htmlAutocompleter.getExplicitAction(
        helper.editor.getSelection(), new SignalEventEssence(' '), false).getType();
    assertTrue("no popup before mode is determined", action == ExplicitActionType.DEFAULT);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
    helper.parseScheduler.requests.pop().run(10);

    action = helper.autocompleter.htmlAutocompleter.getExplicitAction(
        helper.editor.getSelection(), new SignalEventEssence(' '), false).getType();
    assertTrue("no popup in JS mode", action == ExplicitActionType.DEFAULT);
  }
View Full Code Here

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
    helper.parseScheduler.requests.pop().run(10);

    SignalEventEssence signalGt = new SignalEventEssence(
        '>', false, false, true, false, KeySignalType.INPUT);
    ExplicitActionType action = helper.autocompleter.htmlAutocompleter.getExplicitAction(
        helper.editor.getSelection(), signalGt, false).getType();
    assertTrue("no popup after closing tag", action == ExplicitActionType.DEFAULT);
  }
View Full Code Here

        helper.autocompleter, helper.editor));
    helper.parser.begin();
    helper.parseScheduler.requests.pop().run(10);

    ExplicitAction action = helper.autocompleter.htmlAutocompleter
        .getExplicitAction(helper.editor.getSelection(), new SignalEventEssence(' '), false);
    assertFalse(action.getType() == ExplicitActionType.DEFERRED_COMPLETE);
  }
View Full Code Here

TOP

Related Classes of com.google.collide.client.code.autocomplete.SignalEventEssence

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.