Class BslFullTextSearchSupplier
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.bm.ui.refactoring.BslFullTextSearchSupplier
-
- All Implemented Interfaces:
IFullTextSearchSupplier
- Direct Known Subclasses:
BslFullTextSearchRefactoringSupplier
,BslFullTextSearchReferenceFinderSupplier
public class BslFullTextSearchSupplier extends Object implements IFullTextSearchSupplier
IFullTextSearchSupplier
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 BslFullTextSearchSupplier(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(DtMatch result, org.eclipse.emf.common.util.URI semanticObjectUri, org.eclipse.emf.common.util.URI topObjectUri, Collection<IDtMatchProvider> correctSearchResult)
Filters all matches: if found match is part of another wordprotected void
filterMatcherForSemanticObject(org.eclipse.emf.ecore.EObject context, DtMatch 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<IDtMatchProvider> 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(DtMatch result, 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<IDtMatchProvider> 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<IDtMatchProvider> matches, Collection<IDtMatchProvider> correctSearchResult)
Filters all matches for DCS file: if name of the CommonModule is not equals for name if the common module of renamingMethod
Collection<IDtMatchProvider>
filterSearchResult(org.eclipse.emf.ecore.EObject context, String oldName, Collection<IDtMatchProvider> results)
Filters search resultsprotected org.eclipse.core.resources.IFile
getIFile(DtMatch match)
GetsIFile
by full text search resultprotected Module
getModule(DtMatch match, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Gets Bsl module by full text search resultCollection<String>
getSearchStrings(org.eclipse.emf.ecore.EObject context, String oldName)
Generates strings for full text search by renaming element and its original nameboolean
isObjectTextAttribute(IBmObject bmObject)
Checks that refactoring for this object does not link withIFile
corresponding to thebmObject
-
-
-
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
-
BslFullTextSearchSupplier
@Inject public BslFullTextSearchSupplier(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
, can't benull
bslGrammar
- actualBslGrammarAccess
, can't benull
resourceSetProvider
- specialIResourceSetProvider
for getting actial content of the bsl module, can't benull
dynamicFeatureAccessComputer
- actualDynamicFeatureAccessComputer
, can't benull
projectManager
- actualIV8ProjectManager
, can't 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:IFullTextSearchSupplier
Generates strings for full text search by renaming element and its original name- Specified by:
getSearchStrings
in interfaceIFullTextSearchSupplier
- 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<IDtMatchProvider> filterSearchResult(org.eclipse.emf.ecore.EObject context, String oldName, Collection<IDtMatchProvider> results)
Description copied from interface:IFullTextSearchSupplier
Filters search results- Specified by:
filterSearchResult
in interfaceIFullTextSearchSupplier
- 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
-
isObjectTextAttribute
public boolean isObjectTextAttribute(IBmObject bmObject)
Description copied from interface:IFullTextSearchSupplier
Checks that refactoring for this object does not link withIFile
corresponding to thebmObject
- Specified by:
isObjectTextAttribute
in interfaceIFullTextSearchSupplier
- Parameters:
bmObject
- object which has attribute changing in refactoring, cannot benull
- Returns:
true
if refactoring for this object does not link withIFile
corresponding to thebmObject
,false
otherwise
-
getModule
protected Module getModule(DtMatch match, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Gets Bsl module by full text search result- Parameters:
match
- full text search result, can't benull
resourceSet
-ResourceSet
for getting Bsl resource, can't benull
- Returns:
- Bsl module corresponding to full text search result, can be
null
if there is no Bsl modules for this result
-
getIFile
protected org.eclipse.core.resources.IFile getIFile(DtMatch match)
GetsIFile
by full text search result- Parameters:
match
- full text search result, can't benull
- Returns:
IFile
by full text search result, can benull
if there is no correspondingIFile
-
filterMatcherForSemanticObject
protected void filterMatcherForSemanticObject(org.eclipse.emf.ecore.EObject context, DtMatch 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<IDtMatchProvider> 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, can't benull
result
- matches from full text search, can't benull
semanticObject
- computing semantic object corresponding to the foundmatch
, can't benull
isMethod
-true
if renaming element isMethod
,false
otherwiseoldName
- old name of renaming object, can't 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, can't benull
- if semantic element is
-
filterMatchesForFormalParam
protected void filterMatchesForFormalParam(DtMatch result, 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<IDtMatchProvider> 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:
result
- matches from full text search, can't benull
context
- actual renaming object, can't 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, can't benull
module
-Module
corresponding to the found match, can't benull
correctSearchResult
- collector for correct results, can't benull
- if matches not corresponding to the comment in
-
filterMatcherForCommentAndStringLiteral
protected void filterMatcherForCommentAndStringLiteral(DtMatch result, org.eclipse.emf.common.util.URI semanticObjectUri, org.eclipse.emf.common.util.URI topObjectUri, Collection<IDtMatchProvider> correctSearchResult)
Filters all matches:- if found match is part of another word
- Parameters:
result
- matches from full text search, can't 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, can't benull
-
filterMatchesFromDcs
protected void filterMatchesFromDcs(Method context, Collection<IDtMatchProvider> matches, Collection<IDtMatchProvider> 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, can't benull
matches
- found matches from full text search, can't benull
correctSearchResult
- collector for correct results, can't benull
- if name of the CommonModule is not equals for name if the common module of renaming
-
-