|
48 | 48 | import org.scijava.code.lsp.jvm.ClassIndex; |
49 | 49 | import org.scijava.code.lsp.LanguageServerService; |
50 | 50 | import org.scijava.code.lsp.ScriptSession; |
51 | | -import org.scijava.code.lsp.RatedSignatureInformation; |
52 | 51 | import org.scijava.script.ScriptLanguage; |
53 | 52 | import org.scijava.script.ScriptService; |
54 | 53 |
|
@@ -227,17 +226,15 @@ public void testSignatureHelp() { |
227 | 226 | final SignatureHelp max = help("from java.lang import Math\n" + |
228 | 227 | "Math.max(1.5, "); |
229 | 228 | assertEquals(Integer.valueOf(1), max.getActiveParameter()); |
230 | | - assertEquals("[double:MATCH, float:MATCH, int:MISMATCH, long:MISMATCH]", |
231 | | - describe(max)); |
| 229 | + assertEquals("[double, float, int, long]", describe(max)); |
232 | 230 | // A Python int fits the integral ones, and converts to the others. |
233 | | - assertEquals("[int:MATCH, long:MATCH, double:CONVERSION, " + |
234 | | - "float:CONVERSION]", describe(help("from java.lang import Math\n" + |
235 | | - "Math.max(1, 2"))); |
| 231 | + assertEquals("[int, long, double, float]", describe(help( |
| 232 | + "from java.lang import Math\nMath.max(1, 2"))); |
236 | 233 | // Arguments' types come from the analysis, e.g. of variables. |
237 | 234 | final SignatureHelp indexOf = help("s = 'abc'\nc = 'b'\n" + |
238 | 235 | "s.indexOf(c, "); |
239 | 236 | assertTrue(describe(indexOf), describe(indexOf).startsWith( |
240 | | - "[java.lang.String:MATCH")); |
| 237 | + "[java.lang.String")); |
241 | 238 | // Constructors. |
242 | 239 | assertTrue(describe(help("from java.util import ArrayList\n" + |
243 | 240 | "ArrayList(")).contains("java.util.Collection")); |
@@ -268,14 +265,14 @@ private static SignatureHelp help(final String code) { |
268 | 265 | } |
269 | 266 | } |
270 | 267 |
|
271 | | - /** Each signature's first parameter type and fit, in order. */ |
| 268 | + /** Each signature's first parameter type, in order. */ |
272 | 269 | private static String describe(final SignatureHelp help) { |
273 | 270 | return help.getSignatures().stream().map(s -> { |
274 | 271 | final String first = s.getParameters().isEmpty() ? "()" : s |
275 | 272 | .getParameters().get(0).getLabel().getLeft(); |
276 | 273 | final String type = first.contains(" ") ? first.substring(0, first |
277 | 274 | .lastIndexOf(' ')) : first; |
278 | | - return type + ":" + RatedSignatureInformation.fitOf(s); |
| 275 | + return type; |
279 | 276 | }).collect(Collectors.toList()).toString(); |
280 | 277 | } |
281 | 278 |
|
|
0 commit comments