mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12140 from ethereum/partsOfLSP
Trivialities needed by LSP
This commit is contained in:
commit
6d47168af2
@ -59,6 +59,13 @@ struct SourceLocation
|
||||
return start <= _other.start && _other.end <= end;
|
||||
}
|
||||
|
||||
bool containsOffset(int _pos) const
|
||||
{
|
||||
if (!hasText() || _pos < 0)
|
||||
return false;
|
||||
return start <= _pos && _pos < end;
|
||||
}
|
||||
|
||||
bool intersects(SourceLocation const& _other) const
|
||||
{
|
||||
if (!hasText() || !_other.hasText() || !equalSources(_other))
|
||||
|
@ -246,7 +246,10 @@ public:
|
||||
|
||||
/// @returns the declared name.
|
||||
ASTString const& name() const { return *m_name; }
|
||||
|
||||
/// @returns the location of the declared name itself or empty location if not available or unknown.
|
||||
SourceLocation const& nameLocation() const noexcept { return m_nameLocation; }
|
||||
|
||||
bool noVisibilitySpecified() const { return m_visibility == Visibility::Default; }
|
||||
Visibility visibility() const { return m_visibility == Visibility::Default ? defaultVisibility() : m_visibility; }
|
||||
bool isPublic() const { return visibility() >= Visibility::Public; }
|
||||
|
Loading…
Reference in New Issue
Block a user