%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/torque/server-data.h" #include "src/torque/declarable.h" #include "src/torque/implementation-visitor.h" namespace v8 { namespace internal { namespace torque { DEFINE_CONTEXTUAL_VARIABLE(LanguageServerData) void LanguageServerData::AddDefinition(SourcePosition token, SourcePosition definition) { Get().definitions_map_[token.source].emplace_back(token, definition); } base::Optional<SourcePosition> LanguageServerData::FindDefinition( SourceId source, LineAndColumn pos) { if (!source.IsValid()) return base::nullopt; auto iter = Get().definitions_map_.find(source); if (iter == Get().definitions_map_.end()) return base::nullopt; for (const DefinitionMapping& mapping : iter->second) { SourcePosition current = mapping.first; if (current.Contains(pos)) return mapping.second; } return base::nullopt; } void LanguageServerData::PrepareAllDeclarableSymbols() { const std::vector<std::unique_ptr<Declarable>>& all_declarables = global_context_->declarables_; for (const auto& declarable : all_declarables) { // Class field accessors and implicit specializations are // auto-generated and should not show up. if (!declarable->IsUserDefined()) continue; SourceId source = declarable->Position().source; symbols_map_[source].push_back(declarable.get()); } } } // namespace torque } // namespace internal } // namespace v8