mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:20:10 +01:00
Add caching of parsed documents, and testing of the textDocument handlers. This is based on #4896, which splits out some of the boilerplate to calls. Note, this caches the entire parse state because we'll want to try to emit diagnostics when we see the update, without waiting. It may be helpful to do that asynchronously, but we don't want to wait for another call (such as documentSymbol). Really, we'll probably want to also add check for diagnostics, at least.
22 lines
840 B
Plaintext
22 lines
840 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/language_server/testdata/document_symbol/unknown.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/language_server/testdata/document_symbol/unknown.carbon
|
|
|
|
// --- STDIN
|
|
[[@LSP-CALL:textDocument/documentSymbol:
|
|
"textDocument": {"uri": "file:/test.carbon"}
|
|
]]
|
|
[[@LSP-NOTIFY:exit]]
|
|
|
|
// --- AUTOUPDATE-SPLIT
|
|
|
|
// CHECK:STDERR: /test.carbon: warning: unknown file requested [LanguageServerFileUnknown]
|
|
// CHECK:STDERR:
|
|
// CHECK:STDOUT:
|