@@ -150,7 +150,7 @@ public void testCommandExecution() throws CoreException, InterruptedException, E
150150 final var lsCompletionProposal = (LSCompletionProposal ) proposals [0 ];
151151 lsCompletionProposal .apply (viewer , '\n' , 0 , 0 );
152152
153- // Assert command was invoked on langauge server
153+ // Assert command was invoked on language server
154154 ExecuteCommandParams executedCommand = MockLanguageServer .INSTANCE .getWorkspaceService ().getExecutedCommand ().get (2 , TimeUnit .SECONDS );
155155
156156 assertEquals (MockLanguageServer .SUPPORTED_COMMAND_ID , executedCommand .getCommand ());
@@ -174,6 +174,40 @@ public void testPrefixCaseSensitivity() throws CoreException {
174174 lsCompletionProposal .apply (viewer , '\n' , 0 , 0 );
175175 assertEquals (new Point ("FirstClass" .length (), 0 ), lsCompletionProposal .getSelection (viewer .getDocument ()));
176176 }
177+
178+ @ Test
179+ public void testPrefixCaseSensitivityWithoutTextEdit () throws CoreException {
180+ final var items = new ArrayList <CompletionItem >();
181+ items .add (createCompletionItemWithoutTextEdit ("FirstClass" , CompletionItemKind .Class ));
182+ MockLanguageServer .INSTANCE .setCompletionList (new CompletionList (false , items ));
183+
184+ final var content = "FIRST" ;
185+ ITextViewer viewer = TestUtils .openTextViewer (TestUtils .createUniqueTestFile (project , content ));
186+
187+ ICompletionProposal [] proposals = contentAssistProcessor .computeCompletionProposals (viewer , content .length ());
188+ assertEquals (1 , proposals .length );
189+ final var lsCompletionProposal = (LSCompletionProposal ) proposals [0 ];
190+ lsCompletionProposal .apply (viewer , '\n' , 0 , 0 );
191+ assertEquals (new Point ("FirstClass" .length (), 0 ), lsCompletionProposal .getSelection (viewer .getDocument ()));
192+ assertEquals ("FirstClass" , viewer .getDocument ().get ());
193+ }
194+
195+ @ Test
196+ public void testPrefixCaseSensitivityWithoutTextEditAtOffset () throws CoreException {
197+ final var items = new ArrayList <CompletionItem >();
198+ items .add (createCompletionItemWithoutTextEdit ("FirstClass" , CompletionItemKind .Class ));
199+ MockLanguageServer .INSTANCE .setCompletionList (new CompletionList (false , items ));
200+
201+ final var content = "FIRST" ;
202+ ITextViewer viewer = TestUtils .openTextViewer (TestUtils .createUniqueTestFile (project , content ));
203+
204+ ICompletionProposal [] proposals = contentAssistProcessor .computeCompletionProposals (viewer , content .length ());
205+ assertEquals (1 , proposals .length );
206+ final var lsCompletionProposal = (LSCompletionProposal ) proposals [0 ];
207+ lsCompletionProposal .apply (viewer , '\n' , 0 , 4 );
208+ assertEquals (new Point ("FirstClass" .length (), 0 ), lsCompletionProposal .getSelection (viewer .getDocument ()));
209+ assertEquals ("FirstClass" , viewer .getDocument ().get ());
210+ }
177211
178212 @ Test
179213 public void testCompleteOnFileEnd () throws CoreException { // bug 508842
0 commit comments