Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
ea3520e4
Commit
ea3520e4
authored
7 years ago
by
Sergey.Anchipolevsky
1
Browse files
Options
Download
Email Patches
Plain Diff
[yaml, kubernetes] corrections upon review IDEA-CR-29807
parent
e912c499
Branches unavailable
Tags unavailable
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugins/yaml/src/org/jetbrains/yaml/meta/impl/YamlDocumentationProviderBase.java
+4
-3
...tbrains/yaml/meta/impl/YamlDocumentationProviderBase.java
plugins/yaml/src/org/jetbrains/yaml/meta/model/Field.java
+1
-16
plugins/yaml/src/org/jetbrains/yaml/meta/model/Field.java
plugins/yaml/src/org/jetbrains/yaml/meta/model/TypeFieldPair.java
+26
-0
...yaml/src/org/jetbrains/yaml/meta/model/TypeFieldPair.java
with
31 additions
and
19 deletions
+31
-19
plugins/yaml/src/org/jetbrains/yaml/meta/impl/YamlDocumentationProviderBase.java
+
4
-
3
View file @
ea3520e4
...
...
@@ -16,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.yaml.YAMLLanguage
;
import
org.jetbrains.yaml.meta.model.Field
;
import
org.jetbrains.yaml.meta.model.TypeFieldPair
;
import
org.jetbrains.yaml.meta.model.YamlMetaType
;
import
org.jetbrains.yaml.meta.model.YamlMetaType.ForcedCompletionPath
;
import
org.jetbrains.yaml.psi.YAMLKeyValue
;
...
...
@@ -57,8 +58,8 @@ public abstract class YamlDocumentationProviderBase extends AbstractDocumentatio
if
(
object
instanceof
ForcedCompletionPath
)
{
// deep completion
return
createFromCompletionPath
((
ForcedCompletionPath
)
object
,
contextElement
);
}
else
if
(
object
instanceof
YamlMetaTypeProvider
.
MetaTypeProxy
)
{
// basic completion with Field object
return
createFromField
((
YamlMetaTypeProvider
.
MetaTypeProxy
)
object
,
contextElement
);
else
if
(
object
instanceof
TypeFieldPair
)
{
// basic completion with Field object
return
createFromField
((
TypeFieldPair
)
object
,
contextElement
);
}
else
if
(
object
instanceof
String
)
{
// basic completion with plain string
return
createFromString
((
String
)
object
,
contextElement
);
...
...
@@ -184,7 +185,7 @@ public abstract class YamlDocumentationProviderBase extends AbstractDocumentatio
}
@NotNull
private
DocumentationElement
createFromField
(
YamlMetaTypeProvider
.
MetaTypeProxy
field
,
@NotNull
PsiElement
contextElement
)
{
private
DocumentationElement
createFromField
(
@NotNull
TypeFieldPair
field
,
@NotNull
PsiElement
contextElement
)
{
return
new
DocumentationElement
(
contextElement
.
getManager
(),
field
.
getMetaType
(),
field
.
getField
());
}
...
...
This diff is collapsed.
Click to expand it.
plugins/yaml/src/org/jetbrains/yaml/meta/model/Field.java
+
1
-
16
View file @
ea3520e4
...
...
@@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
import
org.jetbrains.annotations.Contract
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.yaml.meta.impl.YamlMetaTypeProvider
;
import
org.jetbrains.yaml.psi.YAMLKeyValue
;
import
javax.swing.*
;
...
...
@@ -223,21 +222,7 @@ public class Field {
return
Collections
.
emptyList
();
}
final
YamlMetaTypeProvider
.
MetaTypeProxy
lookupObject
=
new
YamlMetaTypeProvider
.
MetaTypeProxy
()
{
@NotNull
@Override
public
YamlMetaType
getMetaType
()
{
return
ownerClass
;
}
@NotNull
@Override
public
Field
getField
()
{
return
Field
.
this
;
}
};
LookupElementBuilder
lookup
=
LookupElementBuilder
.
create
(
lookupObject
,
getName
())
LookupElementBuilder
lookup
=
LookupElementBuilder
.
create
(
new
TypeFieldPair
(
ownerClass
,
this
),
getName
())
.
withTypeText
(
myMainType
.
getDisplayName
(),
true
)
.
withIcon
(
getLookupIcon
())
.
withStrikeoutness
(
isDeprecated
());
...
...
This diff is collapsed.
Click to expand it.
plugins/yaml/src/org/jetbrains/yaml/meta/model/TypeFieldPair.java
0 → 100644
+
26
-
0
View file @
ea3520e4
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
org.jetbrains.yaml.meta.model
;
import
org.jetbrains.annotations.NotNull
;
public
class
TypeFieldPair
{
@NotNull
private
final
Field
myField
;
@NotNull
private
final
YamlMetaClass
myOwnerClass
;
public
TypeFieldPair
(
@NotNull
YamlMetaClass
ownerClass
,
@NotNull
Field
field
)
{
myField
=
field
;
myOwnerClass
=
ownerClass
;
}
@NotNull
public
YamlMetaType
getMetaType
()
{
return
myOwnerClass
;
}
@NotNull
public
Field
getField
()
{
return
myField
;
}
}
This diff is collapsed.
Click to expand it.
小 白蛋
@baidan
mentioned in commit
db2853ab
·
2 years ago
mentioned in commit
db2853ab
mentioned in commit db2853ab9c7c8b55cd366116644326f00093c57a
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help