Files
sourcekit-lsp/Sources/LanguageServerProtocol/Requests/WorkspaceSemanticTokensRefreshRequest.swift
Fredrik Wieczerkowski 17f656865d Implement lexical and semantic highlighting for Swift
This is an implementation of LSP's semantic tokens for Swift. Both
lexical and semantic tokens are provided by using the syntaxmap and the
semantic annotations provided as part of SourceKit's open responses and
document update notifications.

While lexical tokens are parsed and stored in the DocumentManager
synchronously, semantic tokens are provided asynchronously. If an edit
occurs, tokens are automatically shifted by the DocumentManager. This is
especially relevant for lexical tokens, which are updated in deltas.

In addition, unit tests are added that assert that both lexical and
semantic tokens are provided and shifted correctly upon edits.
2021-08-24 16:49:52 +02:00

22 lines
960 B
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
/// Sent from the server to the client. Servers can use this to ask clients to
/// refresh semantic tokens for editors for which this server provides semantic
/// tokens, useful in cases of project wide configuration changes.
public struct WorkspaceSemanticTokensRefreshRequest: RequestType, Hashable {
public static let method: String = "workspace/semanticTokens/refresh"
public typealias Response = VoidResponse
public init() {}
}