diff options
| author | Yong He <yonghe@outlook.com> | 2022-06-22 19:58:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-22 19:58:34 -0700 |
| commit | 07a380d72a13899a84cbdc35692be7a3d9246dcb (patch) | |
| tree | 68e77f2e9682b3b7c3debd745604a494439e5b25 /source/compiler-core | |
| parent | e5a75563a1ba2e378353af8b937b8b7bb0fe2c2b (diff) | |
More Language Server Improvements. (#2289)
Diffstat (limited to 'source/compiler-core')
| -rw-r--r-- | source/compiler-core/slang-json-rpc-connection.h | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-lexer.cpp | 5 | ||||
| -rw-r--r-- | source/compiler-core/slang-token-defs.h | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/source/compiler-core/slang-json-rpc-connection.h b/source/compiler-core/slang-json-rpc-connection.h index 07b7cc347..18749229c 100644 --- a/source/compiler-core/slang-json-rpc-connection.h +++ b/source/compiler-core/slang-json-rpc-connection.h @@ -148,6 +148,8 @@ public: /// it will become invalid in most usage scenarios. PersistentJSONValue getPersistentValue(const JSONValue& value) { return PersistentJSONValue(value, &m_container, SourceLoc()); } + HTTPPacketConnection* getUnderlyingConnection() { return m_connection.Ptr(); } + /// Dtor ~JSONRPCConnection() { disconnect(); } diff --git a/source/compiler-core/slang-lexer.cpp b/source/compiler-core/slang-lexer.cpp index d149a88bc..fd0255575 100644 --- a/source/compiler-core/slang-lexer.cpp +++ b/source/compiler-core/slang-lexer.cpp @@ -1167,6 +1167,9 @@ namespace Slang switch(_peek(lexer)) { case '#': _advance(lexer); return TokenType::PoundPound; + + case '?': _advance(lexer); return TokenType::CompletionRequest; + default: return TokenType::Pound; } @@ -1337,7 +1340,7 @@ namespace Slang } } - if (tokenType == TokenType::Identifier) + if (tokenType == TokenType::Identifier || tokenType == TokenType::CompletionRequest) { token.setName(m_namePool->getName(token.getContent())); } diff --git a/source/compiler-core/slang-token-defs.h b/source/compiler-core/slang-token-defs.h index fdbe81e17..45b4912e7 100644 --- a/source/compiler-core/slang-token-defs.h +++ b/source/compiler-core/slang-token-defs.h @@ -90,6 +90,8 @@ PUNCTUATION(PoundPound, "##") PUNCTUATION(Scope, "::") +PUNCTUATION(CompletionRequest, "#?") + #undef PUNCTUATION // Un-define the `TOKEN` macro so that client doesn't have to |
