Examples of PathUtil


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

    CodeGraphImpl codeGraph = CodeGraphImpl.make();
    codeGraph.setCodeBlockMap(files);

    CodeGraphPrefixIndex prefixIndex = new CodeGraphPrefixIndex(
        codeGraph, SyntaxType.PY, new PathUtil("/file1.py"));
    assertEquals(JsonCollections.createStringSet("foo1", "foo2", "foo3"),
        TestUtils.createNameSet(prefixIndex.search("f")));
  }
View Full Code Here

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

  }

  public void testPopupDoNotAnnoyUsers() {
    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);
View Full Code Here

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

  }

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

    helper.setup(new PathUtil("foo.html"), "<html>\n <script\n<body style=''>\n", 2, 8, true);

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

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

   * content "inside-out".
   */
  public void testScriptTagDoNotConfuseXmlProcessing() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <script></script>\n <body>\n", 2, 7, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
View Full Code Here

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

   * when user press space just after "&gt;".
   */
  public void testNoJsPopupOnAfterSpace() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <script>\n", 1, 9, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
View Full Code Here

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

   * <p>Previously we got NPE in this case.
   */
  public void testNoProposalsOnGrayLine() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <body>\n  <di", 2, 5, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
View Full Code Here

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

    assertEquals("variable set", createStringSet("aaa", "bbb"), createNameSet(proposals));
  }

  private MockAutocompleterEnvironment configureHelper(String text) {
    final MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();
    helper.setup(new PathUtil("foo.js"), text, 0, 0, true);
    analyzer = new ParsingTask(helper.autocompleter.localPrefixIndexStorage);
    JsonArray<IncrementalScheduler.Task> parseRequests = helper.parseScheduler.requests;

    assertEquals("parsing not scheduled initially", 0, parseRequests.size());
View Full Code Here

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

  }

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

    helper.setup(new PathUtil("foo.js"), "WhI", 0, 3, true);
    AutocompleteProposals proposals = helper.autocompleter.jsAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
        proposals, "while");
    assertNotNull(proposal);
View Full Code Here

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

    String text = "function foo() {\n"
        + "  var barBeQue;\n"
        + "  BArbE\n" // Cursor here.
        + "}";

    helper.setup(new PathUtil("foo.js"), text, 2, 7, true);
    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals proposals = helper.autocompleter.jsAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
View Full Code Here

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

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

    String prefix = "td {bORDEr: black; ";
    helper.setup(new PathUtil("foo.css"), prefix + "boR", 0, prefix.length() + 3, true);
    AutocompleteProposals proposals = helper.autocompleter.cssAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    assertNull(TestUtils.selectProposalByName(proposals, "border"));

    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
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.