public void Second_argument_empty_Then_suggests_subrutines() { string file = @" sub test1() UO.Print('param1', end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 23); completions.ShouldContainLabel("test1"); }
public void Second_paramter_empty_Then_suggests_native_subrutines_without_namespace() { string file = @" sub test1() UO.Print('param1', end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 23); completions.ShouldContainLabel("wait", "str", "val"); }
public void Statement_call_with_UO_prefix_Then_no_statement_keywords() { string file = @" sub test1() UO. end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 8); completions.ShouldNotContainLabel("if", "repeat"); }
public void Argument_UO_namespace_Then_suggests_UO_subrutines() { string file = @" sub test1() UO.Print(UO. end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 17); completions.ShouldContainLabel("attack"); }
public void Empty_statement_line_Then_suggests_no_native_subrutines_in_UO_namespace() { string file = @" sub test1() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 5); completions.ShouldNotContainLabel("attack", "ignore"); }
public void Argument_statement_call_with_UO_prefix_after_dot() { string file = @" sub test1() UO.Print(UO. end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 17); completions.ShouldContainLabel("ignore", "attack"); }
public void Global_native_subrutine_prefix_Then_suggests_global_native_subrutine() { string file = @" sub test1() wa end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 7); completions.ShouldContainLabel("wait"); }
public void Statement_call_with_UO_prefix_without_dot_Then_no_subrutines_in_UO_namespace() { string file = @" sub test1() UO end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 7); completions.ShouldNotContainLabel("ignore", "attack"); }
public void Second_argument_empty_Then_suggests_no_native_subrutines_in_UO_namespace() { string file = @" sub test1() UO.Print('param1', end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 23); completions.ShouldNotContainLabel("attack", "ignore"); }
public void Second_argument_global_native_subrutine_prefix_Then_suggests_global_native_subrutine() { string file = @" sub test1() UO.Print('param1',s end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 24); completions.ShouldContainLabel("str"); }
public void Argument_empty_operand_Then_suggests_arguments() { string file = @" sub test1(myParam, yourParam) UO.Print('x' + ) end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 20); completions.ShouldContainLabel("myParam", "yourParam"); }
public void UO_prefix_Then_suggests_UO_namespace() { string file = @" sub test1() U end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 6); completions.ShouldContainLabel("UO"); }
public void Empty_statement_line_Then_suggests_subrutines() { string file = @" sub test1() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 5); completions.ShouldContainLabel("test1"); }
public void Second_argument_UO_prefix_Then_suggests_UO_namespace() { string file = @" sub test1() UO.Print('param1',U end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 24); completions.ShouldContainLabel("UO"); }
public void Empty_statement_line_Then_suggests_native_subrutines_without_namespace() { string file = @" sub test1() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 5); completions.ShouldContainLabel("wait", "str", "val"); }
public void Empty_statement_line_Then_suggests_flow_statement_keywords() { string file = @" sub test1() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 5); completions.ShouldContainLabel("if", "else", "end if", "repeat", "until", "while", "wend", "for", "next", "return", "goto", "var", "dim"); }
public void Second_argument_statement_keyword_prefix_Then_suggests_flow_statement_keywords() { string file = @" sub test1() UO.Print('param1',el end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 25); completions.ShouldNotContainLabel("if", "else", "end if", "repeat", "until", "while", "wend", "for", "next", "return", "goto", "var", "dim"); }
public void Assignment_empty_operand_Then_suggests_arguments() { string file = @" sub test1(myParam, yourParam) var x = 123 + my end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 22); completions.ShouldContainLabel("myParam"); completions.ShouldNotContainLabel("yourParam"); }
public void Assignment_empty_operand_Then_suggests_subrutines_without_namespace() { string file = @" sub test1() var x = 123 + end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 19); completions.ShouldContainLabel("str"); completions.ShouldNotContainLabel("attack"); completions.ShouldNotContainLabel("if"); }
public void Argument_operand_with_UO_namespace_Then_suggests_UO_namespace_subrutines() { string file = @" sub test1() UO.Print('x' + UO.) end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 23); completions.ShouldNotContainLabel("str"); completions.ShouldContainLabel("attack"); completions.ShouldNotContainLabel("if"); }
public void First_argument_global_native_subrutine_prefix_Second_parameter_UO_prefix_Then_suggests_global_native_subrutine_for_first_parameter() { string file = @" sub test1() UO.Print(s,UO. end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 15); completions.ShouldContainLabel("str"); completions.ShouldNotContainLabel("attack"); completions.ShouldNotContainLabel("if"); }
public Task <CompletionList> Handle(CompletionParams request, CancellationToken cancellationToken) { if (!injectionWorkspace.TryGetDocument(request.TextDocument.Uri, out var fileContent)) { return(Task.FromResult(new CompletionList())); } var completer = new Completer(); var completions = completer.GetCompletions(fileContent, (int)request.Position.Line + 1, (int)request.Position.Character + 1); return(Task.FromResult(completions)); }
public void Subrutine_prefix_Then_suggests_subrutine_names() { string file = @" sub test1() te end sub sub test_subrutine() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 7); completions.ShouldContainLabel("test1", "test_subrutine"); }
public void Second_argument_subrutine_prefix_Then_suggests_subrutine_names() { string file = @" sub test1() UO.Print('param1',te end sub sub test_subrutine() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 25); completions.ShouldContainLabel("test1", "test_subrutine"); }
public void Outside_subrutine_Then_suggests_sub() { string file = @" sub test1() end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 2, 1); completions.ShouldNotContainLabel("str"); completions.ShouldNotContainLabel("attack"); completions.ShouldNotContainLabel("if"); completions.ShouldContainLabel("sub", "end sub"); }
public void Argument_list_empty_and_closed_Then_suggests_everything_except_flow_statement_keywords() { string file = @" sub test() UO.Print() end sub "; var completer = new Completer(); var completions = completer.GetCompletions(file, 3, 13); completions.ShouldContainLabel("test"); completions.ShouldContainLabel("UO"); completions.ShouldContainLabel("str"); completions.ShouldNotContainLabel("if", "else", "end if", "repeat", "until", "while", "wend", "for", "next", "return", "goto", "var", "dim"); }
public void Argument_empty_operand_Then_suggests_variables() { string file = @" sub test1() var myVariableBefore dim myDimBefore = 123 UO.Print('x' + ) var myVariableAfter dim myDimAfter = 123 end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 6, 20); completions.ShouldContainLabel("myVariableBefore", "myDimBefore"); completions.ShouldNotContainLabel("myVariableAfter", "myDimAfter"); }
public void Assignment_empty_operand_Then_suggests_variables_defined_before_assignment() { string file = @" sub test1() var myVariableBefore dim myDimBefore var x = 123 + my var myVariableAfter dim myDimAfter end sub"; var completer = new Completer(); var completions = completer.GetCompletions(file, 6, 21); completions.ShouldContainLabel("myVariableBefore", "myDimBefore"); completions.ShouldNotContainLabel("myVariableAfter", "myDimAfter"); }