update to lsp for TCL
This commit is contained in:
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import {
|
||||
createConnection,
|
||||
TextDocuments,
|
||||
ProposedFeatures,
|
||||
TextDocumentSyncKind,
|
||||
InitializeParams,
|
||||
InitializeResult,
|
||||
CompletionItemKind,
|
||||
TextDocumentPositionParams,
|
||||
CompletionItem,
|
||||
TextEdit,
|
||||
Range,
|
||||
Position
|
||||
} from "vscode-languageserver/node"
|
||||
import { TextDocument } from "vscode-languageserver-textdocument"
|
||||
|
||||
// Create a connection for the server, using Node's IPC as a transport.
|
||||
// Also include all preview / proposed LSP features.
|
||||
let connection = createConnection(ProposedFeatures.all)
|
||||
|
||||
// Create a simple text document manager.
|
||||
let documents: TextDocuments<TextDocument> = new TextDocuments(TextDocument)
|
||||
|
||||
connection.onInitialize((params: InitializeParams) => {
|
||||
let capabilities = params.capabilities
|
||||
|
||||
// Does the client support the `workspace/configuration` request?
|
||||
// If not, we fall back using global settings.
|
||||
const result: InitializeResult = {
|
||||
capabilities: {
|
||||
textDocumentSync: TextDocumentSyncKind.Incremental,
|
||||
// Tell the client that this server supports code completion.
|
||||
completionProvider: {
|
||||
resolveProvider: false
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
})
|
||||
|
||||
// This handler provides the initial list of the completion items.
|
||||
connection.onCompletion((params: TextDocumentPositionParams): CompletionItem[] => {
|
||||
const doc = documents.get(params.textDocument.uri)
|
||||
if (!doc) return []
|
||||
|
||||
const text = doc.getText()
|
||||
|
||||
return []
|
||||
})
|
||||
|
||||
connection.onDocumentFormatting(async (params, token) => {
|
||||
const document = documents.get(params.textDocument.uri)
|
||||
if (!document) return []
|
||||
|
||||
const originalText = document.getText()
|
||||
|
||||
return []
|
||||
})
|
||||
|
||||
documents.onDidChangeContent(async (change) => {
|
||||
connection.console.log("Document has changed")
|
||||
})
|
||||
|
||||
// Make the text document manager listen on the connection
|
||||
// for open, change and close text document events
|
||||
documents.listen(connection)
|
||||
|
||||
// Listen on the connection
|
||||
connection.listen()
|
||||
Reference in New Issue
Block a user