use of com.github._1c_syntax.mdclasses.mdo.support.ModuleType in project bsl-language-server by 1c-syntax.
the class ReferenceIndex method getSourceDefinedSymbol.
private Optional<SourceDefinedSymbol> getSourceDefinedSymbol(MultiKey<String> multikey) {
String mdoRef = multikey.getKey(0);
ModuleType moduleType = ModuleType.valueOf(multikey.getKey(1));
String symbolName = multikey.getKey(2);
return serverContext.getDocument(mdoRef, moduleType).map(DocumentContext::getSymbolTree).flatMap(symbolTree -> symbolTree.getMethodSymbol(symbolName));
}
use of com.github._1c_syntax.mdclasses.mdo.support.ModuleType in project bsl-language-server by 1c-syntax.
the class ReferenceIndex method addMethodCall.
/**
* Добавить вызов метода в индекс.
*
* @param uri URI документа, откуда произошел вызов.
* @param mdoRef Ссылка на объект-метаданных, к которому происходит обращение (например, CommonModule.ОбщийМодуль1).
* @param moduleType Тип модуля, к которому происходит обращение (например, {@link ModuleType#CommonModule}).
* @param symbolName Имя символа, к которому происходит обращение.
* @param range Диапазон, в котором происходит обращение к символу.
*/
@Synchronized
public void addMethodCall(URI uri, String mdoRef, ModuleType moduleType, String symbolName, Range range) {
String symbolNameCanonical = symbolName.toLowerCase(Locale.ENGLISH);
Location location = new Location(uri.toString(), range);
MultiKey<String> key = getKey(mdoRef, moduleType);
MultiKey<String> rangesKey = getRangesKey(mdoRef, moduleType, symbolNameCanonical);
referencesTo.computeIfAbsent(key, k -> new ArrayListValuedHashMap<>()).put(symbolNameCanonical, location);
referencesFrom.computeIfAbsent(uri, k -> new ArrayListValuedHashMap<>()).put(rangesKey, range);
referencesRanges.computeIfAbsent(uri, k -> new HashMap<>()).put(range, rangesKey);
}
use of com.github._1c_syntax.mdclasses.mdo.support.ModuleType in project mdclasses by 1c-syntax.
the class MDOUtils method moduleTypesForMDOTypes.
private Map<MDOType, Set<ModuleType>> moduleTypesForMDOTypes() {
Map<MDOType, Set<ModuleType>> result = new EnumMap<>(MDOType.class);
for (MDOType mdoType : MDOType.values()) {
Set<ModuleType> types = new HashSet<>();
switch(mdoType) {
case INTEGRATION_SERVICE:
types.add(ModuleType.IntegrationServiceModule);
break;
case BOT:
types.add(ModuleType.BotModule);
break;
case ACCOUNTING_REGISTER:
case ACCUMULATION_REGISTER:
case CALCULATION_REGISTER:
case INFORMATION_REGISTER:
types.add(ModuleType.ManagerModule);
types.add(ModuleType.RecordSetModule);
break;
case BUSINESS_PROCESS:
case CATALOG:
case CHART_OF_ACCOUNTS:
case CHART_OF_CALCULATION_TYPES:
case CHART_OF_CHARACTERISTIC_TYPES:
case DATA_PROCESSOR:
case DOCUMENT:
case EXCHANGE_PLAN:
case REPORT:
case TASK:
types.add(ModuleType.ManagerModule);
types.add(ModuleType.ObjectModule);
break;
case COMMAND_GROUP:
case COMMON_ATTRIBUTE:
case COMMON_PICTURE:
case COMMON_TEMPLATE:
case DEFINED_TYPE:
case DOCUMENT_NUMERATOR:
case EVENT_SUBSCRIPTION:
case FUNCTIONAL_OPTION:
case ROLE:
case SCHEDULED_JOB:
case SESSION_PARAMETER:
case STYLE_ITEM:
case STYLE:
case SUBSYSTEM:
case WS_REFERENCE:
case XDTO_PACKAGE:
break;
case COMMON_COMMAND:
case COMMAND:
types.add(ModuleType.CommandModule);
break;
case COMMON_FORM:
case FORM:
types.add(ModuleType.FormModule);
break;
case COMMON_MODULE:
types.add(ModuleType.CommonModule);
break;
case CONFIGURATION:
types.add(ModuleType.ApplicationModule);
types.add(ModuleType.SessionModule);
types.add(ModuleType.ExternalConnectionModule);
types.add(ModuleType.ManagedApplicationModule);
types.add(ModuleType.OrdinaryApplicationModule);
break;
case CONSTANT:
types.add(ModuleType.ValueManagerModule);
break;
case DOCUMENT_JOURNAL:
case ENUM:
case FILTER_CRITERION:
case SETTINGS_STORAGE:
types.add(ModuleType.ManagerModule);
break;
case HTTP_SERVICE:
types.add(ModuleType.HTTPServiceModule);
break;
case SEQUENCE:
types.add(ModuleType.RecordSetModule);
break;
case WEB_SERVICE:
types.add(ModuleType.WEBServiceModule);
break;
default:
}
result.put(mdoType, types);
}
return result;
}
Aggregations