[Lang] Versioning the PSI-Tree-Cache

I just wondered how I can tell IDEA that I changed something in the
Plugin which may affect any cached structures.
Does IDEA checks for the plugin's version attribute? Or for the
modification date of the plugin's jar?

5 comments
Comment actions Permalink

Hello Sven,

SS> I just wondered how I can tell IDEA that I changed something in the
SS> Plugin which may affect any cached structures.
SS> Does IDEA checks for the plugin's version attribute? Or for the
SS> modification date of the plugin's jar?

IDEA does not currently build any caches for files in custom languages.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hugh?!
We have rather large projects where an html-like file is always paired
with an java-file (forming an web component).
The custom language api will be unusable if it reparses all files during
start or synchronize.

Dmitry Jemerov (JetBrains) schrieb:

Hello Sven,

SS> I just wondered how I can tell IDEA that I changed something in the
SS> Plugin which may affect any cached structures.
SS> Does IDEA checks for the plugin's version attribute? Or for the
SS> modification date of the plugin's jar?

IDEA does not currently build any caches for files in custom languages.

0
Comment actions Permalink

Hello Sven,

Well, the "no caches" is not fully correct - IDEA does build the word cache
that it uses for searching for identifiers. But that cache doesn't usually
depend on the PSI structure.

IDEA builds the PSI tree only for files that you open, so it won't reparse
any files during start or synchronize.

SS> Hugh?!
SS> We have rather large projects where an html-like file is always paired
SS> with an java-file (forming an web component).
SS> The custom language api will be unusable if it reparses all files during
SS> start or synchronize.
SS> Dmitry Jemerov (JetBrains) schrieb:
SS>
>> Hello Sven,
>>
>> SS> I just wondered how I can tell IDEA that I changed something in
>> the
>> SS> Plugin which may affect any cached structures.
>> SS> Does IDEA checks for the plugin's version attribute? Or for the
>> SS> modification date of the plugin's jar?
>> IDEA does not currently build any caches for files in custom
>> languages.
>>
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hello Dmitry,

ok, so in normal cases this cache should be no problem.
But when changing the lexer (because I use an DefaultWordScanner), I
must clear the caches manually, right?

Dmitry Jemerov (JetBrains) schrieb:

Hello Sven,

Well, the "no caches" is not fully correct - IDEA does build the word
cache that it uses for searching for identifiers. But that cache doesn't
usually depend on the PSI structure.

IDEA builds the PSI tree only for files that you open, so it won't
reparse any files during start or synchronize.

0
Comment actions Permalink

Hello Sven,

The only situation where you would need to clear the caches is that you have
changed the way certain words are treated as comments, literals or identifiers.
If you simply add or remove lexer token types without changing the token
set to which any of the words in the file belongs, you do not need to clear
the caches.

SS> ok, so in normal cases this cache should be no problem.
SS> But when changing the lexer (because I use an DefaultWordScanner), I
SS> must clear the caches manually, right?
SS> Dmitry Jemerov (JetBrains) schrieb:
SS>
>> Hello Sven,
>>
>> Well, the "no caches" is not fully correct - IDEA does build the word
>> cache that it uses for searching for identifiers. But that cache
>> doesn't usually depend on the PSI structure.
>>
>> IDEA builds the PSI tree only for files that you open, so it won't
>> reparse any files during start or synchronize.
>>
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.