About PsiField initial value problem! Follow
I want to add or change or delete in the initial value
But sometime the psifield.getInitializer() may be null
so how can i add a new initializer to the psifield?
And
getManager().getElementFactory().createExpressionFromText(String text,Psielement element);
The element parameter is for what?
Thx
Please sign in to leave a comment.
PeterGC wrote:
The is a context to resolve references in 'text'
Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
So How about when the getInitializer() return null,
how can i add a new initializer to the psifield?
On Tue, 27 Jan 2004 12:46:19 +0300, Dmitry Lomov (JetBrains) wrote:
>> getManager().getElementFactory().createExpressionFromText(String
>> text,Psielement element);
>>
>> The element parameter is for what?
Sorry for thread hijacking, but. When ever I addBefore() a PsiDocComment,
I see the comment appear in the code, but then I get hit with a "Text
block not empty" exception, which no hint as to -what- text block its
referring to.
I'm using the following:
commentString = "/**\n * some comment\n */";
element = elementFactory.createCommentFromText(commentString, null);
method.addBefore(element, method.getFirstChild());
PsiDocumentManager pdm = PsiDocumentManager.getInstance(project);
pdm.commitDocument(documentEvent.getDocument());
I have a suspicion that the problem lies in the method.getFirstChild()
maybe.
Mark
Mark Derricutt wrote:
>>> getManager().getElementFactory().createExpressionFromText(String
>>> text,Psielement element);
>>>
>>> The element parameter is for what?
>>
>> The is a context to resolve references in 'text'
Mark,
you should commit document before any modifications to PSI.
Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
On Tue, 27 Jan 2004 13:55:25 +0300, Dmitry Lomov (JetBrains) wrote:
Excellent, you're the man :) How about changing the assert to saying that ;)
;)
Done.
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Mark Derricutt" <mark@talios.com> wrote in message
news:pan.2004.01.27.18.51.29.240357@talios.com...
>
>
;)
>