Class BslTextSearchSupplier
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.bm.ui.refactoring.BslTextSearchSupplier
-
- All Implemented Interfaces:
ITextSearchSupplier
- Direct Known Subclasses:
BslTextSearchRefactoringSupplier
,BslTextSearchReferenceFinderSupplier
public class BslTextSearchSupplier extends Object implements ITextSearchSupplier
ITextSearchSupplier
for Bsl module. Contains methods for refactoring and reference finding in Bsl module by full text search results
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
BSL_EXT
Extension of Bsl module fileprotected org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProvider
resourceSetProvider
ResourceSet
for loading Bsl modules
-
Constructor Summary
Constructors Constructor Description BslTextSearchSupplier(IProjectFileSystemSupportProvider fileSystemSupportProvider, BslGrammarAccess bslGrammar, org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProvider resourceSetProvider, DynamicFeatureAccessComputer dynamicFeatureAccessComputer, IV8ProjectManager projectManager, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
filterMatcherForCommentAndStringLiteral(TextSearchFileMatch match, org.eclipse.emf.common.util.URI semanticObjectUri, org.eclipse.emf.common.util.URI topObjectUri, Collection<Match> correctSearchResult)
Filters all matches: if found match is part of another wordprotected void
filterMatcherForSemanticObject(org.eclipse.emf.ecore.EObject context, TextSearchFileMatch result, org.eclipse.emf.ecore.EObject semanticObject, boolean isMethod, String oldName, org.eclipse.xtext.scoping.IScope propertyScope, org.eclipse.emf.common.util.URI topObjectUri, Collection<Match> correctSearchResult)
Filters all matches: if semantic element isInvocation
or contains inInvocation
and renaming element is notMethod
if semantic element isIndexAccess
or contains inIndexAccess
and renaming element isMethod
if semantic element isStaticFeatureAccess
if renaming element isMethod
and semantic container element is noInvocation
if semantic element isFeatureAccess
and its name is not equals to old name of the renaming element if semantic element corresponding to the another element (not renaming) with the same nameprotected void
filterMatchesForFormalParam(TextSearchFileMatch match, org.eclipse.emf.ecore.EObject context, boolean isComment, org.eclipse.emf.common.util.URI semanticObjectUri, org.eclipse.emf.common.util.URI moduleUri, Module module, Collection<Match> correctSearchResult)
Filters all matches: if matches not corresponding to the comment inModule
if matches not corresponding to the comment forMethod
for renamingFormalParam
protected void
filterMatchesFromDcs(Method context, Collection<TextSearchModelMatch> matches, Collection<Match> correctSearchResult)
Filters all matches for DCS file: if name of the CommonModule is not equals for name if the common module of renamingMethod
Collection<Match>
filterSearchResult(org.eclipse.emf.ecore.EObject context, String oldName, Collection<Match> results)
Filters search resultsCollection<String>
getSearchStrings(org.eclipse.emf.ecore.EObject context, String oldName)
Generates strings for full text search by renaming element and its original name
-
-
-
Field Detail
-
BSL_EXT
protected static final String BSL_EXT
Extension of Bsl module file- See Also:
- Constant Field Values
-
resourceSetProvider
protected org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProvider resourceSetProvider
ResourceSet
for loading Bsl modules
-
-
Constructor Detail
-
BslTextSearchSupplier
@Inject public BslTextSearchSupplier(IProjectFileSystemSupportProvider fileSystemSupportProvider, BslGrammarAccess bslGrammar, org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProvider resourceSetProvider, DynamicFeatureAccessComputer dynamicFeatureAccessComputer, IV8ProjectManager projectManager, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
Constructor- Parameters:
fileSystemSupportProvider
- actualIProjectFileSystemSupportProvider
, cannot benull
bslGrammar
- actualBslGrammarAccess
, cannot benull
resourceSetProvider
- specialIResourceSetProvider
for getting actial content of the bsl module, cannot benull
dynamicFeatureAccessComputer
- actualDynamicFeatureAccessComputer
, cannot benull
projectManager
- actualIV8ProjectManager
, cannot benull
scopeProvider
- actualIGlobalScopeProvider
for getting actualProperty
scope for filtering matches corresponding to theDynamicFeatureAccess
in Bsl module, cannot benull
-
-
Method Detail
-
getSearchStrings
public Collection<String> getSearchStrings(org.eclipse.emf.ecore.EObject context, String oldName)
Description copied from interface:ITextSearchSupplier
Generates strings for full text search by renaming element and its original name- Specified by:
getSearchStrings
in interfaceITextSearchSupplier
- Parameters:
context
- renaming element, cannot benull
oldName
- original name, cannot benull
- Returns:
- strings for full text search by renaming element and its original name, never
null
-
filterSearchResult
public Collection<Match> filterSearchResult(org.eclipse.emf.ecore.EObject context, String oldName, Collection<Match> results)
Description copied from interface:ITextSearchSupplier
Filters search results- Specified by:
filterSearchResult
in interfaceITextSearchSupplier
- Parameters:
context
- renaming element, cannot benull
oldName
- original name, cannot benull
results
- full text search results for filtering, cannot benull
- Returns:
- filtered search result, never
null
-
filterMatcherForSemanticObject
protected void filterMatcherForSemanticObject(org.eclipse.emf.ecore.EObject context, TextSearchFileMatch result, org.eclipse.emf.ecore.EObject semanticObject, boolean isMethod, String oldName, org.eclipse.xtext.scoping.IScope propertyScope, org.eclipse.emf.common.util.URI topObjectUri, Collection<Match> correctSearchResult)
Filters all matches:- if semantic element is
Invocation
or contains inInvocation
and renaming element is notMethod
- if semantic element is
IndexAccess
or contains inIndexAccess
and renaming element isMethod
- if semantic element is
StaticFeatureAccess
- if renaming element is
Method
and semantic container element is noInvocation
- if semantic element is
FeatureAccess
and its name is not equals to old name of the renaming element - if semantic element corresponding to the another element (not renaming) with the same name
- Parameters:
context
- context object of refactoring or references finding, cannot benull
result
- matches from full text search, cannot benull
semanticObject
- computing semantic object corresponding to the foundmatch
, cannot benull
isMethod
-true
if renaming element isMethod
,false
otherwiseoldName
- old name of renaming object, cannot benull
propertyScope
-IScope
of actualProperty
s for filtering matches corresponding to theDynamicFeatureAccess
in Bsl module, cannot benull
topObjectUri
-URI
to the actualModule
, cannot benull
correctSearchResult
- collector for correct results, cannot benull
- if semantic element is
-
filterMatchesForFormalParam
protected void filterMatchesForFormalParam(TextSearchFileMatch match, org.eclipse.emf.ecore.EObject context, boolean isComment, org.eclipse.emf.common.util.URI semanticObjectUri, org.eclipse.emf.common.util.URI moduleUri, Module module, Collection<Match> correctSearchResult)
Filters all matches:- if matches not corresponding to the comment in
Module
- if matches not corresponding to the comment for
Method
for renamingFormalParam
- Parameters:
match
- matches from full text search, cannot benull
context
- actual renaming object, cannot benull
isComment
-true
if matches was found in comment,false
otherwisesemanticObjectUri
-URI
to the actual semantic object corresponding to the processing match, cannot benull
moduleUri
- actualURI
of the module for renaming element, cannot benull
module
-Module
corresponding to the found match, cannot benull
correctSearchResult
- collector for correct results, cannot benull
- if matches not corresponding to the comment in
-
filterMatcherForCommentAndStringLiteral
protected void filterMatcherForCommentAndStringLiteral(TextSearchFileMatch match, org.eclipse.emf.common.util.URI semanticObjectUri, org.eclipse.emf.common.util.URI topObjectUri, Collection<Match> correctSearchResult)
Filters all matches:- if found match is part of another word
- Parameters:
result
- matches from full text search, cannot benull
semanticObjectUri
-URI
to the actual semantic object corresponding to the processing match, cannot benull
topObjectUri
-URI
to the actualModule
, cannot benull
correctSearchResult
- collector for correct results, cannot benull
-
filterMatchesFromDcs
protected void filterMatchesFromDcs(Method context, Collection<TextSearchModelMatch> matches, Collection<Match> correctSearchResult)
Filters all matches for DCS file:- if name of the CommonModule is not equals for name if the common module of renaming
Method
- Parameters:
context
- actual renaming object, cannot benull
matches
- found matches from full text search, cannot benull
correctSearchResult
- collector for correct results, cannot benull
- if name of the CommonModule is not equals for name if the common module of renaming
-
-