Please consider editing your post and mark it as obsolete instead. Do you want to delete post?
[Lang] When to use Annotator and LocalInspectionTool
Permanently deleted user
Created
Are there some usecases when to use them? Eq.: for semantic checks like "unknown reference" use the Annotator. When are they executed, what are the limitations.
SS> Are there some usecases when to use them? SS> Eq.: for semantic checks like "unknown reference" use the Annotator. SS> When are they executed, what are the limitations.
If you need the ability to perform the analysis for multiple files in batch mode (Analyze | Inspect Code), use LocalInspectionTool. Otherwise, use Annotator.
Annotator gives you more flexibility in reporting the problems (with highlight, custom tooltips and so on), and better locality (for custom languages, LocalInspectionTool is always called to reinspect the entire file, while Annotator is called only for changed fragments of the PSI tree).
-- Dmitry Jemerov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
so I am on the right side :) Maybe you could add those sentences to your Custom Language Docu? It simply helps to get the overall picture.
Dmitry Jemerov (JetBrains) schrieb:
Hello Sven,
SS> Are there some usecases when to use them? SS> Eq.: for semantic checks like "unknown reference" use the Annotator. SS> When are they executed, what are the limitations.
If you need the ability to perform the analysis for multiple files in batch mode (Analyze | Inspect Code), use LocalInspectionTool. Otherwise, use Annotator.
Annotator gives you more flexibility in reporting the problems (with highlight, custom tooltips and so on), and better locality (for custom languages, LocalInspectionTool is always called to reinspect the entire file, while Annotator is called only for changed fragments of the PSI tree).
SS> so I am on the right side :) SS> Maybe you could add those sentences to your Custom Language Docu? It SS> simply helps to get the overall picture. SS> Dmitry Jemerov (JetBrains) schrieb: SS> >> Hello Sven, >> >> SS> Are there some usecases when to use them? >> SS> Eq.: for semantic checks like "unknown reference" use the >> Annotator. >> SS> When are they executed, what are the limitations. >> If you need the ability to perform the analysis for multiple files in >> batch mode (Analyze | Inspect Code), use LocalInspectionTool. >> Otherwise, use Annotator. >> >> Annotator gives you more flexibility in reporting the problems (with >> highlight, custom tooltips and so on), and better locality (for >> custom languages, LocalInspectionTool is always called to reinspect >> the entire file, while Annotator is called only for changed fragments >> of the PSI tree). >> -- Dmitry Jemerov Omea Project Leader JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
Additionally, LocalInspectionTool gives you the ability to turn the check off independently, which I don't believe Annotator does, and also allows you to configure the inspections via a panel. Thus any analysis about which there might be any disagreement or choices to be made should probably be a LocalInspectionTool, with Annotator used for actual parse errors.
I think a good rule is, if it's an error or semantic highlighting, use annotator; if it's a warning, use inspection.
Sven Steiniger wrote:
Are there some usecases when to use them? Eq.: for semantic checks like "unknown reference" use the Annotator. When are they executed, what are the limitations.
Hello Sven,
SS> Are there some usecases when to use them?
SS> Eq.: for semantic checks like "unknown reference" use the Annotator.
SS> When are they executed, what are the limitations.
If you need the ability to perform the analysis for multiple files in batch
mode (Analyze | Inspect Code), use LocalInspectionTool. Otherwise, use Annotator.
Annotator gives you more flexibility in reporting the problems (with highlight,
custom tooltips and so on), and better locality (for custom languages, LocalInspectionTool
is always called to reinspect the entire file, while Annotator is called
only for changed fragments of the PSI tree).
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Hello Dmitry,
so I am on the right side :)
Maybe you could add those sentences to your Custom Language Docu? It
simply helps to get the overall picture.
Dmitry Jemerov (JetBrains) schrieb:
Hello Sven,
Added.
SS> so I am on the right side :)
SS> Maybe you could add those sentences to your Custom Language Docu? It
SS> simply helps to get the overall picture.
SS> Dmitry Jemerov (JetBrains) schrieb:
SS>
>> Hello Sven,
>>
>> SS> Are there some usecases when to use them?
>> SS> Eq.: for semantic checks like "unknown reference" use the
>> Annotator.
>> SS> When are they executed, what are the limitations.
>> If you need the ability to perform the analysis for multiple files in
>> batch mode (Analyze | Inspect Code), use LocalInspectionTool.
>> Otherwise, use Annotator.
>>
>> Annotator gives you more flexibility in reporting the problems (with
>> highlight, custom tooltips and so on), and better locality (for
>> custom languages, LocalInspectionTool is always called to reinspect
>> the entire file, while Annotator is called only for changed fragments
>> of the PSI tree).
>>
--
Dmitry Jemerov
Omea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Additionally, LocalInspectionTool gives you the ability to turn the check off independently, which I don't believe Annotator does, and also allows you to configure the inspections via a panel. Thus any analysis about which there might be any disagreement or choices to be made should probably be a LocalInspectionTool, with Annotator used for actual parse errors.
--Dave Griffith
I think a good rule is, if it's an error or semantic highlighting, use
annotator; if it's a warning, use inspection.
Sven Steiniger wrote: