Class BslTextSearchSupplier
java.lang.Object
com._1c.g5.v8.dt.bsl.bm.ui.refactoring.BslTextSearchSupplier
- All Implemented Interfaces:
ITextSearchSupplier
- Direct Known Subclasses:
BslTextSearchRefactoringSupplier,BslTextSearchReferenceFinderSupplier
ITextSearchSupplier for Bsl module. Contains methods for refactoring and
reference finding in Bsl module by full text search results-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringExtension of Bsl module fileprotected org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProviderResourceSetfor loading Bsl modules -
Constructor Summary
ConstructorsConstructorDescriptionBslTextSearchSupplier(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
Modifier and TypeMethodDescriptionprotected voidfilterMatcherForCommentAndStringLiteral(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 voidfilterMatcherForSemanticObject(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 isInvocationor contains inInvocationand renaming element is notMethodif semantic element isIndexAccessor contains inIndexAccessand renaming element isMethodif semantic element isStaticFeatureAccessif renaming element isMethodand semantic container element is noInvocationif semantic element isFeatureAccessand 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 voidfilterMatchesForFormalParam(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 inModuleif matches not corresponding to the comment forMethodfor renamingFormalParamprotected voidfilterMatchesFromDcs(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 renamingMethodfilterSearchResult(org.eclipse.emf.ecore.EObject context, String oldName, Collection<Match> results) Filters search resultsgetSearchStrings(org.eclipse.emf.ecore.EObject context, String oldName) Generates strings for full text search by renaming element and its original name
-
Field Details
-
BSL_EXT
Extension of Bsl module file- See Also:
-
resourceSetProvider
protected org.eclipse.xtext.ui.refactoring.impl.RefactoringResourceSetProvider resourceSetProviderResourceSetfor loading Bsl modules
-
-
Constructor Details
-
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 benullbslGrammar- actualBslGrammarAccess, cannot benullresourceSetProvider- specialIResourceSetProviderfor getting actial content of the bsl module, cannot benulldynamicFeatureAccessComputer- actualDynamicFeatureAccessComputer, cannot benullprojectManager- actualIV8ProjectManager, cannot benullscopeProvider- actualIGlobalScopeProviderfor getting actualPropertyscope for filtering matches corresponding to theDynamicFeatureAccessin Bsl module, cannot benull
-
-
Method Details
-
getSearchStrings
Description copied from interface:ITextSearchSupplierGenerates strings for full text search by renaming element and its original name- Specified by:
getSearchStringsin interfaceITextSearchSupplier- Parameters:
context- renaming element, cannot benulloldName- 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:ITextSearchSupplierFilters search results- Specified by:
filterSearchResultin interfaceITextSearchSupplier- Parameters:
context- renaming element, cannot benulloldName- original name, cannot benullresults- 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
Invocationor contains inInvocationand renaming element is notMethod - if semantic element is
IndexAccessor contains inIndexAccessand renaming element isMethod - if semantic element is
StaticFeatureAccess - if renaming element is
Methodand semantic container element is noInvocation - if semantic element is
FeatureAccessand 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 benullresult- matches from full text search, cannot benullsemanticObject- computing semantic object corresponding to the foundmatch, cannot benullisMethod-trueif renaming element isMethod,falseotherwiseoldName- old name of renaming object, cannot benullpropertyScope-IScopeof actualPropertys for filtering matches corresponding to theDynamicFeatureAccessin Bsl module, cannot benulltopObjectUri-URIto the actualModule, cannot benullcorrectSearchResult- 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
Methodfor renamingFormalParam
- Parameters:
match- matches from full text search, cannot benullcontext- actual renaming object, cannot benullisComment-trueif matches was found in comment,falseotherwisesemanticObjectUri-URIto the actual semantic object corresponding to the processing match, cannot benullmoduleUri- actualURIof the module for renaming element, cannot benullmodule-Modulecorresponding to the found match, cannot benullcorrectSearchResult- 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 benullsemanticObjectUri-URIto the actual semantic object corresponding to the processing match, cannot benulltopObjectUri-URIto the actualModule, cannot benullcorrectSearchResult- 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 benullmatches- found matches from full text search, cannot benullcorrectSearchResult- collector for correct results, cannot benull
- if name of the CommonModule is not equals for name if the common module of renaming
-