From 0c64995ea28febcc7d38e1519da8d93391ce2e7d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 7 Jun 2022 14:10:49 -0700 Subject: Major language server features. (#2264) * Major language server features. * Include slangd in binary release. * Fix compiler issues. * Fix compiler error. * Completion resolve. * Various improvements. * Update diagnostic test expected output. * Bug fix for source locations. * Adjust diagnostic update frequency. * Update github actions to store artifacts. * Fix infinite parser loop. * Fix parser recovery. * Fix parser recovery. * Update test. * Fix test. * Disable IR gen for language server. * Allow commit characters in auto completion. * Fix lookup for invoke exprs. * More parser robustness fixes. * update solution file Co-authored-by: Yong He --- source/core/slang-string.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/core/slang-string.cpp') diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp index 5f2ba13ba..9b3575ad8 100644 --- a/source/core/slang-string.cpp +++ b/source/core/slang-string.cpp @@ -155,12 +155,27 @@ namespace Slang end() - otherSize, end()) == other; } + bool UnownedStringSlice::endsWithCaseInsensitive(UnownedStringSlice const& other) const + { + UInt thisSize = getLength(); + UInt otherSize = other.getLength(); + + if (otherSize > thisSize) + return false; + + return UnownedStringSlice(end() - otherSize, end()).caseInsensitiveEquals(other); + } + bool UnownedStringSlice::endsWith(char const* str) const { return endsWith(UnownedTerminatedStringSlice(str)); } - + bool UnownedStringSlice::endsWithCaseInsensitive(char const* str) const + { + return endsWithCaseInsensitive(UnownedTerminatedStringSlice(str)); + } + UnownedStringSlice UnownedStringSlice::trim() const { const char* start = m_begin; -- cgit v1.2.3