mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[java-completion] IDEA-344077, IDEA-343842, IDEA-343839 new transformer for java
- support for generics, empty parameters - formatting GitOrigin-RevId: 4f0e392627c0ee6f0965d43110600364472c18de
This commit is contained in:
committed by
intellij-monorepo-bot
parent
67fc8cba2c
commit
345e1cc7e9
@@ -24,5 +24,6 @@ interface CorrectnessChecker {
|
||||
fun checkSemantic(file: PsiFile,
|
||||
suggestion: String,
|
||||
offset: Int,
|
||||
prefix: String): CheckResult
|
||||
prefix: String,
|
||||
matchedEnclosuresIndices: Set<Int>? = null): CheckResult
|
||||
}
|
||||
@@ -25,7 +25,7 @@ open class CorrectnessCheckerBase(private val semanticCheckers: List<SemanticChe
|
||||
* @return a file to be passed to [semanticCheckers].
|
||||
* @see [checkSemantic]
|
||||
*/
|
||||
protected open fun buildPsiForSemanticChecks(file: PsiFile, suggestion: String, offset: Int, prefix: String): PsiFile {
|
||||
protected open fun buildPsiForSemanticChecks(file: PsiFile, suggestion: String, offset: Int, prefix: String, matchedEnclosuresIndices: Set<Int>?): PsiFile {
|
||||
return file
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ open class CorrectnessCheckerBase(private val semanticCheckers: List<SemanticChe
|
||||
|
||||
private val rawSemanticCheckers = semanticCheckers.filterIsInstance<RawSemanticChecker>()
|
||||
|
||||
final override fun checkSemantic(file: PsiFile, suggestion: String, offset: Int, prefix: String): CorrectnessChecker.CheckResult {
|
||||
val fullPsi = buildPsiForSemanticChecks(file, suggestion, offset, prefix)
|
||||
final override fun checkSemantic(file: PsiFile, suggestion: String, offset: Int, prefix: String, matchedEnclosuresIndices: Set<Int>?): CorrectnessChecker.CheckResult {
|
||||
val fullPsi = buildPsiForSemanticChecks(file, suggestion, offset, prefix, matchedEnclosuresIndices)
|
||||
|
||||
val range = TextRange(offset - prefix.length, offset + suggestion.length - prefix.length)
|
||||
|
||||
|
||||
@@ -13,7 +13,13 @@ class PythonCorrectnessChecker : CorrectnessCheckerBase(listOf(
|
||||
PyRedeclarationSemanticChecker,
|
||||
PyAssignmentToLibraryScopeSemanticChecker,
|
||||
)) {
|
||||
override fun buildPsiForSemanticChecks(file: PsiFile, suggestion: String, offset: Int, prefix: String): PsiFile {
|
||||
override fun buildPsiForSemanticChecks(
|
||||
file: PsiFile,
|
||||
suggestion: String,
|
||||
offset: Int,
|
||||
prefix: String,
|
||||
matchedEnclosuresIndices: Set<Int>?
|
||||
): PsiFile {
|
||||
return PyExpressionCodeFragmentImpl(
|
||||
file.project,
|
||||
FileUtil.getNameWithoutExtension(file.name) + ".py",
|
||||
|
||||
Reference in New Issue
Block a user