86a8412b05
Here we want getting trailing comma in order to check its correctness and then to report diagnostics. Now, note that if we have stub for some PSI element, it means that we're definitely not in the compiler as there are no stubs and we're definitely not in the current source file, because in the current file we have full PSI tree in IDE. Stubs are required, for example, for decompiled code and there is no need to report any diagnostics about trailing comma there. Also, because we don't have stubs for destructuring declarations, one check for trailing commas is left without similar guard ( see resolveLocalVariablesFromDestructuringDeclaration method) This commit fixes several IDE-tests: MultiFileJvmBasicCompletionTestGenerated.testDoNotCompleteWithConstraints MultiFileJvmBasicCompletionTestGenerated.testInImport MultiFileJvmBasicCompletionTestGenerated.testInImportedFunctionLiteralParameter MultiFileJvmBasicCompletionTestGenerated.testMoreSpecificExtensionGeneric MultiFileJvmBasicCompletionTestGenerated.testNoGenericFunDuplication MultiFileJvmBasicCompletionTestGenerated.testNotImportedExtensionFunction2