mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
[http-client, microservices] IJPL-179625 ignoreSupPathContext for correct generation requests with query parameters
ignoreSupPathContext is just a workaround for generating requests with query parameters. It would be better if we could use the full URL representation for HttpRequest generation, because right now there's no way to include URL information (e.g., query parameters) on the left side of the context GitOrigin-RevId: 88b22b60ff322c6c10d34cd089c6731359f5de98
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f3df8ba421
commit
ce8c8bf9e3
@@ -16,11 +16,17 @@ import org.jetbrains.uast.UExpression
|
||||
import org.jetbrains.uast.UReferenceExpression
|
||||
import org.jetbrains.uast.expressions.UInjectionHost
|
||||
|
||||
fun urlInlayHintProvider(injector: UrlPathReferenceInjector<UExpression>): UastSemProvider<UrlPathInlayHintsProviderSemElement> {
|
||||
/**
|
||||
* if [ignoreSubPathContext] is true then [UrlPathReferenceInjector.defaultRootContextProvider] is used
|
||||
*/
|
||||
fun urlInlayHintProvider(
|
||||
injector: UrlPathReferenceInjector<UExpression>,
|
||||
ignoreSubPathContext: Boolean = false,
|
||||
): UastSemProvider<UrlPathInlayHintsProviderSemElement> {
|
||||
return uastSemElementProvider(listOf(UInjectionHost::class.java, UReferenceExpression::class.java)) { uExpression, _ ->
|
||||
val context = forbidExpensiveUrlContext {
|
||||
val rootContext = injector.defaultRootContextProvider(uExpression)
|
||||
if (!injector.ignoreSubPathContext) rootContext.subContext(injector.toUrlPath(uExpression))
|
||||
if (!ignoreSubPathContext) rootContext.subContext(injector.toUrlPath(uExpression))
|
||||
else rootContext
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user