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

Examples of com.google.collide.client.code.autocomplete.AutocompleteProposals.Context


    helper.setup(path, "get", 0, 3, false);
    autocompleter.findAutocompletions(helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposal functionProposal = new CodeGraphProposal("getFoo",
        path, true);
    AutocompleteResult commonResult = autocompleter.computeAutocompletionResult(
        new ProposalWithContext(SyntaxType.NONE, functionProposal, new Context("get")));
    assertTrue("result type", commonResult instanceof DefaultAutocompleteResult);
    DefaultAutocompleteResult result = (DefaultAutocompleteResult) commonResult;
    assertEquals("jump length", 7, result.getJumpLength());
    assertEquals("autocompletion text", "getFoo()", result.getAutocompletionText());
  }
View Full Code Here


    helper.setup(path, "g", 0, 1, false);
    autocompleter.findAutocompletions(helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposal propertyProposal = new CodeGraphProposal("gender",
        path, false);
    AutocompleteResult commonResult = autocompleter.computeAutocompletionResult(
        new ProposalWithContext(SyntaxType.NONE, propertyProposal, new Context("get")));
    assertTrue("result type", commonResult instanceof DefaultAutocompleteResult);
    DefaultAutocompleteResult result = (DefaultAutocompleteResult) commonResult;
    assertEquals("jump length", 6, result.getJumpLength());
    assertEquals("autocompletion text", "gender", result.getAutocompletionText());
  }
View Full Code Here

  public void testTemplateProcessing() {
    helper.setup(path, "", 0, 0, false);
    autocompleter.findAutocompletions(helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposal proposal = new TemplateProposal("simple", "simple (%c) <%i%n>");
    AutocompleteResult commonResult = autocompleter.computeAutocompletionResult(
        new ProposalWithContext(SyntaxType.NONE, proposal, new Context("")));
    assertTrue("result type", commonResult instanceof DefaultAutocompleteResult);
    DefaultAutocompleteResult result = (DefaultAutocompleteResult) commonResult;
    assertEquals("autocompletion text", "simple () <\n  \n>", result.getAutocompletionText());
    assertEquals("jump length", 8, result.getJumpLength());
    assertEquals("backspace count", 0, result.getBackspaceCount());
View Full Code Here

    String triggeringString = context.getTriggeringString();
    JsonArray<AutocompleteProposal> items = doGetProposals(
        context, selection.getCursorPosition(), scopeTrieBuilder);
    return new AutocompleteProposals(
        mode, new Context(triggeringString, context.getIndent()), items, HINT);
  }
View Full Code Here

TOP

Related Classes of com.google.collide.client.code.autocomplete.AutocompleteProposals.Context

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.